From 9a4a38719459b383ebe0ce5107757e56fc7b0f69 Mon Sep 17 00:00:00 2001 From: KubeSphere CI Bot <47586280+ks-ci-bot@users.noreply.github.com> Date: Mon, 15 Jul 2024 23:43:55 +0800 Subject: [PATCH] [ksc-release-4.1] build: recover @ks-console/shared from extension externals (#4277) * build: recover @ks-console/shared from extension externals Signed-off-by: donniean * chore: rename Signed-off-by: donniean --------- Signed-off-by: donniean Co-authored-by: donniean --- packages/bootstrap/webpack/config.js | 2 +- packages/bootstrap/webpack/webpack.base.conf.js | 5 +++-- packages/bootstrap/webpack/webpack.extension.conf.js | 7 ++++--- server/configs/systemImports.js | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/bootstrap/webpack/config.js b/packages/bootstrap/webpack/config.js index def8a549236..c11ef46474c 100644 --- a/packages/bootstrap/webpack/config.js +++ b/packages/bootstrap/webpack/config.js @@ -20,7 +20,7 @@ const config = { }; const systemImports = { - // '@ks-console/shared': 'core:@kubed/@ks-console/shared', + '@ks-console/shared': 'core:@kubed/@ks-console/shared', '@kubed/charts': 'core:@kubed/charts', '@kubed/code-editor': 'core:@kubed/code-editor', '@kubed/components': 'core:@kubed/components', diff --git a/packages/bootstrap/webpack/webpack.base.conf.js b/packages/bootstrap/webpack/webpack.base.conf.js index 4cd62e54cd3..e195bf21a08 100644 --- a/packages/bootstrap/webpack/webpack.base.conf.js +++ b/packages/bootstrap/webpack/webpack.base.conf.js @@ -14,8 +14,9 @@ const getCustomTransformers = isDev ? () => ({ before: [styledComponentsTransfor const { resolve, absResolve } = config; -const configFile = fs.pathExistsSync(resolve('configs/webpack.config.js')); -const configs = configFile ? require(resolve('configs/webpack.config.js')) : {}; +const customConfigFilePath = resolve('configs/webpack.config.js'); +const configFile = fs.pathExistsSync(customConfigFilePath); +const configs = configFile ? require(customConfigFilePath) : {}; const webpackBaseConfig = merge(configs, { entry: { diff --git a/packages/bootstrap/webpack/webpack.extension.conf.js b/packages/bootstrap/webpack/webpack.extension.conf.js index e7b26ac4d45..1926aa70c4f 100644 --- a/packages/bootstrap/webpack/webpack.extension.conf.js +++ b/packages/bootstrap/webpack/webpack.extension.conf.js @@ -7,8 +7,9 @@ const { config } = require('./config'); const fs = require('fs-extra'); const resolve = config.resolve; -const configFile = fs.pathExistsSync(resolve('configs/webpack.config.js')); -const configs = configFile ? require(resolve('configs/webpack.config.js')) : {}; +const customConfigFilePath = resolve('configs/webpack.extensions.config.js'); +const configFile = fs.pathExistsSync(customConfigFilePath); +const configs = configFile ? require(customConfigFilePath) : {}; module.exports = merge( { @@ -105,7 +106,7 @@ module.exports = merge( }, ], externals: [ - // '@ks-console/shared', + '@ks-console/shared', '@kubed/charts', '@kubed/code-editor', '@kubed/components', diff --git a/server/configs/systemImports.js b/server/configs/systemImports.js index 21bff3adca1..0b23d582093 100644 --- a/server/configs/systemImports.js +++ b/server/configs/systemImports.js @@ -1,5 +1,5 @@ const systemImports = { - // '@ks-console/shared': 'core:@kubed/@ks-console/shared', + '@ks-console/shared': 'core:@kubed/@ks-console/shared', '@kubed/charts': 'core:@kubed/charts', '@kubed/code-editor': 'core:@kubed/code-editor', '@kubed/components': 'core:@kubed/components',