-
-
Notifications
You must be signed in to change notification settings - Fork 200
Dart Sass? (Sass implementation customization) #422
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
Comments
You’re also going to want the fibers option so it plays nice with the way webpack plugins work, because they’re suppose to be able to handle async calls. To illustrate:
|
We should remove the check about @ProtonScott the callback allows you to configure any option you want. |
…verryan) This PR was merged into the master branch. Discussion ---------- Allow to use Dart Sass instead of Node Sass This PR closes #422 by allowing `sass` (Dart Sass) as an alternative choice to `node-sass`. --- The `sass-loader` allows to set the implementation that should be used to process Sass files. It currently accepts either `sass` or `node-sass` (default): In theory this can already be used by setting the related option when calling `Encore.enableSassLoader()`, but Encore then throws an error asking you to install `node-sass`, even if you already have `sass` installed. One way to prevent that could be to detect when `options.implementation` is set but in its next version the `sass-loader` will [automatically detect](webpack-contrib/sass-loader@ff90dd6) which implementation is installed and use it accordingly. So, instead of doing that, this PR allows to define alternative packages in our `feature.js` file, for instance: ```js const features = { sass: { method: 'enableSassLoader()', packages: [ { name: 'sass-loader', enforce_version: true }, [{ name: 'node-sass' }, { name: 'sass' }] // Will allow both `node-sass` and `sass` ], description: 'load Sass files' }, // ... } ``` If neither `node-sass` or `sass` is available, the error message will display both choices, and recommend the first one in the `yarn add` advice:  Note that for now using Dart Sass still requires the `implementation` option to be set: ```js Encore.enableSassLoader(options => { options.implementation = require('sass'); }); ``` This shouldn't be a big issue since the default recommendation is still to use `node-sass`. Commits ------- 4e90bf8 clarifying comment 1346ee5 Allow to use Dart Sass instead of Node Sass
Uh oh!
There was an error while loading. Please reload this page.
sass-loader
supports to specify Sass implementation to use:node-sass
/dart-sass
/sass
If I understand things right, I can customize
sass-loader
config like this:But if I uninstall
node-sass
and installsass
instead, I got an error becauseEncore.enableSassLoader()
andEncore.addStyleEntry
are limited tonode-sass
onlyThe text was updated successfully, but these errors were encountered: