gulp.task('sass', ['del'], function() {
return gulp.src('./sassDir/style/*.scss')
.pipe(compass({
config_file: path.join(process.cwd(), 'config.rb'),
project: path.join(process.cwd(), '/sassDir'),
css: './',
sass: 'style',
}))
.on('end', function() {
console.log('compass 编译完成')
})
});
实际执行的命令
/home/suntopo/.rvm/gems/ruby-2.3.0/bin/compass
[ 'compile',
'/home/suntopo/Desktop/gulp-compass-demo/sassDir',
'/home/suntopo/Desktop/gulp-compass-demo/sassDir/style/haha.scss',
'-c',
'/home/suntopo/Desktop/gulp-compass-demo/config.rb',
'--relative-assets',
'--css-dir',
'./',
'--sass-dir',
'sass' ]
compass 的命令格式
Usage: compass compile [path/to/project] [path/to/project/src/file.sass ...] [options]
疑问在于 compile 的第二参数[path/to/project/src/file.sass ...]
, '/home/suntopo/Desktop/gulp-compass-demo/sassDir/style/haha.scss',
看参数感觉像说 sass 的源,但是实际上只是 sass 源中的最后一个 sass 文件,那么这个参数是干哈的呢