Skip to content

Commit

Permalink
refactor: use index.node.ts for main build
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 10, 2023
1 parent 514f5b3 commit b92d23b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default defineBuildConfig({
},
hooks: {
"rollup:options"(_, options) {
for (const output of options.output) {
for (const output of options.output as any[]) {
// @ts-ignore
output.exports = "named";
}
Expand Down
2 changes: 1 addition & 1 deletion lib/index.cjs → lib/index.node.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const lib = require("../dist/index.cjs");
const lib = require("../dist/index.node.cjs");

module.exports = lib.consola;

Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@
"exports": {
".": {
"node": {
"types": "./dist/index.d.ts",
"require": "./lib/index.cjs",
"import": "./dist/index.mjs"
"types": "./dist/index.node.d.ts",
"require": "./lib/index.node.cjs",
"import": "./dist/index.node.mjs"
},
"default": {
"types": "./dist/index.browser.d.ts",
"import": "./dist/index.browser.mjs"
}
}
},
"main": "./lib/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"main": "./lib/index.node.cjs",
"module": "./dist/index.node.mjs",
"types": "./dist/index.node.d.ts",
"files": [
"dist",
"lib",
"types"
"lib"
],
"scripts": {
"build": "unbuild",
Expand Down Expand Up @@ -68,4 +67,4 @@
"winston": "^3.8.2"
},
"packageManager": "pnpm@8.1.1"
}
}
File renamed without changes.

0 comments on commit b92d23b

Please sign in to comment.