Skip to content

Commit

Permalink
build: export commonjs
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 28, 2023
1 parent deace11 commit 7a544b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
declaration: true,
rollup: { emitCJS: true },
entries: ["src/plugin", "src/tools"],
externals: ["unwasm", "rollup"],
});
22 changes: 17 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@
"exports": {
"./examples/*": "./examples/*",
"./plugin": {
"types": "./dist/plugin.d.mts",
"import": "./dist/plugin.mjs"
"import": {
"types": "./dist/plugin.d.mts",
"default": "./dist/plugin.mjs"
},
"require": {
"types": "./dist/plugin.d.ts",
"default": "./dist/plugin.cjs"
}
},
"./tools": {
"types": "./dist/tools.d.mts",
"import": "./dist/tools.mjs"
"import": {
"types": "./dist/tools.d.mts",
"default": "./dist/tools.mjs"
},
"require": {
"types": "./dist/tools.d.ts",
"default": "./dist/tools.cjs"
}
}
},
"files": [
Expand Down Expand Up @@ -58,4 +70,4 @@
"vitest": "^1.1.0"
},
"packageManager": "pnpm@8.12.1"
}
}

0 comments on commit 7a544b4

Please sign in to comment.