Repository navigation
|
When I enable the auto exports feature, my exports look like this: "exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
+ "./package.json": "./package.json"
},Why does tsdown add the |
Replies: 2 comments
|
I think I have figured it out. https://nodejs.org/api/packages.html#package-entry-points:
I assume that it is because of backwards compatibility that this field is added? I think it would be helpful if this was documented on https://tsdown.dev/options/package-exports as for legacy reasons? |
|
Yes, exactly. Compatibility is one reason. Also, I think This is controlled by If you don’t need it, you can disable this option. |
Yes, exactly. Compatibility is one reason. Also, I think
package.jsoncontains basic package information, so it is reasonable to export it by default.This is controlled by
exports.packageJson, which defaults totrue:https://tsdown.dev/reference/api/Interface.ExportsOptions#packagejson
If you don’t need it, you can disable this option.