|
|
@ -15,12 +15,20 @@ const script = function () { |
|
|
|
.pipe(uglify()) |
|
|
|
.pipe(concat('main.js')) |
|
|
|
.pipe(dest('dist/')) |
|
|
|
.pipe(livereload({ start: true, port: 3001, reloadPage: 'public/index.html' })); |
|
|
|
.pipe(livereload({ start: true, port: 3001, reloadPage: 'dist/index.html' })); |
|
|
|
}; |
|
|
|
|
|
|
|
const copy = function () { |
|
|
|
src('./public/index.html').pipe(dest('dist/')); |
|
|
|
src('./public/bird.js').pipe(dest('dist/')); |
|
|
|
src('./public/images/*').pipe(dest('dist/images')); |
|
|
|
src('./public/libs/**/*').pipe(dest('dist/libs')); |
|
|
|
src('./public/sounds/*').pipe(dest('dist/sounds')); |
|
|
|
}; |
|
|
|
|
|
|
|
const watchTask = function () { |
|
|
|
livereload.listen(); |
|
|
|
watch('src/*', series(cleanTask, script)); |
|
|
|
watch('src/*', script); |
|
|
|
}; |
|
|
|
|
|
|
|
exports.default = parallel(script, watchTask); |
|
|
|
exports.default = parallel(cleanTask, copy, script, watchTask); |
|
|
|