Browse Source

gulp构建

master
wally 4 years ago
parent
commit
f80e596d77
  1. 14
      gulpfile.js
  2. 1
      package.json
  3. 12
      public/index.html
  4. 0
      src/classes/back.js
  5. 0
      src/classes/count.js
  6. 0
      src/classes/end.js
  7. 0
      src/classes/level.js
  8. 0
      src/classes/main.js
  9. 0
      src/classes/sound.js
  10. 0
      src/classes/time.js

14
gulpfile.js

@ -15,12 +15,20 @@ const script = function () {
.pipe(uglify()) .pipe(uglify())
.pipe(concat('main.js')) .pipe(concat('main.js'))
.pipe(dest('dist/')) .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 () { const watchTask = function () {
livereload.listen(); livereload.listen();
watch('src/*', series(cleanTask, script)); watch('src/*', script);
}; };
exports.default = parallel(script, watchTask); exports.default = parallel(cleanTask, copy, script, watchTask);

1
package.json

@ -14,7 +14,6 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.15.5", "@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6", "@babel/preset-env": "^7.15.6",
"del": "^6.0.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-babel": "^8.0.0", "gulp-babel": "^8.0.0",
"gulp-clean": "^0.4.0", "gulp-clean": "^0.4.0",

12
public/index.html

@ -1,17 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<!--
NOTES:
1. All tokens are represented by '$' sign in the template.
2. You can write your code only wherever mentioned.
3. All occurrences of existing tokens will be replaced by their appropriate values.
4. Blank lines will be removed automatically.
5. Remove unnecessary comments before creating your template.
-->
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="authoring-tool" content="Adobe_Animate_CC"> <meta name="authoring-tool" content="Adobe_Animate_CC">
<title>bird</title> <title>鸟妈妈回家</title>
<!-- write your code here --> <!-- write your code here -->
<style> <style>
#animation_container, #_preload_div_ { #animation_container, #_preload_div_ {
@ -23,7 +15,7 @@
</style> </style>
<script src="libs/1.0.0/createjs.min.js"></script> <script src="libs/1.0.0/createjs.min.js"></script>
<script src="bird.js"></script> <script src="bird.js"></script>
<script src="../dist/main.js"></script> <script src="main.js"></script>
<!-- write your code here --> <!-- write your code here -->
</head> </head>

0
src/classess/back.js → src/classes/back.js

0
src/classess/count.js → src/classes/count.js

0
src/classess/end.js → src/classes/end.js

0
src/classess/level.js → src/classes/level.js

0
src/classess/main.js → src/classes/main.js

0
src/classess/sound.js → src/classes/sound.js

0
src/classess/time.js → src/classes/time.js

Loading…
Cancel
Save