diff --git a/app/templates/_package.json b/app/templates/_package.json index 7e47e913..47f34e9b 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -36,7 +36,7 @@ "gulp-plumber": "^1.2.1", "gulp-postcss": "^8.0.0", <%_ if (includeSass) { -%> - "gulp-sass": "^4.0.2", + "gulp-sass": "^5.1.0", <%_ } -%> "gulp-size": "^3.0.0", "gulp-uglify": "^3.0.2", @@ -45,6 +45,9 @@ "mkdirp": "^0.5.1", <%_ } -%> "mocha": "^6.1.4", + <%_ if (includeSass) { -%> + "sass": "^1.58.3", + <%_ } -%> "yargs": "13.2.4" }, "scripts": { diff --git a/app/templates/gulpfile.js b/app/templates/gulpfile.js index 5bcb91db..4851a12f 100644 --- a/app/templates/gulpfile.js +++ b/app/templates/gulpfile.js @@ -9,6 +9,9 @@ const Modernizr = require('modernizr'); const browserSync = require('browser-sync'); const del = require('del'); const autoprefixer = require('autoprefixer'); +<%_ if (includeSass) { -%> +const sass = require('gulp-sass')(require('sass')); +<%_ } -%> const cssnano = require('cssnano'); const { argv } = require('yargs'); @@ -27,11 +30,11 @@ function styles() { sourcemaps: !isProd, }) .pipe($.plumber()) - .pipe($.sass.sync({ + .pipe(sass.sync({ outputStyle: 'expanded', precision: 10, includePaths: ['.'] - }).on('error', $.sass.logError)) + }).on('error', sass.logError)) <%_ } else { -%> return src('app/styles/*.css', { sourcemaps: !isProd,