Skip to content

Commit b92d23b

Browse files
committed
refactor: use index.node.ts for main build
1 parent 514f5b3 commit b92d23b

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

build.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineBuildConfig({
66
},
77
hooks: {
88
"rollup:options"(_, options) {
9-
for (const output of options.output) {
9+
for (const output of options.output as any[]) {
1010
// @ts-ignore
1111
output.exports = "named";
1212
}

lib/index.cjs renamed to lib/index.node.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const lib = require("../dist/index.cjs");
1+
const lib = require("../dist/index.node.cjs");
22

33
module.exports = lib.consola;
44

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,22 @@
1818
"exports": {
1919
".": {
2020
"node": {
21-
"types": "./dist/index.d.ts",
22-
"require": "./lib/index.cjs",
23-
"import": "./dist/index.mjs"
21+
"types": "./dist/index.node.d.ts",
22+
"require": "./lib/index.node.cjs",
23+
"import": "./dist/index.node.mjs"
2424
},
2525
"default": {
2626
"types": "./dist/index.browser.d.ts",
2727
"import": "./dist/index.browser.mjs"
2828
}
2929
}
3030
},
31-
"main": "./lib/index.cjs",
32-
"module": "./dist/index.mjs",
33-
"types": "./dist/index.d.ts",
31+
"main": "./lib/index.node.cjs",
32+
"module": "./dist/index.node.mjs",
33+
"types": "./dist/index.node.d.ts",
3434
"files": [
3535
"dist",
36-
"lib",
37-
"types"
36+
"lib"
3837
],
3938
"scripts": {
4039
"build": "unbuild",
@@ -68,4 +67,4 @@
6867
"winston": "^3.8.2"
6968
},
7069
"packageManager": "pnpm@8.1.1"
71-
}
70+
}
File renamed without changes.

0 commit comments

Comments
 (0)