cherry-pick
cherry-pick copied to clipboard
Allow for nested files.
I had the same issue as was reported in #8. The changes in this commit allow for packages with a nested structure more than one level deep. That is, this will allow users to create a package where you can, for example, do the following import:
import bar from 'my-package/foo/bar';
Please let me know if there is anything you'd like to see changed in the code. Thanks!
I know that this might be a big ask - but could we add a simple test suite here? Quite frankly, I'm not using this package anymore - so it's hard to review this PR based on the code alone. I would feel much more comfortable if there would be some tests covering for this change as we could ensure that there won't be any regressions in the future.
I can look into that, but it will probably take me a while to get around to it.
As a side note, instead of using this package are you using some other set of tools to arrive at a similar effect for packages? I'm not stuck on this package -- it solved the problem I had (aside from this small change) but I could go another way.
I can really recommend using https://github.com/preconstruct/preconstruct/ . You can define extra entrypoints with it like this: https://github.com/statelyai/xstate/blob/dc3eba3a9b9db62a5a5ee2b1f5e878cc64f166fa/packages/core/package.json#L52-L61