Unknown option --extractCss in AspNetCore Angular 6.0 SPA Template

谁说胖子不能爱 提交于 2019-12-05 00:29:57

This is because the ng serve command no longer supports --extractCss option

Open package.json. You'll find

{
  "scripts": {
    "start": "ng serve --extract-css" // Please remove the --extract-css
    // ...
  }  
}

remove the --extract-css from start scripts.

It'll be now

{
  "scripts": {
     "start": "ng serve"
      // ...
  }   
}

Now open angular.json. set "extractCss": true in build configuration

example:

"build": {
    "architect": {
           "configurations": {
                "extractCss": true,
                  //...
             }
         }
      }
   }

Reference: https://github.com/angular/angular-cli/issues/10666#issuecomment-386843570

Reference 2: http://www.talkingdotnet.com/upgrade-angular-5-app-angular-6-visual-studio-2017/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!