Skip to content

Commit d708f2b

Browse files
committed
build!: esm-only dist
1 parent 0764410 commit d708f2b

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

build.config.ts

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

34
export default defineBuildConfig({
4-
declaration: true,
5-
rollup: {
6-
emitCJS: true,
5+
hooks: {
6+
async "build:done"() {
7+
await rm("dist/index.d.ts");
8+
await rm("dist/cli.d.ts");
9+
await rm("dist/cli.d.mts");
10+
},
711
},
8-
entries: [
9-
'src/index.ts',
10-
'src/cli.ts',
11-
],
12-
})
12+
});

package.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,11 @@
88
"type": "module",
99
"exports": {
1010
".": {
11-
"import": {
12-
"types": "./dist/index.d.mts",
13-
"default": "./dist/index.mjs"
14-
},
15-
"require": {
16-
"types": "./dist/index.d.cts",
17-
"default": "./dist/index.cjs"
18-
}
11+
"types": "./dist/index.d.mts",
12+
"default": "./dist/index.mjs"
1913
}
2014
},
21-
"main": "./dist/index.cjs",
22-
"module": "./dist/index.mjs",
23-
"types": "./dist/index.d.ts",
15+
"types": "./dist/index.d.mts",
2416
"bin": {
2517
"giget": "./dist/cli.mjs"
2618
},

0 commit comments

Comments
 (0)