Skip to main content

antd

Install#

$ npm install build-plugin-antd --save-dev

Options#

插件提供了按需加载和主题定制相关的配置参数:

  • themeConfig 设置替换主题颜色
  • importOptionsbabel-plugin-import 按需加载配置,默认参数 { libraryDirectory: 'es', style: true},根据用户设置进行合并

Usage#

{
"plugins": [
[
"build-plugin-antd",
{
"themeConfig": {
"primary-color": "#1DA57A"
}
}
]
]
}

使用 antd-mobile#

{
"plugins": [
[
"build-plugin-antd",
{
"themeConfig": {
"brand-primary": "#1DA57A"
},
"importOptions": {
"libraryName": "antd-mobile",
"libraryDirectory": "es",
"style": true
}
}
]
]
}