Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 11 - ng serve - Option "sourceMap" is deprecated

I updated Angular project from Angular 10 to 11x. Everything works normally, except for one warning on running project using ng serve (without any option in ng serve). The warning is:

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

The warning is not presented in ng build.

Here is how browser builder part in angular.json of the project looks like:

"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"
            ],

Something related has changed in Angular 11? How to remove this warning?

like image 807
viking Avatar asked Apr 02 '21 12:04

viking


1 Answers

You need to remove sourceMap from serve --> options --> sourceMap, which is deprecated.

like image 67
HTN Avatar answered Oct 02 '22 23:10

HTN