Sha256: 926792f472acfc4a233e20710ca0c61af9a39df591295be1599a3ba63578a625

Contents?: true

Size: 1.56 KB

Versions: 8

Compression:

Stored size: 1.56 KB

Contents

var gulp         = require('gulp');
var browserSync  = require('browser-sync');
var autoprefixer = require('gulp-autoprefixer');
var csscomb      = require('gulp-csscomb');
var cssnano      = require('gulp-cssnano');
var notify       = require('gulp-notify');
var plumber      = require('gulp-plumber');
var rename       = require('gulp-rename');
var sass         = require('gulp-sass');
var sourcemaps   = require('gulp-sourcemaps');

var onError = function(err) {
  notify.onError({
    title:    "Error",
    message:  "<%= error %>",
  })(err);
  this.emit('end');
};

var plumberOptions = {
  errorHandler: onError,
};

var postCSSOptions = require('./config.postcss.json');
var autoprefixerOptions = postCSSOptions.autoprefixer;

gulp.task('sass', function() {
  return gulp.src('_sass/screen.scss')
    .pipe(plumber(plumberOptions))
    .pipe(sourcemaps.init())
    .pipe(sass())
    .pipe(autoprefixer(autoprefixerOptions))
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest('css'));
});

gulp.task('dist:css', function() {
  return gulp.src('_sass/hamburgers/hamburgers.scss')
    .pipe(sass())
    .pipe(autoprefixer(autoprefixerOptions))
    .pipe(gulp.dest('dist'))
    .pipe(csscomb('.csscomb.dist.json'))
    .pipe(cssnano())
    .pipe(rename('hamburgers.min.css'))
    .pipe(gulp.dest('dist'));
});

gulp.task('watch', function() {
  var browserSyncConfig = require('./bs-config.js');

  browserSync.init(browserSyncConfig);

  gulp.watch('_sass/**/*.scss', ['sass']);
});

gulp.task('build', ['sass']);

gulp.task('dist', ['dist:css']);

gulp.task('default', ['build', 'watch']);

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hamburgers-1.1.3 gulpfile.js
hamburgers-1.1.2 gulpfile.js
hamburgers-1.1.0 gulpfile.js
hamburgers-0.9.3 gulpfile.js
hamburgers-0.9.1 gulpfile.js
hamburgers-0.9.0 gulpfile.js
hamburgers-0.7.0 gulpfile.js
hamburgers-0.6.0 gulpfile.js