eleventy-plugin-sass icon indicating copy to clipboard operation
eleventy-plugin-sass copied to clipboard

update gulp-sass version

Open brooklynebkbk opened this issue 4 years ago • 3 comments

updating the gulp-sass version to 5.0.0 resolves errors that arise from the deprecated node-sass dependency

brooklynebkbk avatar Sep 07 '21 14:09 brooklynebkbk

I got this error when installing your fork as a package; looks like one of the node-sass or sass packages may be required.

yarn run v1.22.4
$ eleventy
Writing public/index.html from ./src/index.html.
Copied 1 file / Wrote 1 file in 0.05 seconds (v0.12.1)
[Eleventy-Plugin-Sass] Compiling Sass files...
Error in plugin "gulp-sass"
Message:
    
gulp-sass 5 does not have a default Sass compiler; please set one yourself.
Both the `sass` and `node-sass` packages are permitted.
For example, in your gulpfile:

  var sass = require('gulp-sass')(require('sass'));

error Command failed with exit code 1.

Repo for reproduction: https://github.com/geoffdavis92/test-eleventy-plugin-sass

geoffdavis92 avatar Dec 28 '21 03:12 geoffdavis92

@geoffdavis92 turns out another PR does precisely the same as @brooklynebkbk's here. Essentially it defines the newer version of gulp-sass. That error is addressed in the other PR since at the very top it immediately passes the desired compiler (i.e. sass in this case instead of the prior version's default dart-sass). i.e.

const sass = require('gulp-sass')(require('sass'));

~~I vote to close this out in favor of #27 with the caveat that @AnalyzePlatypus makes a minor tweak to the PR to incorporate sass as a dependency (and not as a devDependency, since otherwise I it won't appear in normal installations).~~ 😄

See below.

patricknelson avatar Mar 12 '22 02:03 patricknelson

Actually my PR at #32 resolves the dependency problem above @geoffdavis92 and also allows you to override the compiler with a new compiler option in case you still want to use the older node-sass for some reason.

patricknelson avatar Mar 12 '22 04:03 patricknelson