Browse Source

Pull request #3508: KERNEL-14316 fix:代码调整

Merge in VISUAL/fineui from ~TREECAT/fineui:es6 to es6

* commit '5c0b7be0dcb625156808c0984825220a3e6f8c9f':
  KERNEL-14316 fix:代码调整
es6
treecat-罗群 2 years ago
parent
commit
e051d4ed38
  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,
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,
},

1
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";

32
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(),
],
},
};

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 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" }],
},
},
});

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 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(),
],
},
});

Loading…
Cancel
Save