0

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
 }
}
sudhir
  • 1,387
  • 3
  • 25
  • 43

1 Answers1

0

Changed my typescript version of packages.json

"typescript": "^2.0.3",

to

"typescript": "2.0.10",

It Worked!!

sudhir
  • 1,387
  • 3
  • 25
  • 43
  • With the new angular-cli (version beta.21 and up), you can just do `ng build --prod --aot`, no need to create a separate `tsconfig` file anymore. – borislemke Dec 12 '16 at 13:00
  • With `^2.0.3` you were using the last npm version of typescript that is `2.1.x` and does not look to work with AOT – Karbos 538 Dec 12 '16 at 13:39