Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add KUBESPHERE_EDITION constant to config files #4304

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/bootstrap/webpack/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '../');
Expand Down Expand Up @@ -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 };
4 changes: 2 additions & 2 deletions packages/bootstrap/webpack/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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({
Expand Down
5 changes: 4 additions & 1 deletion packages/bootstrap/webpack/webpack.dll.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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',
Expand Down
Loading