@ -0,0 +1,26 @@ |
|||
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); |
@ -1,7 +0,0 @@ |
|||
function test() { |
|||
document.addEventListener('click', () => { |
|||
main.play(); |
|||
}); |
|||
} |
|||
|
|||
test(); |
@ -0,0 +1,28 @@ |
|||
{ |
|||
"name": "bird-go-home", |
|||
"version": "1.0.0", |
|||
"description": "", |
|||
"main": ".svrxrc.js", |
|||
"scripts": {}, |
|||
"repository": { |
|||
"type": "git", |
|||
"url": "gitea@dd.tall.wiki:ccsens_fe/bird-go-home.git" |
|||
}, |
|||
"keywords": [], |
|||
"author": "", |
|||
"license": "ISC", |
|||
"devDependencies": { |
|||
"@babel/core": "^7.15.5", |
|||
"@babel/preset-env": "^7.15.6", |
|||
"del": "^6.0.0", |
|||
"gulp": "^4.0.2", |
|||
"gulp-babel": "^8.0.0", |
|||
"gulp-clean": "^0.4.0", |
|||
"gulp-concat": "^2.6.1", |
|||
"gulp-livereload": "^4.0.2", |
|||
"gulp-uglify": "^3.0.2" |
|||
}, |
|||
"dependencies": { |
|||
"vinyl-paths": "^4.0.0" |
|||
} |
|||
} |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 324 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |