[英]Syntax error from gulp-ruby-sass seems incorrect
我正在使用'gulp-ruby-sass'創建一個gulp任務,並且在終端中收到此錯誤。
Syntax error: File to import not found or unreadable: compass.
Load paths:
/Users/antonioortiz/Sites/_test/_aortizRefresh_
/Users/antonioortiz/Sites/_test/_aortizRefresh_/source/assets/sass
on line 38 of /Users/antonioortiz/Sites/_test/_aortizRefresh_/source/assets/sass/style.scss
我的指南針版本是Compass 0.12.4 (Alnilam)
我的sass版本是Sass 3.2.18 (Media Mark)
這是我的gulfile.js的摘錄
var sassSources = ['source/assets/sass/style.scss'];
gulp.task('sass', function(){
gulp.src(sassSources)
.pipe(sass({style:'expanded', lineNumbers:true}))
.pipe(concat('style.css'))
.pipe(gulp.dest('source/stylesheets'))
.pipe(livereload());
});
gulp.task('watch', function() {
var server = livereload();
gulp.watch(jsSources,['js']);
gulp.watch(sassSources,['sass']);
gulp.watch(['javascript/script.js', 'source/*.html'], function(e){
server.changed(e.path);
});
});
gulp.task('default', [ 'sass', 'js', 'watch']);
任何幫助都太棒了!
錯誤消息本身就說明: sass
無法找到您的compass import
。
使用gulp-ruby-sass
,必須將compass
布爾值設置為true
才能使compass
與您的sass
一起工作。
這是已更正的任務:
gulp.task('sass', function() {
return gulp.src(sassSources)
.pipe(sass({ style:'expanded', lineNumbers:true, compass:true }))
.pipe(concat('style.css'))
.pipe(gulp.dest('source/stylesheets'))
.pipe(livereload());
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.