-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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 modern api #17728
Conversation
Run & review this pull request in StackBlitz Codeflow. |
I think like you suggested, we can try re-running the css playground while flipping the switch to modern/legacy so we don't have to rewrite the test.
I think we should migrate to
I think we can tackle them later 👍
We should!
I think we can follow webpack by checking |
This is possible for local manual testing by So, maybe the simplest way would be to create something like |
I think we should try to avoid copying if possible. Maybe we can have a setup like this?
|
Wow, I wasn't aware test runner automatically picks up vite config. This looks almost working, but file edit is probably affecting each other and hmr related tests are failing. |
I updated |
It doesn't seem to slow down the test, and does make the test more isolated, so fine by me 👍 |
Feedback from @nex3:
Maybe Compiler API support can be a separate PR as an opt-in feature. |
One option would be to list |
Thanks everyone for the review! Regarding compiler API integration, I have another (draft) PR ready #17754. I didn't use Vite's own
@nex3 I think this matches with my expectation, but just to confirm, if Vite would have some heuristics to automatically pick the API, would you suggest something like this?
|
Conclusion from today's team meeting:
|
d2395c9
to
3bf2dc1
Compare
I made a performance comparison of 6 patterns code: https://github.com/hi-ogawa/test-vite-sass/tree/main/vuetify
|
You can use |
Description
This PR adds
preprocessorOptions.scss.api: "modern"
option to switch usingsass.compileStringAsync
API instead of legacysass.render
API.I enabled
api: "modern"
inplayground/css
and existing tests are passing.questions
"modern"
and"legacy"
?playground/css
tests pass, so I just flip the switch. maybe we should add a smaller playground for "legacy"?modern
as default? (in v6?)In this PR, I only tackled the issue #7116, but I think there are somewhat related requests for overall sass integration experience. I'm wondering if these should be also considered for "modern" api integration, or they can be addressed separately later:
api: "modern-compiler"
https://github.com/webpack-contrib/sass-loader?tab=readme-ov-file#apisass
implementation? (cf. Allow usage of sass-embedded instead of sass package #6734)package.json
to automatically picksass, node-sass, sass-embedded
or allow explicitly choosing fromimplementation
option https://github.com/webpack-contrib/sass-loader?tab=readme-ov-file#implementation