mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +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 { resolve } = require('path')
|
||||||
const { existsSync } = require('fs')
|
const { existsSync } = require('fs')
|
||||||
const consola = require('consola')
|
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 getRootDir = argv => resolve(argv._[0] || '.')
|
||||||
const getNuxtConfigFile = argv => resolve(getRootDir(argv), argv['config-file'])
|
const getNuxtConfigFile = argv => resolve(getRootDir(argv), argv['config-file'])
|
||||||
@ -16,6 +21,7 @@ exports.loadNuxtConfig = argv => {
|
|||||||
let options = {}
|
let options = {}
|
||||||
|
|
||||||
if (existsSync(nuxtConfigFile)) {
|
if (existsSync(nuxtConfigFile)) {
|
||||||
|
delete require.cache[nuxtConfigFile]
|
||||||
options = esm(nuxtConfigFile)
|
options = esm(nuxtConfigFile)
|
||||||
if (!options) {
|
if (!options) {
|
||||||
options = {}
|
options = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user