這是我第一次生產angular2項目。 我用這個答案從這個網站。 2.4.x的FINAL(打字稿)與角CLI 1.0.0-beta.24生產Angular2項目
一次性設置
npm install -g angular-cli
ng init
從projectFolder如果它爲NG新projectFolder現有的應用程序 如果它是一個新的應用程序。
集束步驟
ng build --prod --aot
(在命令行運行時目錄是projectFolder) 標誌督促進行生產和標誌束AOT使提前-的時間彙編也稱爲離線編譯。
束默認生成到projectFolder /距離/
輸出
dist/main.[hash].bundle.js Your application bundled [ size: 13 KB for new Angular CLI application empty, ~3 KB compressed].
dist/vendor.[hash].bundle.js Your dependencies (@angular, RxJS...) bundled [ size: 437 KB for new Angular CLI application empty, 98 KB compressed].
dist/index.html entry point of your application.
dist/inline.js webpack loader
dist/style.[hash].bundle.css the style definitions
dist/assetsresources copied from projectFolder/src/assets
dist/*.[hash].bundle.map the SourceMaps corresponding to the previous files (it is not required for a production deployment)
但是當我點擊DIST/index.html的我收到只加載...而已。 如何獲得生產版本?
你是否雙擊index.html打開項目? :O – echonax
如果我看到加載...,似乎我雙擊 – Alice
鉻控制檯中的任何錯誤? –