康复游戏-鸟妈妈回家
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
778 B

const { task, series, parallel, src, dest, watch } = require('gulp');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
const clean = require('gulp-clean');
const livereload = require('gulp-livereload');
const cleanTask = function () {
return src('dist/*', { read: false }).pipe(clean());
};
const script = function () {
return src('src/**/*.js')
.pipe(babel({ presets: ['@babel/env'] }))
.pipe(uglify())
.pipe(concat('main.js'))
.pipe(dest('dist/'))
.pipe(livereload({ start: true, port: 3001, reloadPage: 'public/index.html' }));
};
const watchTask = function () {
livereload.listen();
watch('src/*', series(cleanTask, script));
};
exports.default = parallel(script, watchTask);