diff --git a/packages/bootstrap/webpack/config.js b/packages/bootstrap/webpack/config.js index d22526cc75e..e22913b0ede 100644 --- a/packages/bootstrap/webpack/config.js +++ b/packages/bootstrap/webpack/config.js @@ -5,6 +5,8 @@ const path = require('path'); +const KUBESPHERE_EDITION = 'ks'; + const resolve = absolutePath => path.resolve(process.cwd(), absolutePath); const rootDir = path.resolve(__dirname, '../'); @@ -46,4 +48,4 @@ const systemImports = { const locales = ['ar', 'en', 'es', 'fr', 'hi', 'ko', 'lt', 'pl', 'tc', 'tr', 'zh']; -module.exports = { config, systemImports, locales }; +module.exports = { config, systemImports, locales, KUBESPHERE_EDITION }; diff --git a/packages/bootstrap/webpack/webpack.base.conf.js b/packages/bootstrap/webpack/webpack.base.conf.js index 71140ae6028..eade8d4fd78 100644 --- a/packages/bootstrap/webpack/webpack.base.conf.js +++ b/packages/bootstrap/webpack/webpack.base.conf.js @@ -4,7 +4,7 @@ */ const fs = require('fs-extra'); -const { config, systemImports } = require('./config'); +const { config, systemImports, KUBESPHERE_EDITION } = require('./config'); const webpack = require('webpack'); const WebpackBar = require('webpackbar'); const { merge } = require('webpack-merge'); @@ -89,7 +89,7 @@ const webpackBaseConfig = merge(configs, { }, plugins: [ new webpack.DefinePlugin({ - 'process.env.KUBESPHERE_EDITION': JSON.stringify('ks'), + 'process.env.KUBESPHERE_EDITION': JSON.stringify(KUBESPHERE_EDITION), }), new ForkTsCheckerWebpackPlugin(), new CopyWebpackPlugin({ diff --git a/packages/bootstrap/webpack/webpack.dll.conf.js b/packages/bootstrap/webpack/webpack.dll.conf.js index 4feaff0a1f8..48cb3017d6c 100644 --- a/packages/bootstrap/webpack/webpack.dll.conf.js +++ b/packages/bootstrap/webpack/webpack.dll.conf.js @@ -10,7 +10,7 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); const WebpackBar = require('webpackbar'); const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); -const { config: configShared } = require('./config'); +const { config: configShared, KUBESPHERE_EDITION } = require('./config'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const resolveShared = configShared.resolve; const absResolve = configShared.absResolve; @@ -91,6 +91,9 @@ const config = { minimizer: [new TerserPlugin()], }, plugins: [ + new webpack.DefinePlugin({ + 'process.env.KUBESPHERE_EDITION': JSON.stringify(KUBESPHERE_EDITION), + }), new WebpackBar({ name: 'build dll', color: 'green',