vue-library-template
vue-library-template copied to clipboard
Individual imports for every component?
trafficstars
Hi,
Is there an easy way to create individual imports for every component in my library?
So instead of doing something like
import { someComp } from 'MyLibrary'
I'd like to do
import someComp from 'MyLibrary/someComp'
I guess the build output would look like something like this:
I already have a folder for each component with an index.js file that exposes it.
I think this would make the bundle size smaller since I won't be importing the whole library in a project where maybe I'd just need a couple of components.
I really don't get Webpack that much so I don't know if what I'm asking is a fairly easy issue or I'm just trying to reinvent the wheel here XD
thanks!