-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Unused files published #53
Comments
I don't understand what the bug is. |
Take |
They're there due to a (expected) limitation in Rollup that only allows specifying a format per build rather than file.
There might be room for improvement to remove unused files in terms of publish size, but I think it will be very an insignificant improvement. AFAIK this isn't causing any bugs. |
Previously, I visit
|
That's expected behavior because in Node.js, export maps define what's possible to import. Not the distribution files. |
I understand this, but my point is these I can still hack to use absolute path to load require(path.resolve(require.resolve('tsx'), '../loader.cjs')) This will still throw because I agree
And we can have it, why not? Also, if you agree, I can raise a PR for it. |
Why are you trying to import loader.cjs? When bundling will Rollup, it will create "chunk files" for code shared across entry points. The dist directory is bound to have files that are not importable. This is a pkgroll concern so it should be fixed there. Any fix in tsx would be a duct-tape fix. I don't think this is easily fixable but sure. |
.cjs
files in dist
are not available in exports
Closing this because it would need to be fixed in https://github.com/privatenumber/pkgroll Please re-open an issue there @JounQin |
Bug description
.cjs
files should be defined inexports
, or remove them fromdist
And
@esbuild-kit/esm-loader
is ESM-only, so we should remove.cjs
files fromdist
Reproduction
https://unpkg.com/browse/tsx@3.6.0/package.json
Environment
Can you contribute a fix?
The text was updated successfully, but these errors were encountered: