Created
March 14, 2016 22:37
-
-
Save silenceisgolden/319023fb137f73b4d66e to your computer and use it in GitHub Desktop.
This file contains 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 characters
'use strict'; | |
/** | |
* Using gulp 4 syntax | |
* https://demisx.github.io/gulp4/2015/01/15/install-gulp4.html | |
* npm install gulpjs/gulp.git#4.0 --save-dev | |
* | |
* Note: probably also make a .gitignore for the node_modules folder | |
*/ | |
const del = require('del'); | |
const gulp = require('gulp'); | |
const prefix = require('gulp-autoprefixer'); | |
gulp.task('build', gulp.series( | |
clean, | |
gulp.parallel( | |
css, | |
js | |
), | |
watch | |
)); | |
gulp.task('default', gulp.series('build')); | |
function clean() { | |
return del(['static']); | |
} | |
function css() { | |
return gulp.src('src/css/*') | |
.pipe(prefix({ | |
browsers: ['last 1 version'] | |
})) | |
.pipe(gulp.dest('static/css')); | |
} | |
function js() { | |
return gulp.src('src/js/*') | |
.pipe(gulp.dest('static/js')); | |
} | |
function watch() { | |
gulp.watch('src/css', css); | |
gulp.watch('src/js', js); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment