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..da0ee54b4 --- /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..272df52f5 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,8 @@ }, "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:prod": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack -p --progress --config=webpack/webpack.prod.js --mode production && npm run biCss && npm run jsyCss", + "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..0028f7a26 --- /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}.min`]: attachments.bundleCss, + }, + + output: { + path: dirs.DEST, + filename: "[name].js", + }, +});