As you might have read from my previous post, I am currently enrolled in FBOA and is working on Socket.IO. One of the tasks he gave us was to migrate bundling from using Browserify to using Webpack, and I wrote in my last post that I was not even sure if I was doing it correctly. Well, as it turned out, I was not, because I have not put any bundling options yet.
Anyway, so I start looking for solutions by Googling "webpack equivalent of browserify options" and got this useful link. However, it was not quite enough, because in the repo I was working on, there are some options that are not listed in that link such as browserify's insertGlobalVars option. After some digging, finally I found out that its equivalent in webpack is externals.
Hopefully it is useful to anyone out there doing something similar. Also, if anyone has any other useful webpack equivalent of any other browserify's options, feel free to comment so I can just add it in to the main post! Happy coding!
Disclaimer: It is not my intention in any way to encourage migration from browserify to webpack. I am just helping those who already made the decision. I am no web dev expert in any way.
No comments:
Post a Comment