Clear and concise description of the problem
https://nodejs.org/api/packages.html#extensions-in-subpaths
That mentions import maps and adding .js extensions to your package exports. There currently is no config option to enable this in tsdown. I was able to add this myself by having a customExports callback:
exports: {
devExports: true,
customExports(exports) {
return Object.fromEntries(
Object.entries(exports).map(([key, value]) => {
if (key === '.' || /\.[^/]+$/.test(key)) {
return [key, value];
}
return [`${key}.js`, value];
})
);
}
},
Suggested solution
Please expand the exports config option to support this.
Alternative
Write your own customExports callback as shown above.
Additional context
No response
Validations
Clear and concise description of the problem
https://nodejs.org/api/packages.html#extensions-in-subpaths
That mentions import maps and adding
.jsextensions to your packageexports. There currently is no config option to enable this in tsdown. I was able to add this myself by having acustomExportscallback:Suggested solution
Please expand the
exportsconfig option to support this.Alternative
Write your own
customExportscallback as shown above.Additional context
No response
Validations