Angular-cli: CSS comments are not removed from minified bundles.

Created on 31 Dec 2017  路  5Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 1.6.3
Node: 9.3.0
OS: linux x64
Angular: 5.1.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

@angular/cli: 1.6.3
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.3
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack-bundle-analyzer: 2.9.0
webpack: 3.10.0

Repro steps

  • CLI 1.6.1 css bundles removes comments. Update to 1.6.3 css bundles does not remove comments.
    My guess is this is a upstream issue with a dependency. I'm going to see if I can narrow down a isolated test using node sass.

screenshot from 2017-12-31 14-36-43

2 (required) bufix

Most helpful comment

Confirmed this occurs with 1.6.3. It does not happen on master which has improvements to the stylesheet optimization pipeline which will be in 1.7.

All 5 comments

Confirmed this occurs with 1.6.3. It does not happen on master which has improvements to the stylesheet optimization pipeline which will be in 1.7.

Looks like this was fixed in the latest 1.7 release of the CLI

@coryrylan I can confirm that single-line comments (//) are removed, but multi-line (/* */) are not. Is that expected? Should I open a new issue?

I'm seeing this on 1.7.3 of the CLI.

Still reproducing in 1.7.3 for multi-line.
For now you can run your production build using --extract-css=false.

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._

Was this page helpful?
0 / 5 - 0 ratings