New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component CSS don't get optimized unless AOT is enabled #13119

Open
alan-agius4 opened this Issue Dec 3, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@alan-agius4
Collaborator

alan-agius4 commented Dec 3, 2018

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Angular CLI: 7.1.0
Node: 11.1.0
OS: darwin x64
Angular: 7.1.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.11.0
@angular-devkit/build-angular     0.11.0
@angular-devkit/build-optimizer   0.11.0
@angular-devkit/build-webpack     0.11.0
@angular-devkit/core              7.1.0
@angular-devkit/schematics        7.1.0
@angular/cli                      7.1.0
@ngtools/webpack                  7.1.0
@schematics/angular               7.1.0
@schematics/update                0.11.0
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.23.1

Repro steps

  • ng new css-test
  • p {color: white}' > src/app/app.component.css
  • ng build --prod --noAot --noBuildOptimizer

The log given by the failure

At the moment, when AOT is disabled components styles are not being optimised. Ie, cleancss is not running.

So for instance the above code, it should have been minified to p {color: #fff}. But this is only happening when using the AOT compiler.

Desired functionality

Component styles should be minified both when using the JIT and AOT Compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment