Skip to content

Instantly share code, notes, and snippets.

@eristic
Last active April 1, 2017 10:24
Show Gist options
  • Save eristic/b3d5bf21979ac2878b34f2c33b79df02 to your computer and use it in GitHub Desktop.
Save eristic/b3d5bf21979ac2878b34f2c33b79df02 to your computer and use it in GitHub Desktop.
Gulp file for HTML5 Boilerplate. Save out as gulpfile.js
// Doing pretty basic stuff here, but make sure you add these dependencies via terminal
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
minify = require('gulp-minify');
// Need to create a /sass folder inside your css
gulp.task('build-that-css', function() {
return gulp.src('css/sass/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(concat('main.css'))
.pipe(gulp.dest('css/'));
});
gulp.task('compress-that-js', function() {
gulp.src('js/*.js')
.pipe(minify({
ext: {
src: 'main.js',
min: '.min.js'
}
}))
.pipe(gulp.dest('js/min/'))
// link to this minified version in your HTML
});
// Gulp is watching you and your coding with the command: gulp watch
gulp.task('watch', function() {
gulp.watch('css/sass/*.scss', ['build-that-css']);
gulp.watch('js/*.js', ['compress-that-js']);
});
gulp.task('default', ['watch']);
@eristic
Copy link
Author

eristic commented Mar 30, 2017

Making a series of these for different frameworks. Feel free to give feedback, revisions, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment