Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Discussion: Browserify or RequireJs?
11 points by ep103 on April 21, 2014 | hide | past | favorite | 4 comments
I'd love to hear the community's take on this. I'll also start a poll, but feel free to start a discussion!


They serve two slightly different purposes.

Browserify is a build time tool which enables the programmer to combine files and have a module structure within this single packaged file. This affords practical flexibility, such as dynamically requiring files (as long as the dynamically required modules are required in a manifest module with it's own require method).

RequireJs is a runtime tool, in which you load modules from the browser.

You can use both by packaging files together using browserify and dynamically loading these packaged files using requirejs.

I personally use browserify and have my own lightweight dynamic loader. This allows me to be free of the requirejs boilerplate logic in every file.

One cool thing about Browserify if you can package a bunch of lightweight & focused javascript snippets you find on the internet, instead of using heavyweight libraries. Often times, the essential nugget of logic is tiny, compared to the boilerplate, cruft, & edge case concerns of the library.


Browserify. I've never understood why people who are not constructing truly massive applications decide to go with Require.js, because in the end you just run r.js against the build to concatenate anyways. And the whole notion of "requiring" libraries via a shim --those libraries, once shimmed, end up being globals anyways. Browserify is a one-liner, with a clean syntax, which also has a vast plugin system for performing further operations --also one-liners.


Poll: Browserify


Poll: RequireJs




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: