Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(css): support sass compiler api and sass-embedded package #17754
feat(css): support sass compiler api and sass-embedded package #17754
Changes from 54 commits
4948f86
0fea9c4
2feb149
e572b9f
6619ade
fba1d4d
cbfe70d
b515950
f04f067
f8154b1
1d5ce19
af7e6dc
659cd97
8484025
073392b
b0dac17
61bc170
1ff2110
e930f1d
098f181
96a7336
c2a6256
35bf91a
a9a7038
ddd3c14
6adda0e
6e847c0
3bf2dc1
c2f82f4
0d314c2
c823f43
f1435ad
aeee777
0aac866
79f0f80
c0460f8
297eb95
52fa97a
409f713
fbd5144
4be7db6
2be6934
2125ef6
c1df7b6
87fb173
609233a
f730495
2a7db07
64a3f22
b514e46
1811681
ce90a9e
7829fe3
57f48f7
b432b0c
7c05d81
a150d5a
320b5a0
81687e3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had
import(sassPath)
but it was failing on Windows due to driveD:
prefix. Usingrequire
to just workaround this seems pretty odd. Does anyone know a safe way to normalize path intofile:...
for node esm?btw, there is also
createRequire
forsugarss
dependencyvite/packages/vite/src/node/plugins/css.ts
Lines 2048 to 2049 in 57f48f7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe using
pathToFileURL
fromnode:url
:cachedSss = await import(sssPath.match(/^[a-z]:/i) ? pathToFileURL(sssPath).href : sssPath)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be it. I remembered Vitest had similar Windows hack somewhere and probably this one https://github.com/vitest-dev/vitest/blob/5d6d8013371b46522ff55cb64015d29e617994f2/packages/vite-node/src/client.ts#L368-L369
Linked issue on Node nodejs/node#31710 seems to suggest
pathToFileURL(sssPath).href
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should definitely use
import()
there, maybe in a separate PR. Good catch 👍