mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
parent
5c4e8f6983
commit
c9a95429eb
@ -21,11 +21,13 @@ export async function loadNuxtConfig(argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nuxtConfigFile) {
|
if (nuxtConfigFile) {
|
||||||
|
// Clear cache
|
||||||
|
clearRequireCache(nuxtConfigFile)
|
||||||
|
|
||||||
if (nuxtConfigFile.endsWith('.ts')) {
|
if (nuxtConfigFile.endsWith('.ts')) {
|
||||||
options = require(nuxtConfigFile) || {}
|
options = require(nuxtConfigFile) || {}
|
||||||
} else {
|
} else {
|
||||||
clearRequireCache(nuxtConfigFile)
|
options = esm(module, { cache: false, cjs: { cache: true } })(nuxtConfigFile) || {}
|
||||||
options = esm(module, { cache: false, cjs: { cache: false } })(nuxtConfigFile) || {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.default) {
|
if (options.default) {
|
||||||
@ -49,6 +51,9 @@ export async function loadNuxtConfig(argv) {
|
|||||||
|
|
||||||
// Keep all related files for watching
|
// Keep all related files for watching
|
||||||
options._nuxtConfigFiles = Array.from(scanRequireTree(nuxtConfigFile))
|
options._nuxtConfigFiles = Array.from(scanRequireTree(nuxtConfigFile))
|
||||||
|
if (!options._nuxtConfigFiles.includes(nuxtConfigFile)) {
|
||||||
|
options._nuxtConfigFiles.unshift(nuxtConfigFile)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof options.rootDir !== 'string') {
|
if (typeof options.rootDir !== 'string') {
|
||||||
|
Loading…
Reference in New Issue
Block a user