Webpack lodash is still as big as it is after loading settings on demand.

clipboard.png

clipboard.png

clipboard.png

clipboard.png

Mar.22,2021

essentially, you want to use Webpack's Tree Shaking feature. It's just that the posture of the dewdrop using lodash-webpack-plugin is a little incorrect.

if lodash-webpack-plugin is installed, you also need to install babel-plugin-lodash .

then you can configure it in the webpack configuration and use it accordingly:

  

the key is how you use lodash in your code

Menu