Urg*_*gen 12 asp.net asp.net-core angular angular6
我已经脚手架AspNetCore Angular 6.0 SPA template从cli再安装npm相应的软件包.
但是,当我尝试运行该项目时,dotnet run它不会启动而是错误提示.我抓了一个截图供你参考.我不确定它是否与angular.Json文件有关,否则!任何的想法..
错误:
未知选项--extractCss
Rit*_*Dey 25
这是因为该ng serve命令不再支持--extractCss选项
打开package.json.你会找到
{
"scripts": {
"start": "ng serve --extract-css" // Please remove the --extract-css
// ...
}
}
Run Code Online (Sandbox Code Playgroud)
--extract-css从start脚本中删除.
现在就是这样
{
"scripts": {
"start": "ng serve"
// ...
}
}
Run Code Online (Sandbox Code Playgroud)
现在打开angular.json."extractCss": true在build配置中设置
例:
"build": {
"architect": {
"configurations": {
"extractCss": true,
//...
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
参考: https ://github.com/angular/angular-cli/issues/10666#issuecomment-386843570
参考文献2: http ://www.talkingdotnet.com/upgrade-angular-5-app-angular-6-visual-studio-2017/
| 归档时间: |
|
| 查看次数: |
2440 次 |
| 最近记录: |