ofstudio ofstudio - 1 month ago 17
Javascript Question

Can browserify combine my js files without including own code

Can browserifyJS compile my javascript project (browser code) in a single static file without adding own code at the top of the compiled file? The structure of my project is very simple (5-7 submodules) so I don't want to see any dependency management in runtime.

Is there any other tool to do this? (r.js or something else?)

Answer

It is possible for you to do this just by using Browserify alone, or you can use grunt-browserify. The impact will be you have to get use to writing node.js/CommonJS style require().

An example is avaiable here.