From 050e380203dd0d13f44859cc175dcac2374e03e3 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 22 Apr 2018 12:01:35 +0430 Subject: [PATCH] fix(nuxt-dev): ensure cache is cleaned for nuxt.config.js --- bin/common/utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/common/utils.js b/bin/common/utils.js index a26cb4806b..8bc8285cd7 100644 --- a/bin/common/utils.js +++ b/bin/common/utils.js @@ -2,7 +2,12 @@ const { resolve } = require('path') const { existsSync } = require('fs') const consola = require('consola') -const esm = require('esm')(module, {}) +const esm = require('esm')(module, { + cache: false, + cjs: { + cache: true + } +}) const getRootDir = argv => resolve(argv._[0] || '.') const getNuxtConfigFile = argv => resolve(getRootDir(argv), argv['config-file']) @@ -16,6 +21,7 @@ exports.loadNuxtConfig = argv => { let options = {} if (existsSync(nuxtConfigFile)) { + delete require.cache[nuxtConfigFile] options = esm(nuxtConfigFile) if (!options) { options = {}