Skip to content

ng build generating vendor source maps even if set to false #19879

@dwilches

Description

@dwilches

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

I don't know, first detected in ng-cli's version 11.0.7

Description

In angular.json I added a configuration like follows:

"configurations": {
    "dev": {
        "optimization": true,
        "outputHashing": "all",
        "sourceMap": {
            "scripts": true,
            "styles": true,
            "hidden": false,
            "vendor": false
        },
        "namedChunks": true,
        "extractLicenses": false,
        "vendorChunk": true,
        "buildOptimizer": true
    },
    "production": {
      ...

Then I build with ng build --configuration=dev and, taking a look at the dist folder, I see the vendor.*.js files are getting source maps generated:

~/my-project/ $ ll dist/vendor*
-rw-r--r-- 1 dwilches 1.3M Jan 26 15:52 dist/vendor-es2015.d5ada0d379d2aba7da41.js
-rw-r--r-- 1 dwilches 7.5M Jan 26 15:52 dist/vendor-es2015.d5ada0d379d2aba7da41.js.map
-rw-r--r-- 1 dwilches 1.4M Jan 26 15:52 dist/vendor-es5.d5ada0d379d2aba7da41.js
-rw-r--r-- 1 dwilches 7.6M Jan 26 15:52 dist/vendor-es5.d5ada0d379d2aba7da41.js.map

But notice in my source map config I set "vendor": false.

🔬 Minimal Reproduction

  1. ng new hello: accept all defaults
  2. Add this configuration to angular.json:
"dev": {
    "optimization": true,
    "outputHashing": "all",
    "sourceMap": {
        "scripts": true,
        "styles": true,
        "hidden": false,
        "vendor": false
    },
    "namedChunks": true,
    "extractLicenses": false,
    "vendorChunk": true,
    "buildOptimizer": true
},
  1. ng build --configuration=dev
  2. ls -l dist/hello/vendor*

🔥 Exception or Error

There will be a source map for vendor inside of dist/hello. But there shouldn't be as it was configured as disabled.

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.0.7
Node: 10.23.1
OS: linux x64

Angular: 11.0.9
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.7
@angular-devkit/build-angular   0.1100.7
@angular-devkit/core            11.0.7
@angular-devkit/schematics      11.0.7
@angular/cli                    11.0.7
@schematics/angular             11.0.7
@schematics/update              0.1100.7
rxjs                            6.6.3
typescript                      4.0.5

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions