Skip to content

Commit 7be6bad

Browse files
lishaducksxzz
andauthored
feat(exports)!: only auto-fill types when exports.legacy (#685)
Co-authored-by: Kevin Deng <sxzz@sxzz.moe>
1 parent 53d3891 commit 7be6bad

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/features/pkg/exports.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ describe.concurrent('generateExports', () => {
391391
"main": undefined,
392392
"module": undefined,
393393
"publishExports": undefined,
394-
"types": "./index.d.ts",
394+
"types": undefined,
395395
}
396396
`)
397397
})

src/features/pkg/exports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export async function generateExports(
258258
return {
259259
main: legacy ? main || module || pkg.main : undefined,
260260
module: legacy ? module || pkg.module : undefined,
261-
types: cjsTypes || esmTypes || pkg.types,
261+
types: legacy ? cjsTypes || esmTypes || pkg.types : pkg.types,
262262
exports,
263263
publishExports,
264264
}

0 commit comments

Comments
 (0)