Skip to content

Commit 7fc76a5

Browse files
authored
fix: use cjs for binary (#47)
1 parent eee9117 commit 7fc76a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

esbuild.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const require = topLevelCreateRequire(import.meta.url);
9292
// Bin builds:
9393
esbuild.build({
9494
entryPoints: ["src/bin/main.ts"],
95-
outfile: "dist/bin/codesandbox.js",
95+
outfile: "dist/bin/codesandbox.cjs",
9696
bundle: true,
9797
format: "cjs",
9898
platform: "node",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"repository": "git+https://github.com/codesandbox/codesandbox-sdk.git",
88
"type": "module",
99
"bin": {
10-
"csb": "dist/bin/codesandbox.js"
10+
"csb": "dist/bin/codesandbox.cjs"
1111
},
1212
"module": "./dist/esm/index.js",
1313
"main": "./dist/esm/index.js",
@@ -50,7 +50,7 @@
5050
},
5151
"types": "./dist/esm/index.d.ts",
5252
"scripts": {
53-
"build": "npm run clean && npm run build:esbuild && npm run build:cjs:types && npm run build:esm:types && chmod +x dist/bin/codesandbox.js",
53+
"build": "npm run clean && npm run build:esbuild && npm run build:cjs:types && npm run build:esm:types && chmod +x dist/bin/codesandbox.cjs",
5454
"build:cjs": "tsc -p ./tsconfig.build-cjs.json",
5555
"build:esm": "tsc -p ./tsconfig.build-esm.json",
5656
"build:esbuild": "node esbuild.cjs",

0 commit comments

Comments
 (0)