angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

no-build-optimizer doesn't work @angular/cli:1.6.2

Open Alekcei opened this issue 8 years ago • 11 comments

Again disappeared decoratoes @angular/cli": "1.6.2" the flag --no-build-optimizer does not work I am used ./node_modules/.bin/ng build --prod --no-build-optimizer

--no-build-optimizer not working in @angular/cli:1.6.2. But if use @angular/cli:1.5.0 then all

The flag was entered --no-build-optimizer, disabling optimization, now it does not work All decorators are deleted in 1.5.0 decorators remained with use --no-build-optimizer

JitCompiler does not see decorators on compiled components repo for reproduce https://github.com/Alekcei/no-build-optimizer contains two projects differing "@angular/cli": "1.5.0" and "@angular/cli": "1.6.2" testngcli150 works, the components are displayed testngcli162 not working, the components are don`t displayed

Custom decorators not stripped, stripped standart decorators

With @NgModule and @Component also does not work

Alekcei avatar Dec 27 '17 19:12 Alekcei

As explained in #8728, AOT mode removes the application's decorators. AOT is the default for --prod; use --no-aot if JIT compilation is used with application code. Also from the example code provided, the custom decorators are kept within the output. So that is not the issue here. If using no-build-optimizer in --prod, the error is actually for TestModule and if not using the option the error is for CommonModule (the first in DynamicHtmlModule). Both of which are expected as TestModule is an application module and CommonModule is an Angular library module.

Everything appears to be working as intended. As mentioned in #8728, if additional options or different behavior is desired, please open a feature request detailing the use case that is currently not met by the CLI.

clydin avatar Dec 27 '17 20:12 clydin

why it works in 1.5.0 ?

Alekcei avatar Dec 27 '17 20:12 Alekcei

--prod --no-build-optimizer Must disable optimization. And in 1.5.0 it worked

Alekcei avatar Dec 27 '17 20:12 Alekcei

Explain the reason why it stopped working

Alekcei avatar Dec 27 '17 20:12 Alekcei

1.5 erroneously did not remove the application decorators. This was fixed in 1.6 which is also the behavior in versions prior to 1.5.

clydin avatar Dec 27 '17 20:12 clydin

It turns out there is no sense from the flag

Alekcei avatar Dec 27 '17 20:12 Alekcei

Why in other requests did this come up as a solution. Allow it to be disabled!

Alekcei avatar Dec 27 '17 20:12 Alekcei

It is described in wiki https://github.com/angular/angular-cli/wiki/build Why should he if he can not use ? Consider disabling!

Alekcei avatar Dec 27 '17 20:12 Alekcei

Plese add --disabled-stripped-decorators, but without resources

Alekcei avatar Dec 27 '17 21:12 Alekcei

Plese disabled for

    /[\\/]node_modules[\\/]@angular[\\/]animations[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]common[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]compiler[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]core[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]forms[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]http[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]platform-browser-dynamic[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]platform-browser[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]platform-webworker-dynamic[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]platform-webworker[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]router[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]upgrade[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]material[\\/]/,
    /[\\/]node_modules[\\/]@angular[\\/]cdk[\\/]/,
];

from build-optimizer

Alekcei avatar Dec 28 '17 05:12 Alekcei

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.