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

sourcemaps passed from non-js assets seem to be ignored #3938

Closed
CxRes opened this issue Jan 26, 2021 · 1 comment · Fixed by #4334
Closed

sourcemaps passed from non-js assets seem to be ignored #3938

CxRes opened this issue Jan 26, 2021 · 1 comment · Fixed by #4334

Comments

@CxRes
Copy link

CxRes commented Jan 26, 2021

  • Rollup Version: 2.38.0
  • Operating System (or Browser): Windows 10 x64 (though irrelevant)
  • Node Version (if applicable): 14.15.4 (though irrelevant)
  • Link to reproduction (IMPORTANT, read below): https://repl.it/@CxRes/no-css-sourcemap

It seems that for a non-css source the sourcemap passed as return value of the transform plugin is ignored. We are observing this in rollup-plugin-styles where the generated css sourcemap that is passed is just ignored as can be seen in the reproduction. The relevant code lines are linked here. Also, please refer to my discussion with the author @Anidetrix here.

The author of this plugin @Anidetrix is forced to add the sourcemap directly to the css string bundled in the js output file as a string. But this puts sourcemaps in two places and is extremely ugly. Ideally all sources, js or not, should be in the same map file.

Expected Behavior

The sourcemap for the CSS should be passed along the build pipeline and included in the generated sourcemap

Actual Behavior

Missing css source in sourcemap.

PS: I have tried passing the code part only ie without the sourcemap added to the code, unlike what the plugin author does. It makes no difference!

@lukastaegert
Copy link
Member

lukastaegert commented Mar 4, 2022

I can confirm that #4334 seems to fix this issue for me by including the CSS sourcemap.

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

Successfully merging a pull request may close this issue.

2 participants