Running Sass 3.4.3, Compass 1.0.1, Gulp 3.8.8 and Gulp-compass 1.3.1
gulp.task('compass', function() {
gulp.src('comp/sass/style.scss')
.pipe(compass({
sass: 'comp/sass',
image: 'dev/theme/images',
style: 'compressed'
})
.on('error', gutil.log))
.pipe(gulp.dest('dev/theme/css'))
});
The Compass task is compiling the sass but compression is not working. It outputs a normal uncompressed CSS file.
I had the same issue with the following:
gulp.task('compass', function() {
gulp.src(sassSources)
.pipe(compass({
sass: 'components/sass',
image: outputDir + '/images',
style: sassStyle
}))
.on('error', gutil.log)
.pipe(gulp.dest(outputDir + '/css'))
.pipe(connect.reload())
});
Note that there is this variable sassStyle that is defined conditionally in this next portion of code where the node.js process.env process is 'watching' NODE_ENV value so we can switch between production folder and development folder:
env = process.env.NODE_ENV || 'development';
if (env ==='development') {
outputDir = 'builds/development/';
sassStyle = 'expanded';
} else {
outputDir = 'builds/production/';
sassStyle ='compressed';
}
It didn't do the trick but an external config.rb file manually edited with:
config_file: 'config.rb',
with this line in the file worked:
output_style = :compressed
For now, I just left these lines commented out in the file as workaround.
I'm using the following devDependencies:
"devDependencies": {
"gulp": "^3.9.1",
"gulp-browserify": "^0.5.1",
"gulp-coffee": "^2.3.2",
"gulp-compass": "^2.1.0",
"gulp-concat": "^2.6.0",
"gulp-connect": "^5.0.0",
"gulp-util": "^3.0.7",
"jquery": "^3.1.0",
"mustache": "^2.2.1"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With