fuluteam / antd-icon-reduce-plugin Goto Github PK
View Code? Open in Web Editor NEWantd图标库体积的优化插件
antd图标库体积的优化插件
vue.config配置如下:
chainWebpack: (config) => {
...
config.plugin('antdIconReducePlugin').use(
new AntdIconReducePlugin({
icons: ['download', { type: 'up', theme: 'outline' }, ...], // 自定义需要加入的图标,支持字符串和对象两种写法,默认为[]
development: false, // 是否在开发环境模式下运行,默认为true
iconFilePath: 'icon', // 指定图标收集文件保存的绝对路径,如果编译后的项目中图标有缺失,可以选择保存到本地,然后再次编译输出即可(该配置项只在mode=production下起作用)
}),
)
}
configureWebpack: config => {
...
config.module.rules.push({
test: /.js(x)?$/,
exclude: /node_modules/,
use: ["antd-icon-reduce-loader", "babel-loader"] // 请根据实际情况配置,这里只需要将项目源代码匹配给antd-icon-reduce-loader即可
})
}
报错
This dependency was not found:
- @ant-design/icons/lib/dist in ./node_modules/ant-design-vue/es/icon/index.js
To install it, you can run: npm install --save @ant-design/icons/lib/dist
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.