KELEN / blog-comment

0 stars 0 forks source link

@svgr/rollup插件转换svg成组件,解决部分属性丢失? #170

Open KELEN opened 2 weeks ago

KELEN commented 2 weeks ago

https://www.kelen.cc/faq/svgr-rollup-plugin-attribute-missing

在 react 项目使用 svgr 来把 import 进来的 svg 转成 react 组件,但是用 rollup 配合 @svgr/rollup 插件打包后,发现 svg 的属性丢失了,比如 width、height、viewBox 等。