Search code examples
node.jsgulpbourbonnode-sass

gulp bourbon Can't import bourbon reference


I run Gulp with node-sass, node-bourbon, node-neat. So far things can go well , can able complied sass file to css without error. unless, I import bourbon and neat at the top of scss file. The error is occured.

"stream.js:94 throw er;// Unhandled stream error in pipe. 

Error: stdin:1: file to import not found or unreadable: "bourbon"

same source but with grunt work well . Any suggestion folk ?...

ps. this is my gulpfile.js .- https://gist.github.com/foonmod/71d8dee473226cdd46f6


Solution

  • The issue is in the use of the loadPath property for gulp-sass, which should instead be includePaths.

    Update your gulp-sass task in your Gist to look like this:

    gulp.task('sass', function(){
      gulp.src('sass/style.scss')
        .pipe(sass({
          includePaths: require('node-bourbon').includePaths,
          style: 'compressed',
          quiet: true
        }))
        .pipe(gulp.dest('css/'));
    });