Browse Source

更新gulp脚本

zxlie 7 years ago
parent
commit
93fb8b379f
3 changed files with 8 additions and 5 deletions
  1. 1 1
      chrome/apps/manifest.json
  2. 5 3
      chrome/gulpfile.js
  3. 2 1
      chrome/package.json

+ 1 - 1
chrome/apps/manifest.json

@@ -1,6 +1,6 @@
 {
   "name": "WEB前端助手(FeHelper)",
-  "version": "2018.04.1301",
+  "version": "2018.04.1315",
   "manifest_version": 2,
   "default_locale": "zh_CN",
   "description": "FE助手:包括JSON格式化、二维码生成与解码、信息编解码、代码压缩、美化、页面取色、正则表达式、时间转换工具、编码规范检测、页面性能检测、Ajax接口调试",

+ 5 - 3
chrome/gulpfile.js

@@ -17,6 +17,7 @@ let pretty = require('pretty-bytes');
 let shell = require('shelljs');
 let runSequence = require('run-sequence');
 let watchPath = require('gulp-watch-path');
+let gcallback = require('gulp-callback');
 
 gulp.task('clean', () => {
     return gulp.src('output', {read: false}).pipe(clean({force: true}));
@@ -62,8 +63,9 @@ gulp.task('default', ['clean'], () => {
 // 开发过程中用,watch while file changed
 gulp.task('watch', () => {
     gulp.watch('apps/**/*.*', (event) => {
-        let wp = watchPath(event,'./','./output');
-        gulp.src(wp.srcPath).pipe(copy('output'));
-        console.log('> 文件发生变化,已编译:',wp.srcPath);
+        let wp = watchPath(event, './', './output');
+        gulp.src(wp.srcPath).pipe(copy('output')).pipe(gcallback(() => {
+            console.log('> 文件发生变化,已编译:', wp.srcPath);
+        }));
     });
 });

+ 2 - 1
chrome/package.json

@@ -6,6 +6,7 @@
   "dependencies": {},
   "devDependencies": {
     "gulp": "^3.9.1",
+    "gulp-callback": "0.0.3",
     "gulp-clean": "^0.4.0",
     "gulp-copy": "^1.1.0",
     "gulp-htmlmin": "^4.0.0",
@@ -19,7 +20,7 @@
     "shelljs": "^0.8.1"
   },
   "scripts": {
-    "watch":"gulp watch",
+    "watch": "gulp watch",
     "build": "gulp"
   },
   "repository": {