diff options
author | Camil Staps | 2015-02-16 22:58:02 +0100 |
---|---|---|
committer | Camil Staps | 2015-02-16 22:58:02 +0100 |
commit | fdbd8bc793823dadf5d3c270cc9033349609ba50 (patch) | |
tree | 6935c3a104c00eb3a5759f0ee0e8ffe3bb7a5bf7 /gulpfile.js |
Added installation stuff
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..e777bbc --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,47 @@ +// include gulp +var gulp = require('gulp'); + +// include plugins +var jshint = require('gulp-jshint'); +var changed = require('gulp-changed'); +var minifyHTML = require('gulp-minify-html'); +var concat = require('gulp-concat'); +var stripDebug = require('gulp-strip-debug'); +var uglify = require('gulp-uglify'); +var autoprefix = require('gulp-autoprefixer'); +var minifyCSS = require('gulp-minify-css'); + +// JS hint task +gulp.task('jshint', function(){ + gulp.src('./src/scripts/*.js') + .pipe(jshint()) + .pipe(jshint.reporter('default')); +}); + +// minify new/changed HTML +gulp.task('htmlpage', function(){ + var src = './src/*.html'; + var dst = './build'; + gulp.src(src) + .pipe(changed(dst)) + .pipe(minifyHTML()) + .pipe(gulp.dest(dst)); +}); + +// JS concat, strip debugging and minify +gulp.task('scripts', function(){ + gulp.src(['./src/scripts/lib.js', './src/scripts/*.js']) + .pipe(concat('script.js')) + .pipe(stripDebug()) + .pipe(uglify()) + .pipe(gulp.dest('./build/scripts')); +}); + +// CSS concat, auto-prefix and minify +gulp.task('styles', function(){ + gulp.src(['./src/styles/*.css']) + .pipe(concat('styles.css')) + .pipe(autoprefix('last 2 versions')) + .pipe(minifyCSS()) + .pipe(gulp.dest('./build/styles/')); +}); |