Fix rebuild when nuxt.config.js changed

This commit is contained in:
Sébastien Chopin 2016-12-14 15:30:44 +01:00
parent b245b8d6ff
commit 0dd867cdec

View File

@ -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) => {