Created
December 30, 2018 21:15
-
-
Save notiv-nt/476cb4f954083b99c09798c37ea9d38b to your computer and use it in GitHub Desktop.
Gulp javascript task — parcel version
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
let PRODUCTION_MODE = process.argv.indexOf('--minify') !== -1; | |
const gulp = require('gulp'); | |
const _ = require('gulp-load-plugins')(); | |
gulp.task('javascript', () => { | |
const sources = ['./source/js/index.js', 'source/js/sw.js'] | |
gulp.src(sources, { read: false }) | |
.pipe(_.parcel({ | |
minify: PRODUCTION_MODE, | |
outDir: './public/assets/js', | |
})) | |
.pipe(gulp.dest('./public/assets/js')); | |
}); |
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
{ | |
"scripts": { | |
"build": "gulp --minify" | |
}, | |
"dependencies": { | |
"gulp": "^3.9.1", | |
"gulp-load-plugins": "^1.5.0", | |
"gulp-parcel": "^0.3.5" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment