Closed guanpu closed 5 years ago
Are you using lodash-webpack-plugin?
Are you using lodash-webpack-plugin?
Yes, and the version I use is "^0.11.5"
You need to enable iteratee sorthands feature set in lodash-webpack-plugin
. It is expensive in terms of kB though so you might just drop the short hand for an explicit function (o) => o.id
.
lodash version: 4.17.11 babel-plugin-lodash version: ^3.3.4
the code below works fine when import complete lodash
but after using this plugin, and change code to:
it reports error:
I have to change the code to
to make it work.
I suppose it is related with the method of 'property' which have been tree-shaked by webpack in the second case. If it is still not clear to you, feel free to ping me to provide a minimal repo code.