Skip to content

Latest commit

 

History

History
26 lines (14 loc) · 1.54 KB

browserify-pros-cons.md

File metadata and controls

26 lines (14 loc) · 1.54 KB

Pros

  • More readable syntax. Doesn't seem that "hack". Node-style module exporting (Opinionated, I like it)

  • JS modules have to be re-built after each change in local development

    The build process is the same as when building for production. If things work in local development, they work in production. With RequireJS, I sometimes had problems in the build process.

  • Delegate UMD pain to browserify with --standalone parameter. Browserify will build a bundle of your module which can be loaded with AMD and CommonJS

Cons

  • No dynamic require() calls. You can't require('./config/' + config.environment). Original issue here

  • No asynchronous loading for modules

    In reality, I have never used asynchronous module loading with RequireJS. The whole app is usually just built and bundled to a single package which contains JS in single bundle.

  • You will install 3rd party libraries which are not released in NPM so you have to shim them with e.g. browserify-shim

  • JS modules have to be re-built after each change in local development.

    This means you need to watch changes in JS files and wait them to rebuild after each change. In big projects, this may be time consuming. Fortunately, there is watchify to make faster builds