0
我有一個Angular2應用程序,並在開發環境,它工作正常。 所有的Angular2依賴都是從node_modules目錄運行的。systemjs-builder - bundling rxjs for angular2
我使用gulp-typescript插件捆綁應用程序代碼,而system-js捆綁第三方庫代碼。
這是捆綁LIB文件一飲而盡任務:
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');
}
我想包括在輸出文件中的所有rxjs庫。 但是當我運行的應用程序,我得到
node_modules/rxjs/Subject.js
node_modules/rxjs/Observable.js
(和所有其他rxjs文件)404個狀態。
它有助於捆綁每個單獨rxjs文件:
var files = [
'node_modules/@angular/core/bundles/core.umd.js',
'node_modules/rxjs/Subject.js',
'node_modules/rxjs/Observable.js',
...
];
但我相信,這不是很好的解決方案。
所以問題是,我如何捆綁rxjs庫中所有需要的文件? (需要Angular2)
也許看看這個http://stackoverflow.com/questions/39991935/angular2-2-0-x-and-rx-5-beta-12-bundle/39992839#39992839 – martin