Ich habe eine Angular2 App, und auf Dev-Umgebung funktioniert es gut. Alle Angular2-Abhängigkeiten werden in Runtime von node_modules dir geladen.systemjs-builder - Bündelung rxjs für angular2
Ich benutze gulp-typescript plugin zum Bündeln von Anwendungscode und system-js zum Bündeln von Bibliotheken von Drittanbietern.
Dies ist schluck Aufgabe zum Bündeln lib Dateien:
function bundleLibs() {
var files = [
'node_modules/rxjs/bundles/Rx.js',
'node_modules/@angular/core/bundles/core.umd.js',
'node_modules/@angular/forms/bundles/forms.umd.js',
'node_modules/@angular/common/bundles/common.umd.js',
'node_modules/@angular/compiler/bundles/compiler.umd.js',
'node_modules/@angular/platform-browser/bundles/platform-browser.umd.js',
'node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'node_modules/@angular/upgrade/bundles/upgrade-static.umd.js'
];
var builder = new SystemJSBuilder('dist', {
map: {
'rxjs': 'node_modules/rxjs'
}
});
return builder.bundle(files, 'dist/js/lib.js');
}
würde Ich mag alle rxjs Bibliotheken in der Ausgabedatei aufgenommen werden. Aber wenn ich app laufen lasse, erhalte ich 404-Status für
node_modules/rxjs/Subject.js
node_modules/rxjs/Observable.js
(und alle anderen rxjs-Dateien).
Es hilft jede einzelne rxjs Datei zu bündeln:
var files = [
'node_modules/@angular/core/bundles/core.umd.js',
'node_modules/rxjs/Subject.js',
'node_modules/rxjs/Observable.js',
...
];
Aber ich glaube, dass es nicht gute Lösung.
Die Frage ist also, wie kann ich alle benötigten Dateien aus Rxjs Bibliothek bündeln? (benötigt für Angular2)
Vielleicht werfen Sie einen Blick auf diese http://stackoverflow.com/questions/39991935/angular2-2-0-x-and-rx-beta-12-bundle/39992839#39992839 – martin