简体   繁体   English

Angular CLI“未知选项:‘--sourcemap’”错误

[英]Angular CLI "Unknown option: '--sourcemap'" error

I try to enable source maps in my Angular-Sass project with these commands:我尝试使用以下命令在我的 Angular-Sass 项目中启用源映射:

ng serve -sm -ec
ng serve --sourcemap --extract-css
ng serve --sourcemaps=true --extract-css=true

However all of them create "Unknown option" errors.但是,它们都会产生“未知选项”错误。 None of these flags work.这些标志都不起作用。

How can I make this work?我怎样才能使这项工作?

This is the output of ng --version :这是ng --version的 output :

Angular CLI: 7.3.0
Node: 8.9.4
OS: linux x64
Angular: 7.1.4
... animations, common, compiler, core, forms, http
... platform-browser, platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.8.9
@angular-devkit/build-angular     0.8.9
@angular-devkit/build-optimizer   0.8.9
@angular-devkit/build-webpack     0.8.9
@angular-devkit/core              0.8.9
@angular-devkit/schematics        7.3.0
@angular/cli                      7.3.0
@angular/compiler-cli             7.0.4
@ngtools/webpack                  6.2.9
@schematics/angular               7.3.0
@schematics/update                0.13.0
rxjs                              6.4.0
typescript                        3.1.6
webpack                           4.16.4

The command is called 该命令称为

--sourceMap=true|false

https://angular.io/cli/build https://angular.io/cli/build

这似乎不再适用于从 Angular12 到 Angular12

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM