Source map paths issues
See original GitHub issueI 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:
- Created 8 years ago
- Comments:13
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Won’t fix as clean-css is going into maintenance mode.