Consider two scenarios:
- compile browser version of a Javascript library, pulling out all
require
dependencies and putting them in one file. - compile a node.js version of the same library, but ignoring those
require
dependencies allowing node to handle them.
I thought of using requirejs / r.js, however I'm seem to be unable to work out the special sauce to do something like this.
Are there other build systems that can do this? Could I mod r.js in some way? Answers on postcard.