Skip to content

Commit 614b735

Browse files
authored
Fix CommonJS target (#300)
1 parent fcd7154 commit 614b735

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "surrealdb.js",
3-
"version": "1.0.0-beta.11",
3+
"version": "1.0.0-beta.12",
44
"type": "module",
55
"license": "Apache-2.0",
66
"repository": {
@@ -39,15 +39,15 @@
3939
"engines": {
4040
"node": ">=18.0.0"
4141
},
42-
"browser": "./dist/esm.bundled.js",
43-
"types": "./dist/types.d.ts",
44-
"main": "./dist/esm.js",
42+
"browser": "./dist/index.bundled.mjs",
43+
"types": "./dist/index.d.ts",
44+
"main": "./dist/index.mjs",
4545
"exports": {
4646
".": {
47-
"require": "./dist/cjs.js",
48-
"import": "./dist/esm.js",
49-
"types": "./dist/types.d.ts",
50-
"browser": "./dist/esm.bundled.js"
47+
"require": "./dist/index.cjs",
48+
"import": "./dist/index.mjs",
49+
"types": "./dist/index.d.ts",
50+
"browser": "./dist/index.bundled.mjs"
5151
}
5252
},
5353
"files": ["dist", "README.md", "LICENCE", "SECURITY.md"]

scripts/build.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ await Promise.all([
55
esbuild.build({
66
entryPoints: ["src/index.ts"],
77
bundle: true,
8-
outfile: "dist/esm.js",
8+
outfile: "dist/index.mjs",
99
plugins: [tscPlugin({ force: true })],
1010
external: ["uuidv7", "isows"],
1111
format: "esm",
@@ -15,7 +15,7 @@ await Promise.all([
1515
esbuild.build({
1616
entryPoints: ["src/index.ts"],
1717
bundle: true,
18-
outfile: "dist/cjs.js",
18+
outfile: "dist/index.cjs",
1919
plugins: [tscPlugin({ force: true })],
2020
external: ["uuidv7", "isows"],
2121
format: "cjs",
@@ -25,7 +25,7 @@ await Promise.all([
2525
esbuild.build({
2626
entryPoints: ["src/index.ts"],
2727
bundle: true,
28-
outfile: "dist/esm.bundled.js",
28+
outfile: "dist/index.bundled.mjs",
2929
plugins: [tscPlugin({ force: true })],
3030
format: "esm",
3131
minifyWhitespace: true,
@@ -37,7 +37,7 @@ Bun.spawn([
3737
"bunx",
3838
"dts-bundle-generator",
3939
"-o",
40-
"dist/types.d.ts",
40+
"dist/index.d.ts",
4141
"src/index.ts",
4242
"--no-check",
4343
"--export-referenced-types",

0 commit comments

Comments
 (0)