Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: gulpfile.js

Issue 29441585: No Issue - SCSS Media Query Style Proposal (Closed)
Patch Set: Created May 18, 2017, 10:55 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gulpfile.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/gulpfile.js
@@ -0,0 +1,26 @@
+var gulp = require('gulp');
juliandoucette 2017/05/22 11:20:09 Did you mean to include scss to run this?
+var rename = require('gulp-rename');
+var sass = require('gulp-sass');
+var postcss = require('gulp-postcss');
+var cssMQPacker = require("css-mqpacker");
+
+var postcssProcessors = [cssMQPacker()];
+
+gulp.task('sass', function () {
+ gulp.src('./scss/main.scss')
+ .pipe(sass().on('error', sass.logError))
+ .pipe(rename('default.css'))
+ .pipe(gulp.dest('./css'));
+
+ gulp.src('./scss/main.scss')
+ .pipe(sass().on('error', sass.logError))
+ .pipe(postcss(postcssProcessors))
+ .pipe(rename('packed.css'))
+ .pipe(gulp.dest('./css'));
+});
+
+gulp.task('watch', function () {
+ gulp.watch('./scss/*.scss', ['sass']);
+});
+
+gulp.task('default', ['sass', 'watch']);

Powered by Google App Engine
This is Rietveld