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

Example with importing from published subdirectories: multi-entry support #299

Closed
arvigeus opened this issue Nov 4, 2019 · 9 comments · May be fixed by #535
Closed

Example with importing from published subdirectories: multi-entry support #299

arvigeus opened this issue Nov 4, 2019 · 9 comments · May be fixed by #535
Labels
solution: duplicate This issue or pull request already exists topic: multi-entry Related to multi-entry support topic: preserveModules Related to Rollup's preserveModules feature

Comments

@arvigeus
Copy link

arvigeus commented Nov 4, 2019

I want to be able to do this:

import { foo } from "foo";
import { bar } from "foo/bar"

Is this a bad practice? If not, can we have an example of how to do it in the docs?

@swyxio
Copy link
Collaborator

swyxio commented Nov 4, 2019

its fine, not bad practice. i’m just not sure we support it tbh.

@arvigeus
Copy link
Author

arvigeus commented Nov 4, 2019

According to this it is possible if you pass a json object as input. Will try it now.

@arvigeus
Copy link
Author

arvigeus commented Nov 4, 2019

Doesn't seem so...

@ryanditjia
Copy link

I used TSDX to make a lib for my commonly used hooks, mixins, React components, utils here:
https://github.com/ryanditjia/apostrof/tree/master/src

I’d like to be able to import from apostrof/hooks, apostrof/mixins, and so on. But it looks like I can’t use TSDX for this use case?

What other option do I have?

@arvigeus
Copy link
Author

Rollup support that. TSDX uses it under the hood.

@ryanditjia
Copy link

When I run yarn build, it generates empty bundles. Am I missing something in package.json?

@slikts
Copy link

slikts commented Dec 11, 2019

This is the same issue as #276.

Bundling libraries is ultimately a leftover from before automated dependency management or having an automated build step was the norm. A significant downside is that bundled sub-dependencies don't get deduplicated. It's a fairly large oversight in tsdx.

@arvigeus
Copy link
Author

I will close it now. Moving discussion to #276

@agilgur5 agilgur5 changed the title Example with subdirectories Example with importing from published subdirectories: multi-entry support Mar 9, 2020
@agilgur5 agilgur5 added the solution: duplicate This issue or pull request already exists label Mar 9, 2020
@agilgur5
Copy link
Collaborator

agilgur5 commented Mar 9, 2020

Actually seems like more of a duplicate of #175 & #365 , which are, to an extent, fixed by #367 .

#276 is very related tough, and fixed by #535

@agilgur5 agilgur5 added the topic: multi-entry Related to multi-entry support label Mar 10, 2020
@agilgur5 agilgur5 added the topic: preserveModules Related to Rollup's preserveModules feature label Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: duplicate This issue or pull request already exists topic: multi-entry Related to multi-entry support topic: preserveModules Related to Rollup's preserveModules feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants