Anybody using Browserify

http://browserify.org/

1 Like

No but I have been using Require.js and it works fairly well so far.

Yes. I’m in the final steps of fleshing out the combination to perform the complete set of tasks I require, inclusive of automated testing, and all the other grunt wonders.

Lib’s get added to project using bower, defined by bower.json file. Grunt-based tools all use an external config file to make the gruntfile legible. Gulp, while easy to use in general, has not the maturity of resources, especially when incorporating Node, Handlebars, Browserify, Ember, jQuery, SASS, connect/express, and also the plethora of testing tools - which in grunt have already been made available in a format that is without conflicts.

For code structure, I have all my code pieces sorted in /src folder into /browser, /common, and /node. This becomes essential for Browserify, as it creates a wrapper-of-sorts for server side code. Code common to browser and node, you apply a isBrowser conditional to separate functionality. In grunt, you ignore the node folder for build output to your /dist/js.

I’ll strip the project back to the gruntfile, bower and package.json, as well as grunt package configs and example src code files, push all that to my github account, and then update this post.

On a side note, Atomify is a consideration. It basically extends Browserify, with the primary bonus permitting CSS config as well as JS. If you’re comfortable with Node, Grunt, and CSS-preprocessors, then you may find Atomify isn’t necessary.

1 Like

I’m using it too with a project that mix Laravel with EmberJS. It would be nice that EmberJS could work with CommonJS too, AMD isn’t the best option for all the projects (it increases the latency and slows the project).

If you are using AMD modules with something like require.js they have an optimizer tool that builds everything into a single file for you - after you load up the single file the first time there should be zero latency unless I am missing something else. All it takes to load up Ember is wrapping it’s call into an AMD module. Ember-Data appears to already be set up to allow loading as an AMD module I think, but I don’t use it so I can’t confirm.

1 Like

We ended up creating this library based off the loom generator to auto generate an index file to make browerifying the project work, there is some more general work work on geting them to work together here, it would seem a lot of the issues have to do with bower packages having invalid package.json files.

1 Like