Angular 11 - ng serve - 不推荐使用选项 "sourceMap"

标签 angular angular-compiler-cli angular-builder

我将 Angular 项目从 Angular 10 更新到 11x。一切正常,除了一个使用 ng serve 运行项目的警告。 (在 ng serve 中没有任何选项)。警告是:

Option "sourceMap" is deprecated: Use the "sourceMap" option in the browser builder instead.


警告未出现在 ng build 中.
以下是浏览器构建器在 angular.json 中的组成部分该项目的外观如下:
"builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/my-app",
            "index": "src/index.html",
            "sourceMap": true,
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "aot": true,
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
Angular 11 中的某些相关内容发生了变化?如何消除此警告?

最佳答案

我对一些答案感到困惑,这些选项并没有真正被弃用,但现在应该在 angular.json 的正确“构建”部分中指定,而不是“服务”。

关于Angular 11 - ng serve - 不推荐使用选项 "sourceMap",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66919289/

相关文章:

Angulars ngx-bootstrap 日期范围输出到日期范围过滤器管道

javascript - 从 javascript 调用 typescript 代码在 ionic 中不起作用

angular - 如何在 angular cli webpack 中使用提前编译器

Angular Ivy 编译器和 webpack

angular - 没有项目支持 'extract-i18n' 目标

javascript - 类型错误 : Cannot read property 'baseHref' of undefined

angular - 部署在 tomcat 服务器上的 angular(v4+) 刷新时出现 404 错误

angular - 模态 Angular 4 中的自动对焦不起作用

angular - 在 angular4 中发布数据时是否发生缺少参数 : email, 密码错误?

angular - “ngcc”未被识别为内部或外部命令