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
Original main
file included in published package when using publishConfig.main
#4195
Comments
pnpm version 6.10.0 can ignore index.ts. you can try it. |
Any update on this issue? |
…t specified in the 'files' entry
Just ran in to this a couple weeks ago |
Same issue with pnpm 8.12.1. Overriding the main field works as expected as far as the exported package.json. But original main file is included in the tar ball (and I'm also using a files property which theoretically should exclude it). Also tried explicitly adding to an .npmignore, but it still didn't do the trick. |
When using
publishConfig.main
, it is expected that the originalpackage.json#main
file not be included with the published package, but bothpackage.json#main
andpackage.json#publishConfig#main
are included in the final tarball.pnpm version: 6.24.4
Code to reproduce the issue:
Expected behavior:
Actual behavior:
Additional information:
npm-packlist
, as used here, includesmain
by default, so specifically ignoringindex.ts
in this example viapackage.json#files
(or.npmignore
) doesn't help.One approach may be to generate
publishManifest
before adding the packaged files to specifically enable filtering ofpackage.json#main
in cases where it is overridden bypackage.json#publishConfig#main
. I suspect, however, that replacingpackage.json
on disk with the generatedexportableManifest
before callingnpm-packlist
would also be an option, and may simplify additionalpublishConfig
edge-case handling.node -v
prints: v17.3.0The text was updated successfully, but these errors were encountered: