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

gulp sass 打包报错 求解

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'));

http://img3.mukewang.com/619757fd000162ec16001464.jpg

提问者:qq_麻小烦_0 2021-11-19 15:53

个回答

  • qq_麻小烦_0
    2021-11-19 15:59:03

    解决了:

    1. 下载指令:npm install sass gulp-sass -D

    2. 导入时:const sass = require ( 'gulp-sass' ) ( require ( 'sass' ) )