我不明白为什么编译后的CSS文件不出现,我检查了一些视频,但找不到错误,请帮助,我的代码如下,我也有图片
let gulp = require ('gulp');
let sass = require ('gulp-sass');
gulp.task('sass', function(){
return gulp.src('app/scss/style.scss')
.pipe(sass())
.pipe(gulp.dest('app/css'))
});
这里是图片[1]: https://i.stack.imgur.com/sCytp.png[2]: https://i.stack.imgur.com/SHUIA.png[3]: https://i.stack.imgur.com/RP1lx.png[4]: https://i.stack.imgur.com/fGK0h.png
如图2所示,您需要设置默认的sass编译器。查看文档了解更多示例
- 安装sass。
npm install sass
- 设置默认编译器
let sass = require('gulp-sass')(require('sass'));
结果:
```
let gulp = require ('gulp');
let sass = require ('gulp-sass')(require('sass'));
gulp.task('sass', function(){
return gulp.src('app/scss/style.scss')
.pipe(sass())
.pipe(gulp.dest('app/css'))
});