Difference between “import { pick } from 'lodash';” and “import pick from 'lodash/pick';”
问题 What's the difference between import { pick } from 'lodash'; and import pick from 'lodash/pick'; (Note that it's 'lodash/pick' in the second one, not just 'lodash' .) How does do they each affect the bundle size? Do they import exactly the same parts of lodash ? Are they comparatively fast? 回答1: The lodash module is a roll-up module that imports and reexports from its various individual modules like lodash/pick . So: import { pick } from 'lodash'; loads the full lodash module and then only