Search code examples
javascriptecmascript-6browserify

Do I need browserify if I use ES6?


I'm creating a new project with ES6 and making a build script.

I'm wondering what's the value of browserify when you have ES6 imports already?

If I point my gulp script to minimize and remove console logs etc. of my "entry" scripts, do I need browserify? (Ie my entry script will use ES6 imports to import whatever children js files are used. In my children JS files, if they use something from another js file, they will import that as well, etc etc)


Solution

  • Browserify and Webpack do interact with modules, but not in a syntactic way. The language or runtime provides the import or require call, depending on whether you use ES6 or Node, but the bundler actually takes those modules and combines them into a single file.

    During the process, most bundlers perform some optimizations. Common ones include:

    • converting ES6 to older versions (ES5 or even ES3)
    • minification/uglification
    • including CSS, images, and other non-script data