Browserify vs Usemin

643 views Asked by At

Am I missing something out of not using browserify?

I am a big fan of Yeoman, especially because of how they do things. By that I mean, their opinionated approach using, among other things, usemin and wiredep to handle client-side dependencies, transforms, and bundling.

However, I keep bumping into this one library, Browserify. Also as of late there's been a lot of hype regarding another, Webpack.

Having just read the latest npm blog post about the future of npm and module packaging in focus of the browser, all of this lead me to question myself - am I missing something here not using browserify?

Is it fair comparing something like browserify, webpack or inject to something like usemin with wiredep? If so are there any clear benefits to using any?

1

There are 1 answers

0
Chris Stephens On

Its pretty fair to compare these. They all do multiple things with a lot of overlap between tools.

The main difference is if you are using some type of standard module loader like ES6 modules, requireJS etc.

usemin + wiredep works the old school way, you point it to all the files you want to minify etc and it will smash them all up and wire that up to the script tag.

The others read your imports/require and will track down the code they are using and smash that together. There are a ton of ways to optimize what code is actually imported compared to usemin. (dead code optimization, lazy loading)

In short if you are using a module loader like require then yes you are missing out.