-
-
Save marczhermo/d9df6b0fd96342aaa67a to your computer and use it in GitHub Desktop.
Revisions
-
markgoodyear revised this gist
Aug 11, 2014 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ /*! * gulp * $ npm install gulp-ruby-sass gulp-autoprefixer gulp-minify-css gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev */ // Load plugins @@ -12,11 +12,11 @@ var gulp = require('gulp'), uglify = require('gulp-uglify'), imagemin = require('gulp-imagemin'), rename = require('gulp-rename'), concat = require('gulp-concat'), notify = require('gulp-notify'), cache = require('gulp-cache'), livereload = require('gulp-livereload'), del = require('del'); // Styles gulp.task('styles', function() { @@ -52,9 +52,8 @@ gulp.task('images', function() { }); // Clean gulp.task('clean', function(cb) { del(['dist/assets/css', 'dist/assets/js', 'dist/assets/img'], cb) }); // Default task -
markgoodyear revised this gist
Aug 11, 2014 . 1 changed file with 2 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,11 +75,9 @@ gulp.task('watch', function() { gulp.watch('src/images/**/*', ['images']); // Create LiveReload server livereload.listen(); // Watch any files in dist/, reload on change gulp.watch(['dist/**']).on('change', livereload.changed); }); -
markgoodyear revised this gist
Apr 21, 2014 . 1 changed file with 17 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,8 @@ /*! * gulp * $ npm install gulp-ruby-sass gulp-autoprefixer gulp-minify-css gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-clean gulp-notify gulp-rename gulp-livereload gulp-cache --save-dev */ // Load plugins var gulp = require('gulp'), sass = require('gulp-ruby-sass'), @@ -11,9 +16,7 @@ var gulp = require('gulp'), concat = require('gulp-concat'), notify = require('gulp-notify'), cache = require('gulp-cache'), livereload = require('gulp-livereload'); // Styles gulp.task('styles', function() { @@ -23,7 +26,6 @@ gulp.task('styles', function() { .pipe(gulp.dest('dist/styles')) .pipe(rename({ suffix: '.min' })) .pipe(minifycss()) .pipe(gulp.dest('dist/styles')) .pipe(notify({ message: 'Styles task complete' })); }); @@ -37,7 +39,6 @@ gulp.task('scripts', function() { .pipe(gulp.dest('dist/scripts')) .pipe(rename({ suffix: '.min' })) .pipe(uglify()) .pipe(gulp.dest('dist/scripts')) .pipe(notify({ message: 'Scripts task complete' })); }); @@ -46,7 +47,6 @@ gulp.task('scripts', function() { gulp.task('images', function() { return gulp.src('src/images/**/*') .pipe(cache(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))) .pipe(gulp.dest('dist/images')) .pipe(notify({ message: 'Images task complete' })); }); @@ -65,21 +65,21 @@ gulp.task('default', ['clean'], function() { // Watch gulp.task('watch', function() { // Watch .scss files gulp.watch('src/styles/**/*.scss', ['styles']); // Watch .js files gulp.watch('src/scripts/**/*.js', ['scripts']); // Watch image files gulp.watch('src/images/**/*', ['images']); // Create LiveReload server var server = livereload(); // Watch any files in dist/, reload on change gulp.watch(['dist/**']).on('change', function(file) { server.changed(file.path); }); }); -
markgoodyear revised this gist
Jan 28, 2014 . 1 changed file with 4 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -59,7 +59,7 @@ gulp.task('clean', function() { // Default task gulp.task('default', ['clean'], function() { gulp.start('styles', 'scripts', 'images'); }); // Watch @@ -72,22 +72,13 @@ gulp.task('watch', function() { }; // Watch .scss files gulp.watch('src/styles/**/*.scss', ['styles']); // Watch .js files gulp.watch('src/scripts/**/*.js', ['scripts']); // Watch image files gulp.watch('src/images/**/*', ['images']); }); -
markgoodyear created this gist
Jan 18, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,157 @@ /*! * Grunt * $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev */ module.exports = function(grunt) { grunt.initConfig({ // Sass sass: { dist: { options: { style: 'expanded' }, files: { 'dist/styles/main.css': 'src/styles/main.scss' } } }, // Autoprefix autoprefixer: { options: { browsers: [ 'last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4' ] }, dist: { src: 'dist/styles/main.css' } }, // CSS minify cssmin: { dist: { files: { 'dist/styles/main.min.css': 'dist/styles/main.css' } } }, // JShint jshint: { files: ['src/scripts/**/*.js'], options: { jshintrc: '.jshintrc' } }, // Concat concat: { js: { src: ['src/scripts/**/*.js'], dest: 'dist/scripts/main.js' }, }, // Uglify uglify: { dist: { src: 'dist/scripts/main.js', dest: 'dist/scripts/main.min.js' }, }, // Imagemin imagemin: { dist: { options: { optimizationLevel: 3, progressive: true, interlaced: true }, files: [{ expand: true, cwd: 'src/images', src: ['**/*.{png,jpg,gif}'], dest: 'dist/images' }] } }, // Clean clean: { build: ['dist/styles', 'dist/scripts', 'dist/images'] }, // Notify notify: { styles: { options: { message: 'Styles task complete', } }, scripts: { options: { message: 'Scripts task complete', } }, images: { options: { message: 'Images task complete', } }, }, // Watch watch: { styles: { files: 'src/styles/**/*.scss', tasks: ['sass', 'autoprefixer', 'cssmin', 'notify:styles'], }, scripts: { files: 'src/scripts/**/*.js', tasks: ['concat', 'uglify', 'notify:scripts'], }, images: { files: 'src/images/**/*', tasks: ['imagemin', 'notify:images'], }, livereload: { options: { livereload: true }, files: [ 'dist/styles/**/*.css', 'dist/scripts/**/*.js', 'dist/images/**/*' ] } } }); // Default task grunt.registerTask('default', [ 'jshint', 'clean', 'concat', 'uglify', 'sass', 'autoprefixer', 'cssmin', 'imagemin' ]); // Load plugins grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-autoprefixer'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-imagemin'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-notify'); }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,94 @@ // Load plugins var gulp = require('gulp'), sass = require('gulp-ruby-sass'), autoprefixer = require('gulp-autoprefixer'), minifycss = require('gulp-minify-css'), jshint = require('gulp-jshint'), uglify = require('gulp-uglify'), imagemin = require('gulp-imagemin'), rename = require('gulp-rename'), clean = require('gulp-clean'), concat = require('gulp-concat'), notify = require('gulp-notify'), cache = require('gulp-cache'), livereload = require('gulp-livereload'), lr = require('tiny-lr'), server = lr(); // Styles gulp.task('styles', function() { return gulp.src('src/styles/main.scss') .pipe(sass({ style: 'expanded', })) .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')) .pipe(gulp.dest('dist/styles')) .pipe(rename({ suffix: '.min' })) .pipe(minifycss()) .pipe(livereload(server)) .pipe(gulp.dest('dist/styles')) .pipe(notify({ message: 'Styles task complete' })); }); // Scripts gulp.task('scripts', function() { return gulp.src('src/scripts/**/*.js') .pipe(jshint('.jshintrc')) .pipe(jshint.reporter('default')) .pipe(concat('main.js')) .pipe(gulp.dest('dist/scripts')) .pipe(rename({ suffix: '.min' })) .pipe(uglify()) .pipe(livereload(server)) .pipe(gulp.dest('dist/scripts')) .pipe(notify({ message: 'Scripts task complete' })); }); // Images gulp.task('images', function() { return gulp.src('src/images/**/*') .pipe(cache(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))) .pipe(livereload(server)) .pipe(gulp.dest('dist/images')) .pipe(notify({ message: 'Images task complete' })); }); // Clean gulp.task('clean', function() { return gulp.src(['dist/styles', 'dist/scripts', 'dist/images'], {read: false}) .pipe(clean()); }); // Default task gulp.task('default', ['clean'], function() { gulp.run('styles', 'scripts', 'images'); }); // Watch gulp.task('watch', function() { // Listen on port 35729 server.listen(35729, function (err) { if (err) { return console.log(err) }; // Watch .scss files gulp.watch('src/styles/**/*.scss', function(event) { console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); gulp.run('styles'); }); // Watch .js files gulp.watch('src/scripts/**/*.js', function(event) { console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); gulp.run('scripts'); }); // Watch image files gulp.watch('src/images/**/*', function(event) { console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); gulp.run('images'); }); }); });