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

fix: make sourceMaps relative to the CSS output file #274

Merged
merged 4 commits into from
Aug 30, 2020

Conversation

coxmi
Copy link
Contributor

@coxmi coxmi commented Apr 24, 2020

For the example in:
test/fixtures/dist/extract--custom-path/this/is/extracted.css

the sourceMappingURL was:
/*# sourceMappingURL=this/is/extracted.css.map */

Meaning the browser would try and load the sourcemap from:
this/is/this/is/extracted.css.map

This only happens when someone has set extract to something like this/is/extracted.css.

I've changed this to run the map name through path.basename first, as the map is always dropped in the same folder as the css file.

Now shows relative sourceMappingURL, rather than duplicating the full filePath
@codecov
Copy link

codecov bot commented Apr 24, 2020

Codecov Report

Merging #274 into master will decrease coverage by 0.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #274      +/-   ##
==========================================
- Coverage   92.68%   92.47%   -0.21%     
==========================================
  Files          10       10              
  Lines         328      319       -9     
  Branches      115      112       -3     
==========================================
- Hits          304      295       -9     
  Misses         23       23              
  Partials        1        1              
Impacted Files Coverage Δ
src/index.js 98.97% <100.00%> (-0.08%) ⬇️
src/postcss-loader.js 91.91% <0.00%> (-0.09%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7299a4...a798e5a. Read the comment docs.

@Thomaash
Copy link

Thomaash commented Aug 17, 2020

Any development on this? I tested this as a fix for visjs/vis-network#968 and visjs/vis-timeline#621, it resulted in the correct path being emitted.

@coxmi
Copy link
Contributor Author

coxmi commented Aug 18, 2020

Tests appear to have failed because of a timeout, rather than any tests failing.
Let me know if there's anything I can do here to get this merged into master. Thanks!

@wardpeet wardpeet changed the title sourceMappingURLs not relative to the CSS output file fix: make sourceMappingURLs relative to the CSS output file Aug 30, 2020
Copy link
Collaborator

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. This seems to work great and makes debugging a little bit easier for custom paths. Thank you for your patience! 🚢

@wardpeet wardpeet changed the title fix: make sourceMappingURLs relative to the CSS output file fix: make sourceMaps relative to the CSS output file Aug 30, 2020
@wardpeet wardpeet merged commit 3de028d into egoist:master Aug 30, 2020
@github-actions
Copy link

🎉 This PR is included in version 3.1.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants