angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

sourcemaps for libraries are not included

Open d-bechtel opened this issue 8 years ago • 6 comments

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

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

Versions

Repro steps

ng new some-app-name ng generate library some-lib-name ng build some-lib-name ng serve open chrome, point to http://localhost:4200 and open developer tools.

Desired functionality

Developer tools should show the original source code (ts code) for the library

Mention any other details that might be useful

d-bechtel avatar Jul 31 '18 05:07 d-bechtel

Most likely you need to enable vendorSourceMap in angular.json under the build options or as a command argument vendor-source-map

alan-agius4 avatar Jul 31 '18 08:07 alan-agius4

enabling vendorSourceMap doesn't change anything on this issue

d-bechtel avatar Aug 01 '18 05:08 d-bechtel

I have tried this out and adding vendorSourceMap did solve this issue;

image

Here's an extract from my angular.json

"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "options": {
    "vendorSourceMap": true,
    "outputPath": "dist/some-app-name",
    "index": "src/index.html",
    "main": "src/main.ts",
    "polyfills": "src/polyfills.ts",
    "tsConfig": "src/tsconfig.app.json",
    "assets": [
      "src/favicon.ico",
      "src/assets"
    ],
    "styles": [
      "src/styles.css"
    ],
    "scripts": []
  },

alan-agius4 avatar Aug 01 '18 06:08 alan-agius4

the property in angular.json works, but is not compatible with the schema.json the cli argument: ng serve --source-map --vendor-source-map doesn't work

d-bechtel avatar Aug 01 '18 10:08 d-bechtel

there is a solution for this ?

I created a lib following this https://angular.io/guide/creating-libraries Yet, any css related to the library provide a source map. All style are in a