ショートバージョンsystemjs:Angular2 AOTコンパイルと
は、事前コンパイラと怠惰なロードされたモジュールの両方でのクイックスタート作業ごとにsystemJSを使用してangular2(現在は2.2.1)にいましたか?
長いバージョン:
私はangular2にかなり新たなんだ、といくつかのコンポーネントと簡単なサイトを作成するangular.ioのクイックスタートと追加のドキュメントとともに、次のされている、あるモジュールに出区切りルーティングを通して読み込まれた遅延。
だからここに沿って、以下:私はすべての命令を通じて続いてきたhttps://angular.io/docs/ts/latest/cookbook/aot-compiler.html
、私は「 "node_modules/.binファイル/ NGC" -pのTSconfig-aot.jsonとAOTフォルダに出力を持っています'コマンドを実行し、node_modules/.bin/rollup "-c rollup-config.js"コマンドを実行した後、distフォルダに' build.js 'ファイルがあります。
私はindex.htmlをsystem.jsを削除し、build.jsの出力を参照して設定しました。
私の最初の実行は失敗し、「システム」が何であるかわからないと訴えます。ビルドのプロセスでは、system.jsは必要なくなったので、何が起こっているのかは分かりません。
私はsystem.jsを含めて、もう一度実行している場合、私は私の誤りで、次のスタックトレースを取得:
Failed to load resource: the server responded with a status of 404 (Not Found) build.js:3 EXCEPTION: Uncaught (in promise): Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/app/shell/layout.module.ngfactory Error: XHR error (404 Not Found) loading http://localhost:3000/app/shell/layout.module.ngfactory at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:698:29) at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:265:35) at Object.onInvokeTask (http://localhost:3000/dist/build.js:4:15086) at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:264:40) at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:154:47) at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:335:33) Error loading http://localhost:3000/app/shell/layout.module.ngfactory (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/app/shell/layout.module.ngfactory Error: XHR error (404 Not Found) loading http://localhost:3000/app/shell/layout.module.ngfactory at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:698:29) at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:265:35) at Object.onInvokeTask (http://localhost:3000/dist/build.js:4:15086) at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:264:40) at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:154:47) at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:335:33) Error loading http://localhost:3000/app/shell/layout.module.ngfactory
ロードしようとしていることに好奇心旺盛だ「http://localhost:3000/app/shell/layout.module.ngfactory」、それは1私の怠惰なロードされたモジュールです。
遅延ロードされたモジュールではAOTは機能しませんか?
それを試すことができ、角度-CLIロードされ、これは未解決の問題であるようだ:クイックスタートということ https://github.com/angular/angular/issues/11075 非常にイライラし、 docsはちょうどあなたが準備が整ったアプリを出力することができないこの行き詰まりにつながります(ダウンロードのサイズは大きすぎます)。 – MIP1983