Skip to content

Commit f4d6cb6

Browse files
authored
Merge pull request #78 from takker99:cjs
feat: Support for Node.js commonjs module
2 parents 0840b18 + 950488d commit f4d6cb6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

deno.jsonc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"coverage": "deno test --allow-read=./ --parallel --shuffle --coverage && deno coverage --html",
88
"doc": "deno doc --html rest.ts userscript.ts websocket.ts",
99
"npm:build": "deno run -A scripts/build_npm.ts",
10-
"npm:check": "cd npm && npm publish --provenance --access=public --dry-run"
10+
"npm:check": {
11+
"command": "cd npm && npm publish --provenance --access=public --dry-run",
12+
"dependencies": [
13+
"npm:build"
14+
]
15+
}
1116
},
1217
"imports": {
1318
"@std/testing/types": "jsr:@std/testing@0/types",

scripts/build_npm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// <reference lib="deno.ns" />
12
import { build, emptyDir } from "@deno/dnt";
23

34
await emptyDir("./npm");
@@ -47,8 +48,7 @@ await build({
4748
},
4849
// Don't run type checking during build to avoid Node.js compatibility issues
4950
typeCheck: false,
50-
declaration: "separate",
51-
scriptModule: false,
51+
declaration: "inline",
5252
compilerOptions: {
5353
lib: ["ESNext", "DOM", "DOM.Iterable"],
5454
target: "ES2023",

0 commit comments

Comments
 (0)