Sass 一口吞下,什么也不输出
我正在gulpfile.js中运行以下命令Sass 一口吞下,什么也不输出,sass,gulp,gulp-sass,postcss,Sass,Gulp,Gulp Sass,Postcss,我正在gulpfile.js中运行以下命令 var gulp = require('gulp'); var postcss = require('gulp-postcss'); var csswring = require('csswring'); var sass = require('gulp-sass'); gulp.task('styles', function() { var processors = [ csswring ]; return gulp.
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var csswring = require('csswring');
var sass = require('gulp-sass');
gulp.task('styles', function() {
var processors = [
csswring
];
return gulp.src('xampp/htdocs/wordpress/wp-content/themes/paws2play/sass/style.scss')
.pipe(sass())
.on('error', sass.logError)
.pipe(postcss(processors))
.pipe(gulp.dest('xampp/htdocs/wordpress/wp-content/themes/paws2play/style.css'));
});
gulp.task('watch:styles', function(){
gulp.watch('**/*.scss', ['styles']);
});
在喝了大口酒之后,我把这个拿出来
[19:05:34] Using gulpfile c:\xampp\htdocs\wordpress\wp-content\themes\paws2play\gulpfile.js
[19:05:34] Starting 'styles'...
[19:05:34] Finished 'styles' after 17 ms
当我去检查我的style.css文件时,它是空的。我不确定我做错了什么。我已经运行了sass-trace-watch-style.scss:style.css,它运行得很好。我不知道在这里该怎么办
谢谢我看到了一点错误,但我认为这对你来说不是问题 首先确保您的路径是正确的
- 检查您的
在哪里gulpfile.js
- 如果它在
中,则在下面的xampp/htdocs/wordpress/wp content
中找到gulpfile.js
,并使用路径
进行更改/themes/paws2play
gulpfile.js
:
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var csswring = require('csswring');
var sass = require('gulp-sass');
gulp.task('styles', function() {
var processors = [
csswring
];
return gulp.src('PATH/sass/style.scss')
.pipe(sass().on('error', sass.logError))
.pipe(postcss(processors))
.pipe(gulp.dest('PATH'));
});
gulp.task('watch:styles', function(){
gulp.watch('PATH/sass/**/*.scss', ['styles']);
});
您还可以添加以查看流中的文件