Re:Can you help me understand the benefit of require.js?
by mdarens on Monday July 22, 2013 @05:12PM
(#6086486)
You can do this with build layers. There's an example project showing how: https://github.com/requirejs/example-multipage
Re:Can you help me understand the benefit of require.js?
by AdrianRossouw on Monday July 22, 2013 @05:38PM
(#6086633)
you can do that with [1] browserify bundles. Basically you tell the script not to package modules that get required and instead use ones defined elsewhere, like in another include.
1. https://github.com/substack/node-browserify#multiple-bundles
Generally I have something like the following...
This allows me to cache/reuse common functionality and still have a limited number of http requests for js... how would I accomplish this with requirejs, browserify and the rest?From what I've seen you can't. Ideally, I'd like to be able to package harmony-style modules.. there's some transpilers for that structure already. It would just be nice to be able to reliably package sections for downlevel reuse without having one huge script per page in a site that is expressly not single page.