From 91c3642e64166a939683b856e5b34ef42d12bb0e Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Sun, 21 Apr 2019 22:20:32 +0430 Subject: [PATCH] fix: don't customize esm options options like `{ cjs: { } }` resets other defaults. this ensures consitency of usage [release] --- packages/cli/src/utils/config.js | 2 +- packages/core/src/resolver.js | 2 +- scripts/dev.js | 9 +-------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/cli/src/utils/config.js b/packages/cli/src/utils/config.js index 9892b5c29e..cad5c1bdc9 100644 --- a/packages/cli/src/utils/config.js +++ b/packages/cli/src/utils/config.js @@ -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) { diff --git a/packages/core/src/resolver.js b/packages/core/src/resolver.js index 3a2679e256..7f7ff2f326 100644 --- a/packages/core/src/resolver.js +++ b/packages/core/src/resolver.js @@ -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) { diff --git a/scripts/dev.js b/scripts/dev.js index 387fe414e6..09f5e6c509 100755 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -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')