Browse Source

KERNEL-14316 fix:代码调整

es6
Treecat 2 years ago
parent
commit
904a584f32
  1. 3
      packages/fineui/src/base/combination/combo.js
  2. 1
      packages/fineui/src/widget/multilayerselecttree/index.js
  3. 32
      packages/fineui/webpack/webpack.common.js
  4. 14
      packages/fineui/webpack/webpack.dev.js
  5. 34
      packages/fineui/webpack/webpack.prod.js

3
packages/fineui/src/base/combination/combo.js

@ -16,6 +16,7 @@ import {
EVENT_BLUR, EVENT_BLUR,
DOM, DOM,
emptyFn, emptyFn,
isIE,
LogicFactory LogicFactory
} from "@/core"; } from "@/core";
import { Resizers } from "@/base/0.base"; import { Resizers } from "@/base/0.base";
@ -42,7 +43,7 @@ export class Combo extends Bubble {
const conf = super._defaultConfig(...arguments); const conf = super._defaultConfig(...arguments);
return extend(conf, { return extend(conf, {
baseCls: `${conf.baseCls || ""} bi-comboisIE() ? " hack" : ""}`, baseCls: `${conf.baseCls || ""} bi-combo${isIE() ? " hack" : ""}`,
attributes: { attributes: {
tabIndex: -1, tabIndex: -1,
}, },

1
packages/fineui/src/widget/multilayerselecttree/index.js

@ -1,2 +1,3 @@
export { MultiLayerSelectTreeCombo } from "./multilayerselecttree.combo"; export { MultiLayerSelectTreeCombo } from "./multilayerselecttree.combo";
export { MultiLayerSelectLevelTree } from "./multilayerselecttree.leveltree"; export { MultiLayerSelectLevelTree } from "./multilayerselecttree.leveltree";
export { MultiLayerSelectTreePopup } from "./multilayerselecttree.popup";

32
packages/fineui/webpack/webpack.common.js

@ -4,7 +4,11 @@ const path = require("path");
const fs = require("fs"); const fs = require("fs");
const dirs = require("./dirs"); const dirs = require("./dirs");
const attachments = require("./attachments"); 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 ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const webpack = require("webpack");
const TerserPlugin = require("terser-webpack-plugin");
let lessVariables = {}; let lessVariables = {};
if (process.env.LESS_CONFIG_PATH) { if (process.env.LESS_CONFIG_PATH) {
@ -14,6 +18,10 @@ if (process.env.LESS_CONFIG_PATH) {
lessVariables = fs.existsSync(lessConfigPath) ? require(lessConfigPath) || {} : {}; lessVariables = fs.existsSync(lessConfigPath) ? require(lessConfigPath) || {} : {};
} }
function git(command) {
return childProcess.execSync(`git ${command}`).toString().trim();
}
module.exports = { module.exports = {
entry: { entry: {
fineui: attachments.fineui, fineui: attachments.fineui,
@ -94,4 +102,28 @@ module.exports = {
}), }),
new ForkTsCheckerWebpackPlugin({}), 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(),
],
},
}; };

14
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 common = require("./webpack.common.js");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const childProcess = require("child_process");
const { merge } = require("webpack-merge"); const { merge } = require("webpack-merge");
const dirs = require("./dirs"); 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, { module.exports = merge(common, {
mode: "development", mode: "development",
@ -27,8 +16,5 @@ module.exports = merge(common, {
devServer: { devServer: {
port: 9001, port: 9001,
liveReload: true, liveReload: true,
historyApiFallback: {
rewrites: [{ from: /.*/, to: "/index.html" }],
},
}, },
}); });

34
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 common = require("./webpack.common.js");
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
const childProcess = require("child_process");
const { merge } = require("webpack-merge"); const { merge } = require("webpack-merge");
const dirs = require("./dirs"); const dirs = require("./dirs");
const attachments = require("./attachments"); const attachments = require("./attachments");
function git(command) {
return childProcess.execSync(`git ${command}`).toString().trim();
}
module.exports = merge(common, { module.exports = merge(common, {
mode: "production", mode: "production",
@ -28,28 +18,4 @@ module.exports = merge(common, {
}, },
devtool: "hidden-source-map", 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(),
],
},
}); });

Loading…
Cancel
Save