Browse Source

无JIRA任务 加打bi和jsy覆盖less的css的脚本

es6
windy 3 years ago
parent
commit
829544c0df
  1. 20
      bi.lessconfig.json
  2. 13
      jsy.lessconfig.json
  3. 5
      package.json
  4. 13
      webpack/attachments.js
  5. 20
      webpack/webpack.css.js

20
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"
}

13
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"
}

5
package.json

@ -55,6 +55,7 @@
"scripts": { "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: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",
"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", "start": "node server.js",
"build": "npm run webpack:prod && tsc", "build": "npm run webpack:prod && tsc",
"postbuild": "node ./lib/postbuild/postbuild.js", "postbuild": "node ./lib/postbuild/postbuild.js",
@ -62,7 +63,9 @@
"dev": "npm run webpack:dev", "dev": "npm run webpack:dev",
"prepublishToPrivate": "npm run build && node ./lib/prepublish/prepublish.js", "prepublishToPrivate": "npm run build && node ./lib/prepublish/prepublish.js",
"publishToPrivate": "npm publish", "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": { "repository": {
"type": "git", "type": "git",

13
webpack/attachments.js

@ -77,6 +77,13 @@ const basicAttachmentMap = {
]), ]),
fix: [fixJs], fix: [fixJs],
fixProxy: [fixProxyJs], 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( const bundle = [].concat(
@ -93,6 +100,11 @@ const bundle = [].concat(
basicAttachmentMap.ts, basicAttachmentMap.ts,
); );
const bundleCss = [].concat(
basicAttachmentMap.less,
sync(["public/less/app.less", "public/less/**/*.less"]),
);
const bundleModern = [].concat( const bundleModern = [].concat(
sync(["src/less/modern.less"]), sync(["src/less/modern.less"]),
sync(["public/modern/app.less", "public/modern/**/*.less"]), sync(["public/modern/app.less", "public/modern/**/*.less"]),
@ -226,4 +238,5 @@ module.exports = {
coreJs: uniq(coreJs), coreJs: uniq(coreJs),
resource: uniq((resource)), resource: uniq((resource)),
config: uniq(config), config: uniq(config),
bundleCss: uniq(bundleCss),
}; };

20
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",
},
});
Loading…
Cancel
Save