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

时间:2019-02-28 13:23:27

标签: angular angular-cli

我尝试使用以下命令在Angular-Sass项目中启用源地图:

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

但是,它们所有人都会产生“未知选项”错误。这些标志都不起作用。

我该如何做?

这是ng --version的输出:

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

1 个答案:

答案 0 :(得分:0)

该命令被称为

--sourceMap=true|false

https://angular.io/cli/build