fix(core, config): disabe esm cache (#7839)

This commit is contained in:
Xin Du (Clark) 2020-08-04 10:28:31 +01:00 committed by GitHub
parent e6eae8ff69
commit f130901ab1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ export async function loadNuxtConfig ({
configFile = defaultNuxtConfigFile, configFile = defaultNuxtConfigFile,
configContext = {}, configContext = {},
configOverrides = {}, configOverrides = {},
createRequire = module => isJest ? _createRequire(module.filename) : esm(module) createRequire = module => isJest ? _createRequire(module.filename) : esm(module, { cache: false })
} = {}) { } = {}) {
rootDir = path.resolve(rootDir) rootDir = path.resolve(rootDir)

View File

@ -461,7 +461,7 @@ export function getNuxtConfig (_options) {
} }
if (options.createRequire === 'esm') { if (options.createRequire === 'esm') {
const esm = require('esm') const esm = require('esm')
options.createRequire = module => esm(module) options.createRequire = module => esm(module, { cache: false })
} else if (options.createRequire === 'jiti') { } else if (options.createRequire === 'jiti') {
const jiti = require('jiti') const jiti = require('jiti')
options.createRequire = module => jiti(module.filename) options.createRequire = module => jiti(module.filename)