mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +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) {
|
function listenOnConfigChanges (nuxt, server) {
|
||||||
// Listen on nuxt.config.js changes
|
// Listen on nuxt.config.js changes
|
||||||
var build = _.debounce(() => {
|
var build = _.debounce(() => {
|
||||||
debug('[nuxt.config.js] changed, rebuilding the app...')
|
debug('[nuxt.config.js] changed')
|
||||||
delete require.cache[nuxtConfigFile]
|
delete require.cache[nuxtConfigFile]
|
||||||
var options = {}
|
var options = {}
|
||||||
if (fs.existsSync(nuxtConfigFile)) {
|
if (fs.existsSync(nuxtConfigFile)) {
|
||||||
@ -50,6 +50,8 @@ function listenOnConfigChanges (nuxt, server) {
|
|||||||
options.rootDir = rootDir
|
options.rootDir = rootDir
|
||||||
nuxt.close()
|
nuxt.close()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
nuxt.renderer = null
|
||||||
|
debug('Rebuilding the app...')
|
||||||
return new Nuxt(options).build()
|
return new Nuxt(options).build()
|
||||||
})
|
})
|
||||||
.then((nuxt) => {
|
.then((nuxt) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user