There currently isn't a good way of doing this. However, it
will be fairly easy to implement. Ideally, it should work on the
meta config like:
System.meta['jquery] = {bundled: false}
This can work in combination with env and paths.
if(System.env === "production"){
System.paths['jquery'] = "http://cdn/jquery.js"
} else {
System.paths['jquery'] = "local/jquery.js"
}
To implement this, in https://github.com/bitovi/steal-tools/blob/master/lib/build/multi.js
You'll want to write something like:
pluckMatchingMeta(dependencyGraph, {bundled: false});
You'll want to create a pluck_matching_meta here:
It will look similar and use .pluck: https://github.com/bitovi/steal-tools/blob/master/lib/graph/pluck.js
something like:
- var _ = require("lodash");
- module.exports = function(graph, matches){
- var checker = _.createCallback(matches)
- var modules = [];
- for(var moduleName in graph) {
- if( checker(graph[moduleName].load.metadata) ) {
- [].push.apply(modules, pluck(moduleName) )
- }
- }
- return modules;
- }
The nice thing is that by removing those modules, when their import
comes, System will still try to grab them. All you have to do is
make sure they aren't bundled.