Don't generate sourcemaps on production.

This commit is contained in:
Oliver Davies 2016-01-06 05:24:00 +00:00
parent 3e30949826
commit 7b366aff58
3 changed files with 9 additions and 3 deletions

View file

@ -7,7 +7,9 @@ var gulp = require('gulp'),
var config = {
cssDir: './source/assets/css',
imagesDir: './source/assets/images',
sassPattern: './sass/**/*.scss'
sassPattern: './sass/**/*.scss',
production: !!plugins.util.env.production,
sourceMaps: !plugins.util.env.production
};
gulp.task('styles', function () {
@ -15,7 +17,7 @@ gulp.task('styles', function () {
.pipe(plugins.compass({
config_file: './config.rb',
css: config.cssDir,
sourcemap: true
sourcemap: config.sourceMaps
}))
.pipe(plugins.minifyCss())
.pipe(gulp.dest(config.cssDir));

View file

@ -4,6 +4,7 @@
"gulp-compass": "^2.1.0",
"gulp-imagemin": "^2.4.0",
"gulp-load-plugins": "^1.1.0",
"gulp-minify-css": "^1.2.3"
"gulp-minify-css": "^1.2.3",
"gulp-util": "^3.0.7"
}
}

View file

@ -5,6 +5,9 @@ DEPLOY_USER=deployment
DEPLOY_HOST=www.oliverdavies.uk
DEPLOY_PATH=/var/www/oliverdavies/public
# Rebuild stylesheets.
gulp styles --production
./vendor/bin/sculpin generate --env=${ENV} --clean --no-interaction
if [ $? -ne 0 ]; then echo "Could not generate the site"; exit 1; fi