@angular-devkit/build-optimizer strips non-Angular decorators #18621
Labels
freq1: low
Only reported by a handful of users who observe it rarely
severity3: broken
type: bug/fix
Milestone
🐞 Bug report
Command (mark with an
x
)Is this a regression?
No
Description
I understood from the description of the build-optimizer plugin, that non-Angular decorators should not be stripped.
https://www.npmjs.com/package/@angular-devkit/build-optimizer
However, I can see that decorated properties inside the constructor are removed, which prevents my team from using build-optimizer as part of the
ng build
command (we use inversifyjs to manage our dependencies outside of the Angular module).Inside
scrub-file.ts
, theisDecorateAssignmentExpression
method seems to be responsible for the decision to strip this metadata.🔬 Minimal Reproduction
https://github.com/kevindrecruit/angular-build-optimizer-issue
🔥 Exception or Error
Using the minimum reproduction git repository, we can see the following error (which is specific to inversifyjs):
The point is that the
@inject()
has been removed from the constructor where it is still needed.🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: