From 829544c0df137d968577972a798410164285612e Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 18 Jan 2022 13:41:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E5=8A=A0?= =?UTF-8?q?=E6=89=93bi=E5=92=8Cjsy=E8=A6=86=E7=9B=96less=E7=9A=84css?= =?UTF-8?q?=E7=9A=84=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi.lessconfig.json | 20 ++++++++++++++++++++ jsy.lessconfig.json | 13 +++++++++++++ package.json | 5 ++++- webpack/attachments.js | 13 +++++++++++++ webpack/webpack.css.js | 20 ++++++++++++++++++++ 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 bi.lessconfig.json create mode 100644 jsy.lessconfig.json create mode 100644 webpack/webpack.css.js diff --git a/bi.lessconfig.json b/bi.lessconfig.json new file mode 100644 index 000000000..34b9d6714 --- /dev/null +++ b/bi.lessconfig.json @@ -0,0 +1,20 @@ +{ + "@color-primary": "#2C60DB", + "@color-bi-green-100": "#3FC47B", + "@color-bi-light-blue-100": "#19B8EA", + "@color-bi-orange-100": "#FAAA39", + "@color-bi-red-100": "#E65251", + "@color-bi-black": "#000A19", + "@color-bi-light-gray": "#ECEEF3", + "@color-bi-light-gray-theme-dark": "#292F45", + "@color-bi-dim-gray": "#2E3A4D", + "@border-color-disabled": "#E7E8EB", + "@color-bi-sliver-theme-dark": "363E55", + + "@color-bi-background-active-radio": "transparent", + "@color-bi-background-active-radio-content": "#2C60DB", + "@color-bi-background-disabled-active-radio-content": "#D0D4DA", + "@color-bi-background-disabled-active-radio-content-theme-dark": "#606479", + "@color-bi-background-disabled-active-checkbox-content": "#D0D4DA", + "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479" +} diff --git a/jsy.lessconfig.json b/jsy.lessconfig.json new file mode 100644 index 000000000..1e365bfc3 --- /dev/null +++ b/jsy.lessconfig.json @@ -0,0 +1,13 @@ +{ + "font-color-normal": "#031b4e", + "font-color-highlight": "#305bd3", + "font-color-light-gray": "#0d1540", + "font-color-disabled": "fade(#031b4e, 40)", + "font-color-light-disabled": "fade(#0d1540, 20)", + + "background-color-highlight": "#305bd3", + "background-color-light-disabled": "fade(#0d1540, 5)", + + "border-color-highlight": "#305bd3", + "border-color-disabled": "#e8eaed" +} \ No newline at end of file diff --git a/package.json b/package.json index a965ba3d9..b8f3968e7 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "scripts": { "webpack:dev": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js -p --progress --host 0.0.0.0 --config=webpack/webpack.dev.js --mode development", "webpack:prod": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack -p --progress --config=webpack/webpack.prod.js --mode production", + "webpack:css": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack -p --progress --config=webpack/webpack.css.js --mode production", "start": "node server.js", "build": "npm run webpack:prod && tsc", "postbuild": "node ./lib/postbuild/postbuild.js", @@ -62,7 +63,9 @@ "dev": "npm run webpack:dev", "prepublishToPrivate": "npm run build && node ./lib/prepublish/prepublish.js", "publishToPrivate": "npm publish", - "postpublishToPrivate": " node ./lib/postpublish/postpublish.js" + "postpublishToPrivate": " node ./lib/postpublish/postpublish.js", + "biCss": "cross-env LESS_CONFIG_PATH=bi.lessconfig.json LESS_FILE_NAME=bi npm run webpack:css", + "jsyCss": "cross-env LESS_CONFIG_PATH=jsy.lessconfig.json LESS_FILE_NAME=jsy npm run webpack:css" }, "repository": { "type": "git", diff --git a/webpack/attachments.js b/webpack/attachments.js index df460167c..63a4521f2 100644 --- a/webpack/attachments.js +++ b/webpack/attachments.js @@ -77,6 +77,13 @@ const basicAttachmentMap = { ]), fix: [fixJs], fixProxy: [fixProxyJs], + less: sync([ + "src/less/core/**/*.less", + "src/less/theme/**/*.less", + "src/less/base/**/*.less", + "src/less/widget/**/*.less", + "src/less/component/**/*.less", + ]), }; const bundle = [].concat( @@ -93,6 +100,11 @@ const bundle = [].concat( basicAttachmentMap.ts, ); +const bundleCss = [].concat( + basicAttachmentMap.less, + sync(["public/less/app.less", "public/less/**/*.less"]), +); + const bundleModern = [].concat( sync(["src/less/modern.less"]), sync(["public/modern/app.less", "public/modern/**/*.less"]), @@ -226,4 +238,5 @@ module.exports = { coreJs: uniq(coreJs), resource: uniq((resource)), config: uniq(config), + bundleCss: uniq(bundleCss), }; diff --git a/webpack/webpack.css.js b/webpack/webpack.css.js new file mode 100644 index 000000000..5951cf09a --- /dev/null +++ b/webpack/webpack.css.js @@ -0,0 +1,20 @@ +const merge = require("webpack-merge"); + +const dirs = require("./dirs"); + +const common = require("./webpack.prod.js"); +common.entry = {}; + +const attachments = require("./attachments"); + +module.exports = merge.smart(common, { + mode: "production", + entry: { + [`2.0/${process.env.LESS_FILE_NAME}`]: attachments.bundleCss, + }, + + output: { + path: dirs.DEST, + filename: "[name].js", + }, +});