Skip to content

Source map not working for LESS files #9327

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

Closed
michael-letcher opened this issue Jan 23, 2018 · 3 comments
Closed

Source map not working for LESS files #9327

michael-letcher opened this issue Jan 23, 2018 · 3 comments

Comments

@michael-letcher
Copy link

michael-letcher commented Jan 23, 2018

Versions

Angular CLI: 1.6.5
Node: 6.11.2
OS: darwin x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.5
@angular-devkit/build-optimizer: 0.0.41
@angular-devkit/core: 0.0.28
@angular-devkit/schematics: 0.0.51
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.16
typescript: 2.6.2
webpack: 3.10.0

Repro steps

  • Run ng serve -sm -ec -env=mock
  • Using Chrome inspector we see this

image

As you can see it seems to be everything imported via the CLI styles below are not being mapped while all the component LESS files are being mapped as expected.

Currently our step up is as follows:

"styles": [
  "app/shared/styles/bootstrap.less",
  "app/styles/main.less"
]

bootstrap.less, note the first import is to a custom less variables.less (copied from the repo). Component less is being

/ Core variables and mixins
@import "../../styles/bootstrap.variables.less";
@import "~bootstrap/less/mixins.less";

// Reset and dependencies
@import "~bootstrap/less/normalize.less";
@import "~bootstrap/less/print.less";

Example project (will have to download and place into full CLI to run command)

Observed behavior

Inspecting HTML in DevTools shows all the css is in styles.bundle.scss, where it used to display the scss source of the rule. So I can no longer determine where the css rule I am inspecting comes from.

Desired behavior

To see all less mappings and not just the components

Mention any other details that might be useful (optional)

Related to #9099 & #9235

@michael-letcher
Copy link
Author

michael-letcher commented Jan 23, 2018

Checking in webpack:// I do not see any of my less source files.

Using const source = require('app/styles/main.less'); in main.ts

I see the single file now imported but all they have in them is:

// removed by extract-text-webpack-plugin

@michael-letcher
Copy link
Author

Works in v7.3.x

@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants