Within my project, I have developed numerous mixins. Currently, my approach involves importing all of these mixins in the 'mixins/index.js' file and then importing them as needed in various components or pages.
However, I am now questioning whether this method results in importing unnecessary mixins along with the ones I actually need.
For instance, if I have the following mixins created and imported in 'mixins/index.js':
import a from 'mixins/a.js'
import b from 'mixins/b.js'
import c from 'mixins/c.js'
import d from 'mixins/d.js'
import e from 'mixins/e.js'
export {
a,
b,
c,
d,
e
}
Now, let's say that in my 'x' component, I only require the 'a' mixin:
import { a } from 'mixins/index.js'
export default {
mixins: [a]
}
In this particular scenario, I specifically need the 'a' mixin for my 'x' component. However, since I am importing from 'mixins/index.js', where all mixins are statically imported, I am uncertain if unwanted mixins will also be loaded.