Skip to content

Commit d6fd8d4

Browse files
committed
build: esm-only
1 parent 80afdee commit d6fd8d4

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

build.config.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { defineBuildConfig } from "unbuild";
2+
import { rm } from "node:fs/promises";
23

34
export default defineBuildConfig({
4-
externals: [
5+
externals: [
56
"typescript"
6-
]
7+
],
8+
hooks: {
9+
async "build:done"() {
10+
await rm("dist/index.d.ts");
11+
},
12+
},
713
});

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
"version": "1.3.1",
44
"description": "Node.js utilities and TypeScript definitions for `package.json` and `tsconfig.json`",
55
"license": "MIT",
6-
"main": "./dist/index.cjs",
76
"sideEffects": false,
87
"exports": {
9-
"types": "./dist/index.d.ts",
10-
"import": "./dist/index.mjs",
11-
"require": "./dist/index.cjs"
8+
"types": "./dist/index.d.mts",
9+
"default": "./dist/index.mjs"
1210
},
13-
"types": "./dist/index.d.ts",
11+
"types": "./dist/index.d.mts",
1412
"repository": "unjs/pkg-types",
1513
"files": [
1614
"dist"

0 commit comments

Comments
 (0)