设置主题色
前期准备:
npm install babel-plugin-import --save-dev
npm install antd --save
1. webpack.config.theme.js中,设置主题色primary-color,并导出
module.exports={
"primary-color": "#0ba29a",
"link-color": "#0ba29a",
"border-radius-base": "2px",
}
2. 配置webpack打包规则
在webpack.config.development.js和webpack.config.production.js中同时设置
const modifyVars = require('./webpack.config.theme.js'); //引入主题色设置文件
{
test: /\.less$/,
use: [{
loader: MiniCssExtractPlugin.loader // creates style nodes from JS strings
}, {
loader: "css-loader", // translates CSS into CommonJS