From: MateuszBobola Date: Tue, 22 Dec 2015 19:01:25 +0000 (+0100) Subject: added sourcemsp in sass task X-Git-Tag: v2.0.0-rc.1~63^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2b9d4ca82fa845fc00bea3624bb08854f4ea2f1;p=thirdparty%2Ffoundation%2Ffoundation-emails.git added sourcemsp in sass task --- diff --git a/package.json b/package.json index c5d7fd3b..fc8cbd7e 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "gulp-autoprefixer": "^2.3.1", "gulp-cached": "^1.1.0", "gulp-htmlmin": "^1.1.1", + "gulp-if": "^2.0.0", "gulp-inject": "^1.2.0", "gulp-inky": "git://github.com/zurb/gulp-inky.git", "gulp-inline-css": "^2.0.0", diff --git a/test/gulpfile.js b/test/gulpfile.js index 8b9da0ae..8f92372c 100644 --- a/test/gulpfile.js +++ b/test/gulpfile.js @@ -11,7 +11,6 @@ console.log(process.argv); // Look for the --production flag var isProduction = !!(yargs.production); -var sourceMaps = isProduction ? 'sass' : 'sass-sourcemaps'; // Delete the "dist" folder // This happens every time a build starts @@ -34,19 +33,12 @@ gulp.task('pages', function() { // Compile Sass into CSS gulp.task('sass', function() { return gulp.src('./scss/app.scss') + .pipe($.if(!isProduction, $.sourcemaps.init())) .pipe($.sass().on('error', $.sass.logError)) + .pipe($.if(!isProduction, $.sourcemaps.write())) .pipe(gulp.dest('../_build/css')); }); -// Compile Sass into CSS with sourcemaps -gulp.task('sass-sourcemaps', function() { - return gulp.src('./scss/app.scss') - .pipe($.sourcemaps.init()) - .pipe($.sass().on('error', $.sass.logError)) - .pipe($.sourcemaps.write()) - .pipe(gulp.dest('../_build/css')); -}); - // Inline CSS and minify HTML gulp.task('inline', function() { return gulp.src('../_build/*.html') @@ -64,7 +56,7 @@ gulp.task('server', ['build'], function() { // Build the "dist" folder by running all of the above tasks gulp.task('build', function(cb) { - var tasks = ['clean', ['pages', sourceMaps]]; + var tasks = ['clean', ['pages', 'sass']]; if (isProduction) tasks.push('inline'); tasks.push(cb); sequence.apply(this, tasks); @@ -73,7 +65,7 @@ gulp.task('build', function(cb) { // Build emails, run the server, and watch for file changes gulp.task('default', ['server'], function() { gulp.watch('./pages/**/*.html', ['pages', browser.reload]); - gulp.watch(['../scss/**/*.scss', './scss/**/*.scss'], [sourceMaps, browser.reload]); + gulp.watch(['../scss/**/*.scss', './scss/**/*.scss'], ['sass', browser.reload]); }); function inline(options) {