2018-10-16 20:04:08 +00:00
|
|
|
const gulp = require('gulp')
|
2020-10-26 14:09:57 +00:00
|
|
|
const gulpBabel = require('gulp-babel')
|
|
|
|
const gulpClean = require('gulp-clean')
|
|
|
|
const gulpPrint = require('gulp-print').default
|
2018-10-16 21:19:54 +00:00
|
|
|
const nodemon = require('gulp-nodemon')
|
2018-10-16 20:51:10 +00:00
|
|
|
|
2020-10-26 14:09:57 +00:00
|
|
|
const devel = (done) =>
|
|
|
|
nodemon({ script: 'src/server.js', exec: 'babel-node', done })
|
2018-10-16 20:51:10 +00:00
|
|
|
.on('restart', () => { console.log('>> node restart') })
|
2018-10-16 20:04:08 +00:00
|
|
|
|
2020-10-26 14:09:57 +00:00
|
|
|
const clean = () => gulp.src('dist/*').pipe(gulpClean())
|
2018-10-16 20:04:08 +00:00
|
|
|
|
2018-10-17 13:44:22 +00:00
|
|
|
/* WARNING: This is broken right now */
|
2020-10-26 14:09:57 +00:00
|
|
|
const build = () =>
|
2018-10-16 20:04:08 +00:00
|
|
|
gulp.src('src/**/*.js')
|
2020-10-26 14:09:57 +00:00
|
|
|
.pipe(gulpBabel())
|
|
|
|
.pipe(gulpPrint())
|
2018-10-16 20:04:08 +00:00
|
|
|
.pipe(gulp.dest('dist/'))
|
|
|
|
|
2020-10-26 14:09:57 +00:00
|
|
|
exports.devel = devel
|
|
|
|
exports.clean = clean
|
|
|
|
exports.build = build
|
|
|
|
exports.default = gulp.series(clean, build)
|