Angular Aot:未生成应用程序文件夹

时间:2016-12-12 10:11:35

标签: angular aot angular2-aot

我已经在我的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
 }
}

1 个答案:

答案 0 :(得分:0)

更改了packages.json的打字稿版本

"typescript": "^2.0.3",

"typescript": "2.0.10",

工作!!