Angular CLI: 6.0.0
Node: 8.9.4
OS: win32 x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.0
@angular-devkit/build-angular 0.6.0
@angular-devkit/build-optimizer 0.6.0
@angular-devkit/core 0.6.0
@angular-devkit/schematics 0.6.0
@ngtools/webpack 6.0.0
@schematics/angular 0.6.0
@schematics/update 0.6.0
rxjs 6.1.0
typescript 2.7.2
webpack 4.6.0
Unknown option '-extractCss
The app builds and opens normally on localhost:4200
If I remove --extract-css from the above example as shown below:
ng serve --open --vendor-chunk --common-chunk --named-chunks --verbose
The error changes to
Unknown option: '--named Chunks'
The command will only work after I remove _BOTH_ --extract-css
and --named-chunks
parameters.
@fmorriso You can add a serve rule to build architect in angular.json
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
---
},
"configurations": {
"production": {
---
},
"serve": {
"extractCss": true,
"namedChunks": true,
"vendorChunk": true,
"commonChunk": true,
"verbose": true
}
}
},
Then change serve->options->browserTarget->project-name:build
to project-name:build:serve
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"open": true,
"browserTarget": "<project-name>:build:serve"
},
"configurations": {
"production": {
"browserTarget": "<project-name>build:production"
}
}
}
And run ng serve
@mantyz Thanks, solved the problem for me
Please include some of these tips, such as creating a "serve" rule in angular.json, in some type of WikI entry, readme.md or releasenotes.md so that everyone can benefit from the information about how to upgrade from Angular-CLI version 1.7.4 to 6.x. I did an extensive search prior to posting this issue and found no such information in any existing upgrade guides.
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._
Most helpful comment
@fmorriso You can add a serve rule to build architect in
angular.json
Then change
serve->options->browserTarget->project-name:build
toproject-name:build:serve
And run
ng serve