question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[6.0.0-rc7] "ng serve --extract-css" does not work anymore

See original GitHub issue

ng serve --extract-css seems to be not working anymore with the new version 6 of angular-cli.

ng build--extract-css works without a problem, so why isn’t the option available with serve as well?

Versions

Angular CLI: 6.0.0-rc.7
Node: 10.0.0
OS: win32 x64
Angular: 6.0.0-rc.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.5.10
@angular-devkit/build-angular     0.5.10
@angular-devkit/build-optimizer   0.5.10
@angular-devkit/core              0.5.10
@angular-devkit/schematics        0.5.10
@angular/cli                      6.0.0-rc.7
@ngtools/json-schema              1.1.0
@ngtools/webpack                  6.0.0-rc.8
@schematics/angular               0.5.10
@schematics/update                0.5.10
rxjs                              6.0.0
typescript                        2.7.2
webpack                           4.6.0

Repro steps

simply run ng serve --extract-css and it does not work.

Observed behavior

> ng serve --extract-css
Unknown option: '--extractCss'

Desired behavior

ng serve should accept the --extract-css option as it did back with 1.7.4.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

44reactions
fmorrisocommented, Nov 20, 2018

You missed the whole point of this an similar issues: that angular.json is a bewildering, confusing an poorly documented (especially in terms of annotated examples) subtitute for the old, relibable ng serve and ng build command-line options.

You also ignore the need for separate production vs. development/debug sets of options in a quick, painless manner. This is easy to do via package.json by adding/removing simple, well-documented (at least it was in 1.7) options such as -extract-css on ng serve (which performs a build). Try doing that via multiple configurations in less than 60 seconds via the confusing “JSON blizzard” known as angular.json.

Please reconsider this poor decision to close this issue.

23reactions
gdesprescommented, May 11, 2018

just add “extractCss”: true at projects > SPA6 > architect > build > options

Read more comments on GitHub >

github_iconTop Results From Across the Web

[6.0.0-rc7] "ng serve --extract-css" does not work anymore -
ng serve --extract-css seems to be not working anymore with the new version 6 of angular-cli. ng build--extract-css works without a problem, ...
Read more >
Extracting CSS into JS with Angular 11 (deprecated extractCss)
This means that we don't use styles.js anymore during the application build. ... Removing extractCss in angular.json solves the problem.
Read more >
What's new in Angular CLI 11.0? | Ninja Squad
The CLI has been supported ng serve --hmr for quite some time, but it used to require to change code in your application...
Read more >
Angular Taiwan | 大家覺得ng serve 需要--extract-css 這個參數嗎
ng serve --extract-css seems to be not working anymore with the new version 6 of angular-cli. ng build--extract-css works without a problem, ...
Read more >
Angular CLI - Quick Guide - Tutorialspoint
To create a new project, we can run the following command in the command line and the project will be created. ng new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found