Skip to content

Commit 3c677bc

Browse files
committedApr 18, 2024··
fix: allow export conditions that resolve to .json
1 parent 4df8d48 commit 3c677bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/node/core/pkg/parseExports.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ export function parseExports(options: {
163163
}
164164

165165
for (const [exportPath, exportEntry] of Object.entries(pkg.exports)) {
166-
if (exportPath.endsWith('.json')) {
166+
if (
167+
exportPath.endsWith('.json') ||
168+
(typeof exportEntry === 'string' && exportEntry.endsWith('.json'))
169+
) {
167170
if (exportPath === './package.json') {
168171
if (exportEntry !== './package.json') {
169172
errors.push('package.json: `exports["./package.json"] must be "./package.json".')

0 commit comments

Comments
 (0)
Please sign in to comment.