W 10 年之前
父节点
当前提交
377a5189df
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      gulpfile.babel.js

+ 6 - 4
gulpfile.babel.js

@@ -74,13 +74,15 @@ gulp.task('dev-server', function() {
     contentBase: path.join(__dirname, 'build'),
     contentBase: path.join(__dirname, 'build'),
     hot: true,
     hot: true,
     filename: 'app.js',
     filename: 'app.js',
-    watchOptions: {
-      aggregateTimeout: 300,
-      poll: 400
-    },
     stats: { colors: true },
     stats: { colors: true },
     historyApiFallback: true
     historyApiFallback: true
   });
   });
+  bundler.watch({
+    aggregateTimeout: 300,
+    poll: 400
+  }, function(err, stats) {
+    // actions
+  });
   server.listen(3000, 'localhost', function (err) {
   server.listen(3000, 'localhost', function (err) {
     if (err) { console.log(err); }
     if (err) { console.log(err); }
     console.log('Listening at localhost:3000');
     console.log('Listening at localhost:3000');