2

Dear Angular 2 developpers,

I am struggling with finding decent documentation on the angular 2 compiler (ngc).

What I want to do: I have a folder containing an angular 2 logging library whose entry point is a 'logging.module.ts'. So far, I have compiled it via a tsconfig file and it worked fine.

Now, I would like to switch to the angular compiler. Yet, when I run ngc. Only *.ngfactory.ts and *.ngsummary.json files are generated.

I cannot see any .js .d.ts or .metadata.json files. (And if I understood correctly, ngc was designed as a "drop-in replacement" for the typescript compiler).

Any hints what I might be doing wrong?

Thanks for your help.

David Brem
  • 504
  • 2
  • 6
  • 16

2 Answers2

1

Is noEmit on?

Should be something like this...

"compilerOptions": {
   ...
   "noEmit": false
   ...
},
"angularCompilerOptions": {
  "genDir": "..."
}
josh-sachs
  • 1,749
  • 2
  • 15
  • 19
0

In tsconfig.json,

If you want to generate metadata files, make sure skipMetadataEmit is false:

"angularCompilerOptions": {
    ...
    "skipMetadataEmit" : false
}

If you want to generate type definition files:

"compilerOptions": {
    ...
    "declaration": true
}
Michael Kang
  • 52,003
  • 16
  • 103
  • 135