-
-
Notifications
You must be signed in to change notification settings - Fork 201
Allow sass CLI for better performance #1011
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
Comments
Hi 👋 This is a really interesting idea since compiling Encore handle Any optimization is important since it can reduces compilation time when developping, building your app in CI, or deploying your application in production. |
Thanks for the quick response. Checking the |
Well, the sass team is working on embedded dart-sass, which will run the dart executable in a subprocess. And it will be exposed through the same JS API. So once this work is ready (currently it is in progress), it should be usable in sass-loader. |
The sass-embedded ist now usable since sass-loader version 12.5.0 (see https://github.com/webpack-contrib/sass-loader/releases/tag/v12.5.0). But Encore puts out the error message:
This can be fixed by adding webpack-encore/lib/features.js Line 24 in 9e1528e
Also the library has to be activated manually:
And there are some known bugs webpack-contrib/sass-loader#774 (comment) |
As of version v12.6.0 of sass-loader the sass-embedded will be detected automatically and a simple |
I can confirm in my case simply applying the fix to line 24 and installing #1097 should be merged and released asap :) |
@curry684 Nice results! I've tried a few times but so far can't resolve Bootstrap with either |
Note that is IS usable today if you follow the guide above at #1011 (comment) You need to keep |
…1093) (leonexcc) This PR was squashed before being merged into the main branch. Discussion ---------- Adds sass-embedded as possible sass-loader backend (see #1093) Allows sass-embedded as additional sass-loader backend ass discussed in #1093 and #1011 (comment) Commits ------- 38786ca Adds sass-embedded as possible sass-loader backend (see #1093)
Closing this as |
now* |
Full credit to https://github.com/snowpackjs/snowpack for this idea.
The current
sass
compiler is written in Dart (hereafter "Dart Sass"). Dart Sass's stand-alone command-line executable uses the blazing-fast Dart VM to compile stylesheets. Dart Sass is also distributed as the pure JavaScript sass package on npm, which Webpack Encore uses. The pure JS version is slower than the stand-alone executable - 9x slower for this StackOverflow test.Snowpack's Sass plugin allows you to install the Dart Sass command-line executable and use that instead of the npm package. The code is fairly straightforward.
Usually I like to quantify the change, but I haven't worked out how to benchmark the speed-up this would give me. With Webpack (Encore) my sass compilation is between 20-30 seconds on first run (which is 5+ seconds longer than when I used libsass) so any reduction is good.
Is this an addition Webpack Encore would support?
The text was updated successfully, but these errors were encountered: