xmflswood/pinyin-match

突然的更新代码整崩了啊!

wangzishengwzs opened this issue · 3 comments

原来pinyin.match(),现在pinyin.default.match()

@lovebigbird 你是怎么引入的
环境是什么

react项目,npm引入1.1.7版本.现在需要这样使用const pinyin = require('pinyin-match');pinyin.default.match()

@lovebigbird
采用import
如果非要使用require 可以使用
或者 const pinyin = require('pinyin-match/lib/man.js') 或者 const pinyin = require('pinyin-match').default

webpack/webpack#4742 (comment)

"always prefer import nowadays. Only use require if the package is not an ES Module."