Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Move built components to the root of the module on pubshish #59

Open
narqo opened this issue Jun 7, 2016 · 2 comments
Open

Move built components to the root of the module on pubshish #59

narqo opened this issue Jun 7, 2016 · 2 comments

Comments

@narqo
Copy link
Owner

narqo commented Jun 7, 2016

Currently, one has to specify a rather long path to import a component, e.g. react-islands/components/Button. As we aren't going to add any other staff to the library except components, it's might be handy if the user could import modules in a more concise way:

import Button from 'react-islands/Button';

We might genereate an index.js that exports all modules as well,

import { Button, Checkbox } from 'react-islands';

but I'd prefer to not recommended this way of usage, as it led to bundling the whole library to the user's project, even if only some components were used.

/cc @vodkabears @pasaran

@vodkabears
Copy link
Collaborator

index.js is ok, if module bundler supports a tree-shaking.

I like the standart lib folder:
import Button from 'react-islands/lib/Button';

@narqo
Copy link
Owner Author

narqo commented Jun 9, 2016

JFI: index.js was added to v0.5.0.

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

No branches or pull requests

2 participants