问答详情
源自:4-4 gulp打包css

打包scss时报错:Task never defined

Task never defined: scss - did you mean? sass,任务没有定义???

本地代码:

const gulp = require('gulp');

const sass = require('gulp-sass')

const minifyCSS = require('gulp-minify-css');



gulp.task('sass', async function()http://img4.mukewang.com/61b83d390001c09205620198.jpg

  return gulp.src('components/css/**/*.scss')

    .pipe(sass())

    .pipe(minifyCSS())

    .pipe(gulp.dest('dist/css'))

})



提问者:日行一善_普渡众生 2021-12-14 14:42

个回答

  • Fewq
    2021-12-15 16:39:07

    根据错误提示:

    应该是你package.json中script的脚本配置错了,你定义的任务名称为sass,脚本配置的是scss。