question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Source map paths issues

See original GitHub issue

I have a main css file which have a bunch of @import rules and I use this command to compile my css file:

cleancss --source-map --output dist/my.css css/my.css

However, in the source map file, the paths in the “sources” list are wrong: they start with “css/” instead of “…/css/”.

I think the source map paths should take into account the path to the output file.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
zmoazenicommented, Oct 1, 2017

Yeah I can confirm this is still a problem. I put together a short example to show the problem: https://github.com/zmoazeni/clean-css-issue

The problem I see is that rebaseTo doesn’t do anything with the “source” listed in the sourceMap whereas with v3 you could set the root. If you run that script against the two versions, you’ll see that v3.4.2 doesn’t include the “css/” portion of the source. And aside from using cd, you can’t get around it with v4.1.9.

This is causing me issues with grunt-contrib-cssmin because you can’t easily cd around.

0reactions
jakubpawlowiczcommented, Mar 30, 2022

Won’t fix as clean-css is going into maintenance mode.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect sourceMappingURL path · Issue #146 - GitHub
The sourceURL seems fine with and without source-map-loader . The decoded sourceMappingURL incorrect though once this loader is added to an ...
Read more >
Source Map & Webpack file path issues - Roots Discourse
I have this issue where browsersync pretends a certain scss element to be in a completely wrong file. In Chrome dev-tools elements from...
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
4 Reasons Why Your Source Maps are Broken · Missing or incorrect source map directive · Missing original source files · Bad source...
Read more >
Sourcemaps in .vue files are broken in development - GitLab
This makes it virtually impossible to map paths to source directories, and can cause ... https://github.com/vuejs/vue-loader/issues/1163
Read more >
992268 - Manually define sourcemap paths - Bugzilla@Mozilla
It would be useful to have the ability to define manually the path to the source map associated to a minified file. Main...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found