-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
Observed behavior
The cli in prod mode is compiling out the typescript decorator (custom decorator) metadata from a external project compiled using ng-packagr.
An example of the decorator metadata would be:
__decorate([
Action(Navigate),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Navigate]),
__metadata("design:returntype", void 0)
], RouterState.prototype, "navigate", null);The result can be seen in this screenshot on the left:
It seems to be related to only external projects. I'm using the same custom decorator used in this code in my project and it works fine.
Desired behavior
It not to compile this out.
Repro steps
npm i @ngxs/router-plugin @ngxs/store- Include the store and router plugin in your project like so:
@NgModule({
imports: [
NgxsModule.forRoot([]),
NgxsRouterPluginModule.forRoot()
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}- Build the application in production
- Inspect the source and note the decorate metadata was compiled out
For reference here is the compiled code
Versions
Node 10
Npm 6
Mac
"@angular/cli": "^6.0.0-rc.8",
Mention any other details that might be useful (optional)
splincode
Metadata
Metadata
Assignees
Labels
No labels
