Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
Fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 30, 2017
1 parent a279609 commit dd37155
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion bin/watch/get-watch-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = ({ cli, filepkg }) => {
const watchConfig = {
usePolling,
ignoreInitial: true,
cwd: process.cwd(),
ignored
}

Expand Down
7 changes: 5 additions & 2 deletions bin/watch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const getTimestamp = require('time-stamp')
const logSymbols = require('log-symbols')
const { watch } = require('chokidar')
const debounce = require('debounce')
const chalk = require('chalk')

const destroySockets = require('./destroy-sockets')
Expand Down Expand Up @@ -30,8 +31,10 @@ module.exports = ({ filename, filepkg, server, cli, sockets }) => {
server.close(restartServer.bind(this, { filename, filepkg, cli, watcher }))
}

watcher.on('all', (event, filename) =>
doRestart({ filename, forcing: false })
watcher.on(
'all',
debounce((event, filename) => doRestart({ filename, forcing: false })),
10
)

if (!isListenRestart) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"chalk": "~2.1.0",
"chokidar": "~1.7.0",
"clear-module": "~2.1.0",
"debounce": "~1.0.2",
"get-port": "~3.1.0",
"ignore-by-default": "~1.0.1",
"ignored": "~2.0.4",
Expand Down

0 comments on commit dd37155

Please sign in to comment.