Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wangzishengwzs opened this issue Dec 12, 2020 · 3 comments
Closed

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

wangzishengwzs opened this issue Dec 12, 2020 · 3 comments

Comments

@wangzishengwzs
Copy link

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

@xmflswood
Copy link
Owner

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

@wangzishengwzs
Copy link
Author

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

@xmflswood
Copy link
Owner

xmflswood commented Dec 12, 2020

@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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants