pnpm pack
includes the file listed in the main
key even when publishConfig.main
overrides that file and it is not included in files
#7518
Labels
Verify latest release
pnpm version
8.14.1
Which area(s) of pnpm are affected? (leave empty if unsure)
CLI
Link to the code that reproduces this issue or a replay of the bug
https://github.com/wymp/ts-simple-interfaces/tree/v0.7.2
Reproduction steps
pnpm i && cd libs/ts-simple-db-mysql/ && pnpm pack --pack-destination /tmp
cd /tmp && tar -xf wymp-* && cd package && ls
src/index.ts
is present. Note thatpackage.json
does NOT listsrc
under thefiles
key, and themain
key is now properly replaced with the correctdist/index.js
.main
key causing the problem, go back intots-simple-db-mysql
and change themain
key inpackage.json
to readdist/index.js
, then perform steps 2 and 3 again. Note there is no longer asrc/index.ts
file in the pack.Describe the Bug
When you list a file in the
main
key ofpackage.json
which you then replace during publish usingpublishConfig.main
, the file that's listed in the originalmain
key is included in the package, even though it's not supposed to be.Expected Behavior
The
src/index.ts
file should not be included in the package.Which Node.js version are you using?
20.11.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
Ubuntu 22.04.3 LTS
The text was updated successfully, but these errors were encountered: