1.3.15
window10,chrome76,vue2.6.10
按需加载antd组件,页面有且仅引入一个button组件。
在没有使用icon组件的时候,可不可以把icon图标库不打包到项目里,实在太大了。QAQ
为什么会把icon所有图标给全部打包?
暂时不可以,
可以关注下这个 https://github.com/ant-design/ant-design-icons/issues/104 已经在优化中了
同求按需加载,或者给一个选项把icon去掉,打包以后文件太大了。。。
还没解决么?
@panpanpandas @zfha
https://github.com/vueComponent/pro-layout/blob/master/examples/src/core/antd/icons.js
https://github.com/vueComponent/pro-layout/blob/master/examples/vue.config.js#L39-L43
另外 有疑问请开新 issue。在已关闭的 issue 中继续回复可能会得到不到反馈
@sendya 您好,我并不需要引入icon,我只是引入了button就出现了上面的问题。
@sendya 您好,我并不需要引入icon,我只是引入了button就出现了上面的问题。
我给你的是目前的解决方案**。 引入 button 必定会引入 icon,这在目前是无法解决的,从设计上就是如此。因为 button 有 icon 属性,用到了 icon 组件
@ 你好
@panpanpandas @zfha
https://github.com/vueComponent/pro-layout/blob/master/examples/src/core/antd/icons.js
https://github.com/vueComponent/pro-layout/blob/master/examples/vue.config.js#L39-L43另外 有疑问请开新 issue。在已关闭的 issue 中继续回复可能会得到不到反馈
你好 我按照你这么配置在开发环境能够正常启动,但是打包时就报错了,报错如图 ! 是这么配置过后不能用别名了吗?

Most helpful comment
@panpanpandas @zfha
https://github.com/vueComponent/pro-layout/blob/master/examples/src/core/antd/icons.js
https://github.com/vueComponent/pro-layout/blob/master/examples/vue.config.js#L39-L43
另外 有疑问请开新 issue。在已关闭的 issue 中继续回复可能会得到不到反馈