mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
fix memory leak on restart nuxt-dev (#2190)
This commit is contained in:
parent
8550bcd684
commit
4c808c90ab
@ -449,10 +449,16 @@ export default class Builder {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Server, build and watch for changes
|
// 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 */
|
/* istanbul ignore if */
|
||||||
if (err) return reject(err)
|
if (err) return reject(err)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Stop watching on nuxt.close()
|
||||||
|
this.nuxt.hook('close', () => {
|
||||||
|
watching.close()
|
||||||
|
})
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// --- Production Build ---
|
// --- Production Build ---
|
||||||
|
Loading…
Reference in New Issue
Block a user