×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: calaverse
Added: Jan 21, 2015 11:20 PM
Modified: Jan 21, 2015 11:22 PM
Views: 20
Tags: no tags
used with the zen theme in Drupal
  1. 'use strict';
  2.  
  3. var gulp = require('gulp');
  4.  
  5. // load plugins
  6. var $ = require('gulp-load-plugins')();
  7.  
  8. var cmq = require('gulp-combine-media-queries');
  9. var livereload = require('gulp-livereload');
  10.        
  11. //error handling
  12. var onError = function (err) {
  13.   console.log(err);
  14. };
  15.  
  16. gulp.task('styles', function () {
  17.   return gulp.src('sass/styles.scss')
  18.           .pipe($.plumber(onError))
  19.           .pipe($.rubySass({
  20.             loadPath: './sass-extensions/zen-grids/stylesheets/',
  21.             compass: true,
  22.             style: 'expanded'
  23.           }))
  24.           .pipe($.autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
  25.           .pipe(cmq())
  26.           //.pipe($.csscss())
  27.           //.pipe($.cssbeautify())
  28.           //.pipe($.cssshrink())
  29.          
  30.          
  31.           .pipe(gulp.dest('css'))
  32.           //.pipe($.rename({suffix: '.min'}))
  33.           //.pipe($.minifyCss())
  34.           //.pipe(gulp.dest('css'))
  35.           ;
  36. });
  37.  
  38. function startExpress() {
  39.  
  40.   var express = require('express');
  41.   var app = express();
  42.   app.use(express.static(__dirname));
  43.   app.listen(4000);
  44. }
  45.  
  46. gulp.task('watch', function () {
  47.  
  48.   gulp.watch('./sass/*.scss', ['styles']);
  49.   gulp.watch('./sass/**/*.scss', ['styles']);
  50.  
  51.   livereload.listen();
  52.   gulp.watch('./css/**').on('change', livereload.changed);
  53. });
  54.  
  55. gulp.task('default', ['watch'], function () {
  56.   //startExpress();
  57. });