Replies: 2 comments 9 replies
-
Have you figured how to seed up sass? I am using a bootstrap from sources and it uses lot's of includes internally. In the end all the benefits of Vite are gone when dealing with SASS. I have managed to speed up the debugging a bit by setting the |
Beta Was this translation helpful? Give feedback.
-
Using @dickeylth investigation, I managed to use embedded sass, without forking vite, by installing it as an alias:
Load time was divided by two, but it's still quite slow versus native CSS.. |
Beta Was this translation helpful? Give feedback.
-
I've tried vite.js with my existing web project and find that sass compile speed could be the bottleneck for the total duration. In my project there are dozens of sass files required by react components, the total initial page load time is around 10 seconds, and I've dig into the source code and add profile logs and find that sass compile time consumed up to 7s+, which slowed down the total duration dramatically. I'm wondering if there's any solution to speed up sass compile.
I've turned to sass's doc and found that vite.js is using async mode
render
, which is much slower that sync mode. I've read the code and figured that it should be the importer implement has to be async to be compatible with alias resolve , so therenderSync
call is unavailable. Is there any possibility that the code could be transformed to sync mode?Besides, the Embedded Sass has just released and it should have better native performance than dart-sass base on JavaScript version, and "Note that sass-embedded is a bit faster in asynchronous mode than it is in synchronous mode (whereas the sass package was faster in synchronous mode)", however the bad news is that
render
andrenderSync
are deprecated APIs and did not get full support. So maybe vite.js could provide support for customized sass compiler choice?In conclusion, the issues I'm concerning about:
render
/renderSync
to latestcompile/compileSync
for better compatibility?embedded-sass
could be an opt-in option?Beta Was this translation helpful? Give feedback.
All reactions