Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Individual imports for every component? #4

Open
afontcu opened this issue Aug 30, 2017 · 0 comments
Open

Individual imports for every component? #4

afontcu opened this issue Aug 30, 2017 · 0 comments

Comments

@afontcu
Copy link

afontcu commented Aug 30, 2017

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant