-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use the Sass Compiler API #1163
Comments
I agree, internal cache inside sass between compilation will be grea, it will improve perf very well, I don't have good idea how it can be implement, but ready to discuss about any suggestions |
@alexander-akait I believe the proposed API has landed in 1.70.0, https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md#javascript-api-3. Have you started any work on implementing it in sass-loader? If not, I could take a stab at it. |
@renspoesse Hello, I didn't start it, so feel free to send a PR |
We still not finished https://github.com/webpack-contrib/sass-loader/blob/master/src/utils.js#L614, maybe it is another API right now, need to check |
This implements the Shared Resources proposal that was accepted and implemented in Dart Sass 1.70.0. By reusing the same compiler process when compiling multiple files, this significantly improves performance for tools like webpack. Closes: webpack-contrib#1163
Modification Proposal
We (the Sass team) have just released a proposal for a
Compiler
API in Sass that shares resources between different compilations (see also sass/sass#3296). This is particularly useful when using thesass-embedded
package, which runs a very fast subprocess to compile Sass: within the lifetime of a singleCompiler
, the subprocess will remain open, eliminating all the overhead of starting it and shutting it down that currently causessass-embedded
to be slower than it could be.For now, we're just seeking your feedback on the proposal. Once it lands, we hope you'll integrate it into the plugin for substantially improved performance.
Expected Behavior / Situation
The plugin starts a
Compiler
when it initializes and uses that compiler to compile all Sass files, so that Sass users using the embedded host experience better performance.Actual Behavior / Situation
The plugin runs a separate
sass.compile()
call for each compilation, which has a large amount of overhead when usingsass-embedded
.Please paste the results of
npx webpack-cli info
here, and mention other relevant informationN/A
The text was updated successfully, but these errors were encountered: