By defining an alias
as part of the main.js
manifest definition for those modules and files, their contents will be included in the compiled www/js/main.js
file. The main.js
source file does not even need to reference the modules for this to work, the Browserify configuration handles the inclusion of the module contents. Couple the alias
option with the external
option and each of the other manifests will be compiled without the modules, instead Browserify merely references the modules already part of www/js/main.js
.
At first blush this looks obnoxious to have to maintain all of your external
definitions, but keep in mind that you can always define external
entries for modules that aren't even used by the manifest and Browserify won't care. This means we can automate the heck out of this. Checkout Gruntfile.automated.js
for an example of what this might look like.