Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angular.json: sourceMap.vendor-option in build has no affect on serve #15064

Closed
lcptrs opened this issue Jul 12, 2019 · 3 comments · Fixed by #15328
Closed

angular.json: sourceMap.vendor-option in build has no affect on serve #15064

lcptrs opened this issue Jul 12, 2019 · 3 comments · Fixed by #15328
Labels
Milestone

Comments

@lcptrs
Copy link

lcptrs commented Jul 12, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Kinda, if I use ng serve --vendorSourceMap, I'm getting the source maps. But this flag is deprecated and it seems like the sourceMap.vendor-option of the angular.json is the new way to go.

Description

According to the documentation, the serve section in angular.json overrides build defaults and supplies additional serve defaults.
This seems not to be happening with the following configuration:

...
"build": {
  "sourceMap": { "vendor": true, "scripts": true },
  ...
}

If I'm running ng serve the source maps for my library are missing. If I move this option to the serve section, the source maps are getting transferred to client.
It seems, like the compiled output is the same for build and serve.

🔬 Minimal Reproduction

  1. run ng new my-app
  2. cd to my-app
  3. run ng g library my-lib
  4. Call MyLibComponent in app.component.html: <lib-my-lib></lib-my-lib> and update app.module.ts with the necessary imports.
  5. Set the following option in angular.json
...
"build": {
  "sourceMap": { "vendor": true, "scripts": true },
  ...
}
  1. run ng b my-lib && ng serve

If you now inspect the application within the browsers DevTools you won't find the my-lib.component.ts
If you set the sourceMap option under serve, you'll get the *.ts file.

🌍 Your Environment


Angular CLI: 8.1.1
Node: 10.15.3
OS: win32 x64
Angular: 8.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.801.1
@angular-devkit/build-angular      0.801.1
@angular-devkit/build-ng-packagr   0.801.1
@angular-devkit/build-optimizer    0.801.1
@angular-devkit/build-webpack      0.801.1
@angular-devkit/core               8.1.1
@angular-devkit/schematics         8.1.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   8.1.1
@schematics/angular                8.1.1
@schematics/update                 0.801.1
ng-packagr                         5.3.0
rxjs                               6.4.0
typescript                         3.4.5
webpack                            4.35.2

@ngbot ngbot bot added this to the Backlog milestone Jul 13, 2019
@skylee91
Copy link

Yes I encountered this issue too. Spent half day to realize the deprecated --vendorSourceMap works instead of the --sourceMap

@ericsnap
Copy link

ericsnap commented Aug 4, 2019

OMG, when are either the docs going to get fixed or the code? been battling with this for hours too...

mgechev pushed a commit that referenced this issue Aug 15, 2019
…rridden by defaults in schema (#15328)

We have a number of browser options that we allow the dev-server to merge. However, this only happens when such as options are undefined from the dev-server builder. At the moment these option have defaults inside their schema which results in them never being `undefined`, and hence the overridden logic is bypassed.

See: https://github.com/angular/angular-cli/blob/6dd5b186d4dc0ed750cc195d9ebe1aaa282bb640/packages/angular_devkit/build_angular/src/dev-server/index.ts#L49-L63 and https://github.com/angular/angular-cli/blob/6dd5b186d4dc0ed750cc195d9ebe1aaa282bb640/packages/angular_devkit/build_angular/src/dev-server/index.ts#L107-L115

Fixes #15273 and fixes #15064
mgechev pushed a commit that referenced this issue Aug 15, 2019
…rridden by defaults in schema (#15328)

We have a number of browser options that we allow the dev-server to merge. However, this only happens when such as options are undefined from the dev-server builder. At the moment these option have defaults inside their schema which results in them never being `undefined`, and hence the overridden logic is bypassed.

See: https://github.com/angular/angular-cli/blob/6dd5b186d4dc0ed750cc195d9ebe1aaa282bb640/packages/angular_devkit/build_angular/src/dev-server/index.ts#L49-L63 and https://github.com/angular/angular-cli/blob/6dd5b186d4dc0ed750cc195d9ebe1aaa282bb640/packages/angular_devkit/build_angular/src/dev-server/index.ts#L107-L115

Fixes #15273 and fixes #15064
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants