From 54560c5dafd0cc58ce5652806eccdc8ef3ff0a33 Mon Sep 17 00:00:00 2001 From: iamkun Date: Wed, 30 Mar 2022 15:55:40 +0800 Subject: [PATCH] update test --- webpack.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index ef0a2a7e41..dbf1535f40 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -60,6 +60,15 @@ function injectWarningCondition(config) { }); } +function externalDayjs(config) { + config.externals.dayjs = { + root: 'dayjs', + commonjs2: 'dayjs', + commonjs: 'dayjs', + amd: 'dayjs', + }; +} + function processWebpackThemeConfig(themeConfig, theme, vars) { themeConfig.forEach(config => { // rename default entry to ${theme} entry @@ -118,6 +127,7 @@ webpackConfig.forEach(config => { if (process.env.RUN_ENV === 'PRODUCTION') { webpackConfig.forEach(config => { addLocales(config); + externalDayjs(config); // Reduce non-minified dist files size config.optimization.usedExports = true; // use esbuild