From 48e0b2bb893a1c0b4151049fe2525eeb12776474 Mon Sep 17 00:00:00 2001 From: Samuel Roy Date: Tue, 24 Sep 2019 16:57:24 +0200 Subject: [PATCH] remove path with [lang] from exportedPath --- src/plugin.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 10acd9b..92f6e1e 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -129,10 +129,17 @@ function withI18nTagPlugin(nextConfig = {}, composePlugins = {}) { if (phase === PHASE_EXPORT) { Object.assign(newConfig, { exportTrailingSlash: true, - exportPathMap: defaultPathMap => ({ - ...defaultPathMap, - ...localizedPathMaps(), - }), + exportPathMap: defaultPathMap => { + Object.keys(defaultPathMap).forEach(key => { + if (key.indexOf('/[lang]') > -1) { + delete defaultPathMap[key] + } + }) + return { + ...defaultPathMap, + ...localizedPathMaps(), + } + }, }) }