gulp gulp-sass源字符串:1:错误:要导入的文件未找到或不可读:" susy"

时间:2014-05-15 03:20:23

标签: sass gulp susy-sass

需要帮助让gulp / gulp-sass识别出susy。我的想法很少,需要第二眼。感谢您的反馈。

错误:

[gulp] [gulp-sass] source string:1: error: file to import not found or unreadable: "susy"

宝石清单

rubygems-update (2.2.2)
rubyzip (1.0.0)
rvm (1.11.3.8)
sass (3.3.7)
selenium-webdriver (2.37.0)
slop (3.4.6)
sorcerer (1.0.2)
susy (2.1.2)

Config.rb

require 'susy'

的Gemfile

source 'https://rubygems.org'
gem 'susy'

Gulp

var paths = {
sass: ['sass/main.scss'],
scripts: ['js/vendor/jquery-1.11.0.min.js', 'js/*.js'],
images: 'img/**/*'
};
// Styles
gulp.task('styles', function() {
    return gulp.src(paths.sass)
    .pipe(sass({errLogToConsole: true}))
    .pipe(gulp.dest('css'))
    .pipe(rename({ suffix: '.min' }))
    .pipe(minifycss())
    .pipe(gulp.dest('css'))
    .pipe(notify({ message: 'Styles task complete' }));
});

1 个答案:

答案 0 :(得分:3)

切换到gulp-ruby-sass并按照下面的配置解决了这个问题:

gulp.task('styles', function() {
   return gulp.src(paths.sass)
    .pipe(sass({require: ['susy']}))
    .pipe(gulp.dest('css'))
    .pipe(rename({ suffix: '.min' }))
    .pipe(minifycss())
    .pipe(gulp.dest('css'))
    .pipe(notify({ message: 'Styles task complete' }));
});