mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
Fix rebuild when nuxt.config.js changed
This commit is contained in:
parent
b245b8d6ff
commit
0dd867cdec
@ -37,7 +37,7 @@ nuxt.build()
|
||||
function listenOnConfigChanges (nuxt, server) {
|
||||
// Listen on nuxt.config.js changes
|
||||
var build = _.debounce(() => {
|
||||
debug('[nuxt.config.js] changed, rebuilding the app...')
|
||||
debug('[nuxt.config.js] changed')
|
||||
delete require.cache[nuxtConfigFile]
|
||||
var options = {}
|
||||
if (fs.existsSync(nuxtConfigFile)) {
|
||||
@ -50,6 +50,8 @@ function listenOnConfigChanges (nuxt, server) {
|
||||
options.rootDir = rootDir
|
||||
nuxt.close()
|
||||
.then(() => {
|
||||
nuxt.renderer = null
|
||||
debug('Rebuilding the app...')
|
||||
return new Nuxt(options).build()
|
||||
})
|
||||
.then((nuxt) => {
|
||||
|
Loading…
Reference in New Issue
Block a user