次の typescript および angular コンパイラ構成を使用します。
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmitHelpers": true,
"skipDefaultLibCheck": true,
"strictNullChecks": false,
"outDir": "tmp"
},
"exclude": [
"node_modules",
"compiled",
"app/main.ts"
],
"angularCompilerOptions": {
"genDir": "compiled",
"skipMetadataEmit" : true
}
}
/compiled ディレクトリには /node_modules/@angular のみが含まれ、必要な ngfactory ファイルを含む /app ディレクトリはありません。コンパイルは、エラーも出力もなく、サイレントに終了します。
Typescript 2.0 で問題なく動作しますが、es5 をターゲットにしている間は async/await サポートに 2.1 を使用したいので、babel で余分なコンパイル手順を省略できます。
[編集]
これは、 Typescript 2.1.0-dev.20160907 以降、正確に async/await サポートが実装されたときにのみ発生します。壊れたのは、そのバージョンの変更の 1 つだと思いngc
ます。2.1.0-dev.20160906 は引き続き機能しました。
[編集2]
誰かngc
が typescript 2.1 を使ってみた場合、それがうまくいくかどうか短いコメントを残していただけますか? 問題が私の設定にあるかどうかは、少なくともわかります。