Use gulp-sass ^6.0.1 and enable use of NodePackageImporter for Sass' pkg:
protocol
#18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In version 6.x gulp-sass has updated to using Sass' new JS API (see dlmanning/gulp-sass#846).
This requires small changes where options have changed:
includePathsloadPaths
outputStylestyle
In addition it is now possible to benefit from
pkg:
Importers:webfactory-gulp-preset will make this available automatically if the configured compiler (we recommend
sass-embedded
) supports it. Support landed in Dart Sass v1.71.0;node-sass
does not support it and probably never will.Issues
❌ BC break: node-sass is no longer supported
gulp-sass' documentation suggests that version 6.x continues to support node-sass, but this is not true. dlmanning/gulp-sass#846 has switched to using the Sass compiler's internal
compile
orcompileAsync
methods which are not supported by node-sass (which only offers the legacyrender
andrenderAsync
).Projects updating webfactory-gulp-preset would be required to migrate to Dart Sass.
NodePackageImporter()
seems to requireentryPointDirectory
when used via gulp-sass.entryPointDirectory
should be optional when calling the constructor; however, when using it with gulp-sass errors occur if it is omitted:webfactory-gulp-preset always instantiates the importer with
new NodePackageImporter(config.webdir)
whereconfig.webdir
is theentryPointDirectory
; this fixes the issue.