我已经在我的Angular 2项目中实现了aot,最终解决了所有错误
"node_modules/.bin/ngc" -p tsconfig-aot.json
运行成功,但我在aot文件夹中只看到node_modules文件夹,而中没有app文件夹。那么我在哪里可以让AppModuleNgFactory引导它呢?
这是我的 tsconfig-aot.json 文件
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es2015", "dom"],
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true
},
"files": [
"app/app.module.ts",
"app/main.ts"
],
"exclude": [
"node_modules",
"content/scripts/angular",
"content/scripts/jqwidgets",
"typings/main",
"typings/main.d.ts",
"typings/AmCharts.d.ts"
],
"angularCompilerOptions": {
"genDir": "aot",
"skipMetadataEmit" : true
}
}
答案 0 :(得分:0)
更改了packages.json的打字稿版本
"typescript": "^2.0.3",
到
"typescript": "2.0.10",
工作!!