Browse Source

watch update //Fix: 2 run

W 10 years ago
parent
commit
dc0e584112
1 changed files with 12 additions and 6 deletions
  1. 12 6
      gulpfile.babel.js

+ 12 - 6
gulpfile.babel.js

@@ -70,18 +70,24 @@ gulp.task('serve', cb => {
 });
 
 gulp.task('dev-server', function() {
+
   const server = new WebpackDevServer(bundler, {
     contentBase: path.join(__dirname, 'build'),
     hot: true,
     filename: 'app.js',
-    stats: { colors: true },
+    watchOptions: {
+      aggregateTimeout: 300,
+      poll: 400
+    },
+    stats: {
+      colors: true,
+      chunks: false,
+      version: false
+    },
     historyApiFallback: true
   });
-  bundler.watch({
-    aggregateTimeout: 300,
-    poll: 400
-  }, function(err, stats) {
-    // actions
+  bundler.plugin('done', () => {
+    console.log('done');// eslint-disable-line no-console
   });
   server.listen(3000, 'localhost', function (err) {
     if (err) { console.log(err); }