prograhammer/vue-library-template

Individual imports for every component?

afontcu opened this issue · 0 comments

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:

captura de pantalla 2017-08-30 a les 1 05 50

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!