I'm using webpack + vue-loader to create vuejs app. I have multiple .vue
files for components. When I write something like this:
import _ from 'lodash'
inside the script
part of ComponentA.vue
and ComponentB.vue
, does this create two separate copies of lodash or does it simply import a reference?
lodash
points to the same module from both locations where you use it, then yes that module is only instantiated only once. – Chiles