fix: don't customize esm options

options like `{ cjs: { }  }` resets other defaults. this ensures consitency of usage

[release]
This commit is contained in:
pooya parsa 2019-04-21 22:20:32 +04:30
parent 0c05161651
commit 91c3642e64
3 changed files with 3 additions and 10 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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')