mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix(nuxt-dev): ensure cache is cleaned for nuxt.config.js
This commit is contained in:
parent
85cfc625ee
commit
050e380203
@ -2,7 +2,12 @@
|
||||
const { resolve } = require('path')
|
||||
const { existsSync } = require('fs')
|
||||
const consola = require('consola')
|
||||
const esm = require('esm')(module, {})
|
||||
const esm = require('esm')(module, {
|
||||
cache: false,
|
||||
cjs: {
|
||||
cache: true
|
||||
}
|
||||
})
|
||||
|
||||
const getRootDir = argv => resolve(argv._[0] || '.')
|
||||
const getNuxtConfigFile = argv => resolve(getRootDir(argv), argv['config-file'])
|
||||
@ -16,6 +21,7 @@ exports.loadNuxtConfig = argv => {
|
||||
let options = {}
|
||||
|
||||
if (existsSync(nuxtConfigFile)) {
|
||||
delete require.cache[nuxtConfigFile]
|
||||
options = esm(nuxtConfigFile)
|
||||
if (!options) {
|
||||
options = {}
|
||||
|
Loading…
Reference in New Issue
Block a user