From 27d627906fa1c7427fa6b229e572e0dd257b18c8 Mon Sep 17 00:00:00 2001 From: Treecat Date: Tue, 28 Mar 2023 15:37:25 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-14316=20fix:=20bundle=20=E6=89=93?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/lessconfig/bi.lessconfig.json | 52 +++++++++++++++++++ .../fineui/lessconfig/jsy.lessconfig.json | 21 ++++++++ packages/fineui/lodash.md | 1 + packages/fineui/webpack.prod.js | 22 +++++--- 4 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 packages/fineui/lessconfig/bi.lessconfig.json create mode 100644 packages/fineui/lessconfig/jsy.lessconfig.json create mode 100644 packages/fineui/lodash.md diff --git a/packages/fineui/lessconfig/bi.lessconfig.json b/packages/fineui/lessconfig/bi.lessconfig.json new file mode 100644 index 000000000..d82f94985 --- /dev/null +++ b/packages/fineui/lessconfig/bi.lessconfig.json @@ -0,0 +1,52 @@ +{ + "@color-primary": "#2C60DB", + "@color-green-100": "#3FC47B", + "@color-light-blue-100": "#19B8EA", + "@color-orange-100": "#FAAA39", + "@color-red-100": "#E65251", + "@color-black": "#091E40", + "@color-light-gray": "#ECEEF3", + "@color-light-gray-theme-dark": "#292F45", + "@border-color-line": "rgba(9, 30, 64, 0.15)", + "@border-color-light-line": "#E6E9EF", + "@border-color-dark-line": "#2E3A4D", + "@color-sliver-theme-dark": "#363E55", + "@border-color-disabled": "rgba(9, 30, 64, 0.07)", + "@font-color-normal": "#091E40", + "@font-color-gray": "rgba(9, 30, 64, 0.9)", + "@font-color-light-gray": "rgba(9, 30, 64, 0.66)", + "@font-color-tips": "rgba(9, 30, 64, 0.47)", + "@font-color-disabled": "rgba(9, 30, 64, 0.25)", + "@background-color-normal": "#F8F9FC", + "@color-bi-background-active-radio": "transparent", + "@color-bi-border-radio": "rgba(9, 30, 64, 0.37)", + "@color-bi-border-disabled-radio": "rgba(9, 30, 64, 0.19)", + "@color-bi-background-active-radio-content": "#2C60DB", + "@color-bi-border-checkbox-theme-dark": "rgba(255, 255, 255, 0.37)", + "@color-bi-border-hover-active-radio-theme-dark": "#3869DC", + "@color-bi-background-active-radio-content-theme-dark": "#3869DC", + "@color-bi-background-disabled-active-radio-content": "#FFFFFF", + "@color-bi-background-disabled-active-radio-content-theme-dark": "#606479", + "@color-bi-background-disabled-active-checkbox-content": "#FFFFFF", + "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479", + "@color-bi-background-tooltip-success": "#3F506A", + "@color-bi-background-tooltip-failure": "#E65251", + "@color-bi-border-tooltip-success": "#2E3A4D", + "@color-bi-background-toast-success": "#FFFFFF", + "@color-bi-background-toast-warning": "#FFFFFF", + "@color-bi-background-toast-error": "#FFFFFF", + "@color-bi-background-toast-normal": "#FFFFFF", + "@color-bi-color-toast-success": "#3FC47B", + "@color-bi-color-toast-warning": "#FAAA39", + "@color-bi-color-toast-error": "#E65251", + "@color-bi-color-toast-normal": "#2C60DB", + "@color-bi-color-toast-text": "#000A19", + "@color-bi-text-header-background": "rgba(9, 30, 64, 0.9)", + "@color-bi-text-header-background-theme-dark": "rgba(255, 255, 255, 0.9)", + "@font-date": "e733", + "@font-trigger-triangle": "e924", + "@font-solid-bottom": "e905", + "@font-solid-right": "e906", + "@font-dot": "e762", + "@font-down-triangle": "e70b" +} diff --git a/packages/fineui/lessconfig/jsy.lessconfig.json b/packages/fineui/lessconfig/jsy.lessconfig.json new file mode 100644 index 000000000..9efbfa906 --- /dev/null +++ b/packages/fineui/lessconfig/jsy.lessconfig.json @@ -0,0 +1,21 @@ +{ + "@background-color-card-primary": "#003D4D", + "@color-primary": "#00acbe", + "font-color-normal": "#0d1540", + "font-color-light-gray": "#0d1540", + "font-color-disabled": "fade(#0d1540, 40)", + "font-color-light-disabled": "fade(#0d1540, 20)", + "font-color-success": "#28b668", + "font-color-negative": "#e65251", + "font-color-warning": "#faaa39", + "font-color-tips": "fade(#0d1540, 40)", + + "background-color-light-disabled": "fade(#0d1540, 5)", + "background-color-dark-success": "#28b668", + "background-color-negative": "#e65251", + "background-color-warning": "#faaa39", + + "border-color-disabled": "#e8eaed", + "border-color-success": "#28b668", + "border-color-negative": "#e65251" +} diff --git a/packages/fineui/lodash.md b/packages/fineui/lodash.md new file mode 100644 index 000000000..411585265 --- /dev/null +++ b/packages/fineui/lodash.md @@ -0,0 +1 @@ +lodash core plus="debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after,unescape,chunk,pick,pickBy,identity" diff --git a/packages/fineui/webpack.prod.js b/packages/fineui/webpack.prod.js index a3ea227d8..5c7cba53d 100644 --- a/packages/fineui/webpack.prod.js +++ b/packages/fineui/webpack.prod.js @@ -11,14 +11,26 @@ function git(command) { return childProcess.execSync(`git ${command}`).toString().trim(); } +let lessVariables = {}; + +if (process.env.LESS_CONFIG_PATH) { + const lessConfigPath = path.isAbsolute(process.env.LESS_CONFIG_PATH) + ? process.env.LESS_CONFIG_PATH + : path.resolve(__dirname, "lessconfig", process.env.LESS_CONFIG_PATH); + + lessVariables = fs.existsSync(lessConfigPath) ? require(lessConfigPath) || {} : {}; +} + module.exports = { mode: "production", - entry: "./src/bundle.js", + entry: { + "fineui.min": "./src/bundle.js", + }, output: { path: path.resolve(__dirname, "dist"), filename: "[name].js", }, - devtool: false, + devtool: "hidden-source-map", module: { rules: [ { @@ -48,7 +60,7 @@ module.exports = { loader: "less-loader", options: { relativeUrls: false, - // modifyVars: lessVariables, + modifyVars: lessVariables, }, }, ], @@ -61,9 +73,7 @@ module.exports = { "@": path.resolve(__dirname, "src"), }, }, - plugins: [ - new CircularDependencyPlugin(), - ], + plugins: [new CircularDependencyPlugin()], optimization: { usedExports: false, minimize: true,