Skip to content

Instantly share code, notes, and snippets.

@silenceisgolden
Created March 14, 2016 22:37
Show Gist options
  • Save silenceisgolden/319023fb137f73b4d66e to your computer and use it in GitHub Desktop.
Save silenceisgolden/319023fb137f73b4d66e to your computer and use it in GitHub Desktop.
'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