Skip to content

Commit dd2df87

Browse files
kazuponcamc314
andauthored
fix(npm): export package.json for oxlint and oxfmt (#20784)
## related issue voidzero-dev/vite-plus#1162 (review) ## What's changing? Add `./package.json` to the `exports` field in both `npm/oxlint/package.json` and `npm/oxfmt/package.json` so that external tools (e.g. vite-plus) can resolve `package.json` via Node.js package exports. For oxfmt, an `exports` field was newly added with the `.` entry to preserve the existing main entry point, since Node.js restricts access to only explicitly exported paths when `exports` is present. Co-authored-by: Cameron <cameron.clark@hey.com>
1 parent 0f12bcd commit dd2df87

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

npm/oxfmt/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
"type": "module",
3535
"main": "dist/index.js",
3636
"types": "dist/index.d.ts",
37+
"exports": {
38+
".": {
39+
"types": "./dist/index.d.ts",
40+
"default": "./dist/index.js"
41+
},
42+
"./package.json": "./package.json"
43+
},
3744
"dependencies": {
3845
"tinypool": "2.1.0"
3946
},

npm/oxlint/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"./plugins-dev": {
4343
"types": "./dist/plugins-dev.d.ts",
4444
"default": "./dist/plugins-dev.js"
45-
}
45+
},
46+
"./package.json": "./package.json"
4647
},
4748
"peerDependencies": {
4849
"oxlint-tsgolint": ">=0.18.0"

0 commit comments

Comments
 (0)