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(css): fix missing source file warning with sass modern api custom importer #18113

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hi-ogawa
Copy link
Collaborator

@hi-ogawa hi-ogawa commented Sep 16, 2024

Description

I added data: to "missing source" false positive list since Sass modern API uses data:... when the code is loaded from custom importer. This would mean css.devSourcemap works only for the initial import of sass files, which is pretty bad, but I couldn't find any solution for this. EDIT: sourceMapUrl works #18113 (comment)

Copy link

stackblitz bot commented Sep 16, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@hi-ogawa hi-ogawa marked this pull request as ready for review September 16, 2024 10:02
@sapphi-red
Copy link
Member

https://sass-lang.com/documentation/js-api/interfaces/importerresult/#sourceMapUrl
Returning sourceMapUrl seems to change the sources value.

return { contents, syntax }

Could you try to see if it works?

@sapphi-red sapphi-red added feat: css p3-minor-bug An edge case that only affects very specific usage (priority) feat: sourcemap Sourcemap support labels Sep 17, 2024
@hi-ogawa
Copy link
Collaborator Author

https://sass-lang.com/documentation/js-api/interfaces/importerresult/#sourceMapUrl
Returning sourceMapUrl seems to change the sources value.

Oops, I totally missed that somehow. This totally works, thanks!

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: css feat: sourcemap Sourcemap support p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sourcemap for ... points to missing source files for @import with sass modern api
3 participants