mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix: don't customize esm options
options like `{ cjs: { } }` resets other defaults. this ensures consitency of usage [release]
This commit is contained in:
parent
0c05161651
commit
91c3642e64
@ -27,7 +27,7 @@ export async function loadNuxtConfig(argv) {
|
||||
if (nuxtConfigFile.endsWith('.ts')) {
|
||||
options = require(nuxtConfigFile) || {}
|
||||
} else {
|
||||
options = esm(module, { cache: false, cjs: { cache: true } })(nuxtConfigFile) || {}
|
||||
options = esm(module)(nuxtConfigFile) || {}
|
||||
}
|
||||
|
||||
if (options.default) {
|
||||
|
@ -18,7 +18,7 @@ export default class Resolver {
|
||||
this.requireModule = this.requireModule.bind(this)
|
||||
|
||||
// ESM Loader
|
||||
this.esm = esm(module, {})
|
||||
this.esm = esm(module)
|
||||
}
|
||||
|
||||
resolveModule(path) {
|
||||
|
@ -13,14 +13,7 @@ const stub = {
|
||||
es: `export * from '../src/index'`,
|
||||
cjs: `const esm = require('esm')
|
||||
|
||||
const _require = esm(module, {
|
||||
cache: false,
|
||||
cjs: {
|
||||
cache: true,
|
||||
vars: true,
|
||||
namedExports: true
|
||||
}
|
||||
})
|
||||
const _require = esm(module)
|
||||
|
||||
const execa = require('execa')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user