This is killin' me.... I try to bundle rxjs to be used with systemjs and angular 2.0.0
var builder = require("systemjs-builder");
var bundler = new builder('./');
bundler.config({
paths: {
"n:*": "node_modules/*",
"rxjs/*": "node_modules/rxjs/*.js"
},
map: {
"rxjs": "n:rxjs"
},
packages: {
"rxjs": {main: "Rx.js", defaultExtension: "js"}
}
});
bundler.bundle('rxjs', configuration.lib.dest() + '/' + lib.dest, options).then(function(){
console.log('yipee..')
});
It works and produces a file that contains lines like this
System.registerDynamic('rxjs/observable/BoundCallbackObservable', ...
I load the bundle with a script tag and add nothing to the systemjs config and still see systems trying to load individual files..
Whats goin' on?
To my understanding the registerDynamic calls should fill the registry and prevent any lazy loading....
I didn't continue with the bundling but next would be to concatenate all angular files and place them in the head ( removing everything from the systemjs config ). Would that work?
You shouldn't bundle RxJS because its a massive library. Just import what you need.