nodejieba (Chinese) is not working with webpack
Closed this issue · 1 comments
UMTERPS commented
When using webpack and lurn.zh, it will results in:
TypeError: nodejieba.cut is not a function
at lunr.Builder.lunr.zh.tokenizer (webpack://test/./node_modules/lunr-languages/lunr.zh.js?:92:17)
at lunr.Builder.add (webpack://test/./node_modules/lunr/lunr.js?:2479:23)
....
It seems that nodejieba is minimized by webpack and "cut" is no longer a valid function name.
I've tried:
optimization: {
minimize: false
}
But it didn't resolve the issue. Still trying to figure out a solution...
1921Aaron commented
May I ask how you solved it?