From dc2cc746cfb962fb92c63fe7ed7b693a57942085 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Sun, 2 Oct 2022 02:12:13 +0200 Subject: [PATCH] Fix the development only js-yaml dependency being included in the release builds (#2646) --- _scripts/webpack.renderer.config.js | 6 ++++++ _scripts/webpack.web.config.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/_scripts/webpack.renderer.config.js b/_scripts/webpack.renderer.config.js index 12a408bf..bd7431af 100644 --- a/_scripts/webpack.renderer.config.js +++ b/_scripts/webpack.renderer.config.js @@ -163,6 +163,12 @@ if (isDevMode) { processLocalesPlugin, new webpack.DefinePlugin({ 'process.env.LOCALE_NAMES': JSON.stringify(processLocalesPlugin.localeNames) + }), + // webpack doesn't get rid of js-yaml even though it isn't used in the production builds + // so we need to manually tell it to ignore any imports for `js-yaml` + new webpack.IgnorePlugin({ + resourceRegExp: /^js-yaml$/, + contextRegExp: /i18n$/ }) ) } diff --git a/_scripts/webpack.web.config.js b/_scripts/webpack.web.config.js index 1aa474a4..86c43f3a 100644 --- a/_scripts/webpack.web.config.js +++ b/_scripts/webpack.web.config.js @@ -189,6 +189,12 @@ if (isDevMode) { }, }, ] + }), + // webpack doesn't get rid of js-yaml even though it isn't used in the production builds + // so we need to manually tell it to ignore any imports for `js-yaml` + new webpack.IgnorePlugin({ + resourceRegExp: /^js-yaml$/, + contextRegExp: /i18n$/ }) ) }