Angular Aot : app folder is not generated

谁说我不能喝 提交于 2019-12-13 06:53:44

问题


I have implemented aot in my Angular 2 project, resolved all errors an finally my

"node_modules/.bin/ngc" -p tsconfig-aot.json

run successfully but I see only node_modules folder in aot folder and no app folder in it. So where can I get AppModuleNgFactory to bootstrap it?

This is my tsconfig-aot.json file

{
  "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:


Changed my typescript version of packages.json

"typescript": "^2.0.3",

to

"typescript": "2.0.10",

It Worked!!



来源:https://stackoverflow.com/questions/41098430/angular-aot-app-folder-is-not-generated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!