fix memory leak on restart nuxt-dev (#2190)

This commit is contained in:
Dmitriy 2017-11-22 12:51:07 +03:00 committed by Pooya Parsa
parent 8550bcd684
commit 4c808c90ab

View File

@ -449,10 +449,16 @@ export default class Builder {
return
}
// Server, build and watch for changes
compiler.watch(this.options.watchers.webpack, (err) => {
const watching = compiler.watch(this.options.watchers.webpack, (err) => {
/* istanbul ignore if */
if (err) return reject(err)
})
// Stop watching on nuxt.close()
this.nuxt.hook('close', () => {
watching.close()
})
return
}
// --- Production Build ---