ngc 5.X.X generates unused imports #8320
Labels
needs: investigation
Requires some digging to determine if action is needed
P1
Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/compiler-cli 5.0.0
node 8.6.0
npm 5.5.1
yarn 1.2.1
windows 10
ubuntu 17.10
Repro steps.
Use my repo
The log given by the failure.
No failure but problem with webpack later in the assets
Desired functionality.
ngc should not generate typings imports
Mention any other details that might be useful.
Hi,
I've noticed that since @angular/compiler 5.0.0 unused imports are generated.
Let's say I have a module 'my-module/types' exporting only interfaces and I import this module in an angular library. Previously in 4.X.X
import {whatever} from 'my-module/types'
were not generated by ngc. But now in 5.X.X, this is generated and unused. I don't think it's a typescript issue because if I run tsc compilation, it does not generate these imports.ngc does not fail but I've issues when I import my module in webpack.
You can reproduce with my repo
Thanks anyway for the great job
EDIT
I have edited my repo and if we transpile like in angular@4 with
annotationAs
flags, imports are not generated. Hope it helps...The text was updated successfully, but these errors were encountered: