From 904a584f32a317ab3f415c754280a6c88ecf4a82 Mon Sep 17 00:00:00 2001 From: Treecat Date: Tue, 25 Apr 2023 10:08:04 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-14316=20fix:=E4=BB=A3=E7=A0=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/base/combination/combo.js | 3 +- .../src/widget/multilayerselecttree/index.js | 1 + packages/fineui/webpack/webpack.common.js | 32 +++++++++++++++++ packages/fineui/webpack/webpack.dev.js | 14 -------- packages/fineui/webpack/webpack.prod.js | 34 ------------------- 5 files changed, 35 insertions(+), 49 deletions(-) diff --git a/packages/fineui/src/base/combination/combo.js b/packages/fineui/src/base/combination/combo.js index 4f86e51c5..0721ba9e0 100644 --- a/packages/fineui/src/base/combination/combo.js +++ b/packages/fineui/src/base/combination/combo.js @@ -16,6 +16,7 @@ import { EVENT_BLUR, DOM, emptyFn, + isIE, LogicFactory } from "@/core"; import { Resizers } from "@/base/0.base"; @@ -42,7 +43,7 @@ export class Combo extends Bubble { const conf = super._defaultConfig(...arguments); return extend(conf, { - baseCls: `${conf.baseCls || ""} bi-comboisIE() ? " hack" : ""}`, + baseCls: `${conf.baseCls || ""} bi-combo${isIE() ? " hack" : ""}`, attributes: { tabIndex: -1, }, diff --git a/packages/fineui/src/widget/multilayerselecttree/index.js b/packages/fineui/src/widget/multilayerselecttree/index.js index 436fdef6c..5876ea944 100644 --- a/packages/fineui/src/widget/multilayerselecttree/index.js +++ b/packages/fineui/src/widget/multilayerselecttree/index.js @@ -1,2 +1,3 @@ export { MultiLayerSelectTreeCombo } from "./multilayerselecttree.combo"; export { MultiLayerSelectLevelTree } from "./multilayerselecttree.leveltree"; +export { MultiLayerSelectTreePopup } from "./multilayerselecttree.popup"; \ No newline at end of file diff --git a/packages/fineui/webpack/webpack.common.js b/packages/fineui/webpack/webpack.common.js index 30a2983b1..dd5582d7b 100644 --- a/packages/fineui/webpack/webpack.common.js +++ b/packages/fineui/webpack/webpack.common.js @@ -4,7 +4,11 @@ const path = require("path"); const fs = require("fs"); const dirs = require("./dirs"); const attachments = require("./attachments"); +const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); +const childProcess = require("child_process"); const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); +const webpack = require("webpack"); +const TerserPlugin = require("terser-webpack-plugin"); let lessVariables = {}; if (process.env.LESS_CONFIG_PATH) { @@ -14,6 +18,10 @@ if (process.env.LESS_CONFIG_PATH) { lessVariables = fs.existsSync(lessConfigPath) ? require(lessConfigPath) || {} : {}; } +function git(command) { + return childProcess.execSync(`git ${command}`).toString().trim(); +} + module.exports = { entry: { fineui: attachments.fineui, @@ -94,4 +102,28 @@ module.exports = { }), new ForkTsCheckerWebpackPlugin({}), ], + + optimization: { + usedExports: false, + minimize: true, + minimizer: [ + new TerserPlugin({ + include: /\.min/, + parallel: true, + terserOptions: { + format: { + comments: /\/*! time:(.*?); branch:(.*?); commit:(.*?)/, + }, + }, + }), + new webpack.BannerPlugin({ + banner: `time: ${new Date().toLocaleString("en-US")}; branch: ${git( + 'name-rev --name-only HEAD' + )}; commit: ${git( + 'rev-parse HEAD' + )}` + }), + new CssMinimizerPlugin(), + ], + }, }; diff --git a/packages/fineui/webpack/webpack.dev.js b/packages/fineui/webpack/webpack.dev.js index c0bb360fe..a69e190ee 100644 --- a/packages/fineui/webpack/webpack.dev.js +++ b/packages/fineui/webpack/webpack.dev.js @@ -1,18 +1,7 @@ -const webpack = require("webpack"); -const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const TerserPlugin = require("terser-webpack-plugin"); -const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); const common = require("./webpack.common.js"); -const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); -const childProcess = require("child_process"); const { merge } = require("webpack-merge"); const dirs = require("./dirs"); -const attachments = require("./attachments"); -const path = require("path"); -function git(command) { - return childProcess.execSync(`git ${command}`).toString().trim(); -} module.exports = merge(common, { mode: "development", @@ -27,8 +16,5 @@ module.exports = merge(common, { devServer: { port: 9001, liveReload: true, - historyApiFallback: { - rewrites: [{ from: /.*/, to: "/index.html" }], - }, }, }); diff --git a/packages/fineui/webpack/webpack.prod.js b/packages/fineui/webpack/webpack.prod.js index 329835729..712a39d10 100644 --- a/packages/fineui/webpack/webpack.prod.js +++ b/packages/fineui/webpack/webpack.prod.js @@ -1,18 +1,8 @@ -const webpack = require("webpack"); -const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const TerserPlugin = require("terser-webpack-plugin"); -const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); const common = require("./webpack.common.js"); -const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); -const childProcess = require("child_process"); const { merge } = require("webpack-merge"); const dirs = require("./dirs"); const attachments = require("./attachments"); -function git(command) { - return childProcess.execSync(`git ${command}`).toString().trim(); -} - module.exports = merge(common, { mode: "production", @@ -28,28 +18,4 @@ module.exports = merge(common, { }, devtool: "hidden-source-map", - - optimization: { - usedExports: false, - minimize: true, - minimizer: [ - new TerserPlugin({ - include: /\.min/, - parallel: true, - terserOptions: { - output: { - comments: false, - }, - }, - }), - new webpack.BannerPlugin({ - banner: `time: ${new Date().toLocaleString("en-US")}; branch: ${git( - "name-rev --name-only HEAD" - )} commit: ${git("rev-parse HEAD")}`, - }), - new CssMinimizerPlugin(), - ], - }, - - });