I'm actually trying to build a gulp planning to do web related stuff, like compile sass, minify css, uglify javascript and so on. But I'm really having troubles with sass.
Here's a sample of my code :
gulp.task('compile-sass', function() {
gulp.src(buildType+config.path.sass+"/main.sass")
.pipe(compass({
css: 'css',
sass: 'sass'
}))
.pipe(gulp.dest(buildType+config.path.css+"/test"));
});
So I'm using compass here because i only have *.sass files and no .scss so gulp-sass wouldn't work for me. Therefore, I'm asking if anyone could give me a hint of why this task doesn't work. Here's what my console returns :
[gulp] Starting 'compile-sass'...
[gulp] Finished 'compile-sass' after 6.11 ms
[gulp] You must compile individual stylesheets from the project directory.
events.js:72
throw er; // Unhandled 'error' event
^
[gulp] Error in plugin 'gulp-compass': Compass failed
at Transform.<anonymous> (/Users/myusername/node_modules/gulp-compass/index.js:37:28)
at ChildProcess.<anonymous> (/Users/myusername/node_modules/gulp-compass/lib/compass.js:136:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Socket.<anonymous> (child_process.js:966:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
I know I'm not using any config.rb, but two things : 1) I found no example of such files 2) gulp-compass doc gives example without such a file so I assume it's optional
Thanks in advance.
buildType+config.path.sassandbuildType+config.path.css? Are they relative path from the root of the project, where you rungulp? Regardig the config, it's notgulp-compassconfig, butcompassconfg itself. One more thing, Compass only adds libs to SASS. Thereof, the ability of compiling.sassand.scssare not from Compass, but SASS itself, sogulp-sassshould do the work for you anyway. - Caio CunhabuildType+config.path.sassis a valid String coming from a Json config file, i'm using it in other tasks in the same gulpfile and it works perfectly. When i'm usinggulp-sassinstead of 'compass' another error shows up when reading the file ([gulp] [gulp-sass] source string:4: error: error reading values after $grayand others like this). I assume that.sassfiles are not supported by gulp-sass but only.scss. - soenguynode-sassparser which does. Consider usinggulp-ruby-sassas it should have support for .scss and .sass extensions. It then can reduce the possible errors to narrow your issue. - SteveLacy