我尝试运行一个gulp任务以编译我的sass项目,但由于我创建了子文件夹app/assets/并将源文件放入其中,因此出现了问题。 之前,当sass和css文件夹与我的gulpfile在同一目录中时,它可以完美地运行。如果我在基础目录上运行compass watch命令,则没有问题,这仅限于gulp-compass。 输出如下:
我做了一些搜索,但仍然没有找到问题所在。
谢谢您的帮助。
Devnco: /Users/Devnco/Web/maquette ->gulp sass
[gulp] Using gulpfile ~/Web/maquette/gulpfile.js
[gulp] Starting 'sass'...
[gulp] Finished 'sass' after 6.12 ms
[gulp] You must compile individual stylesheets from the project directory.
[gulp] Plumber found unhandled error: [gulp] Error in plugin 'gulp-compass': Compass failed
[gulp] You must compile individual stylesheets from the project directory.
[gulp] Plumber found unhandled error: [gulp] Error in plugin 'gulp-compass': Compass failed
[gulp] You must compile individual stylesheets from the project directory.
[gulp] Plumber found unhandled error: [gulp] Error in plugin 'gulp-compass': Compass failed
我的 gulpfile.js:
var paths = {
css: './app/assets/css',
sass: './app/assets/sass/*.scss',
js: './app/assets/js',
images: './app/assets/images'
}
gulp.task('sass',function(){
gulp.src(paths.sass)
.pipe(plumber())
.pipe(compass({
css: paths.css,
sass: paths.sass
}))
.pipe(gulp.dest(paths.css))
.pipe(minifyCss())
.pipe(rename({ extname: '.min.css'}))
.pipe(gulp.dest(paths.css));
});
我的工作目录:
gulpfile.js
app/
assets/
fonts/
images/
sass/
css/
pages/
etc…
以下是我使用的版本信息(最新):
"devDependencies": {
"gulp": "^3.6.2",
"gulp-compass": "^1.1.9",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.4",
"gulp-plumber": "^0.6.2",
"gulp-rename": "^1.2.0"
}
我做了一些搜索,但仍然没有找到问题所在。
谢谢您的帮助。