zh-lx / pinyin-pro

中文转拼音、拼音音调、拼音声母、拼音韵母、多音字拼音、姓氏拼音、拼音匹配、中文分词
https://pinyin-pro.cn
MIT License
3.82k stars 332 forks source link

fix: 修复无法 tree-shake 的问题 #273

Closed yuzheng14 closed 1 month ago

yuzheng14 commented 1 month ago

PR 描述

即使不导入任何东西,也会打进来 300KB 左右(未开启 minify)的内容,例如:

import 'pinyin-pro'

经过 vite 打包后,会引进来大概 300 KB 左右的内容。增加 "sideEffects": false 后解决

zh-lx commented 1 month ago

Thanks for PR~