4
我想concat & minify一個angular2應用程序。我所做的是首先將所有的* .js文件(boot.js,application.js和所有組件)連接到一個文件中,並將其注入到我的index.html中。我也刪除了如何連接和縮小angular2應用程序?
<script>
System.config({
packages: {
app: {
defaultExtension: 'js'
}
}
});
System.import('app/boot')
.then(null, console.error.bind(console));
</script>
,並與我
<script src="js/allMyConcatFilesIntoOne.js"></script>
取代它,但我得到了錯誤,需要缺少/未知。
angular2應用程序如何填充到一個文件中?我是否必須先收集所有的打印文件,然後concat然後通過gulp進行編譯?
問候
Tenoda
使用的WebPack代替。 Gulp速度較慢,使用起來更麻煩。另一方面,Webpack配置更復雜。但是當你這樣做時,它會爲你做所有事情。它也有不錯的[docs](http://webpack.github.io/docs/)。 [這是一個簡單的入門知識庫](https://github.com/AngularClass/angular2-webpack-starter) – Eggy