Skip to content

Commit 205c0cf

Browse files
committed
build: update build target to node
1 parent abf7240 commit 205c0cf

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

build.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ await Bun.build({
77
minify: true,
88
splitting: false,
99
sourcemap: "external",
10-
target: "bun",
10+
target: "node", // or 'bun', 'browser'
1111
plugins: [dts()],
1212
}).catch(console.error);
13+
14+
// shebang process
15+
async function shebangProcess(filePath, shebang) {
16+
const originalContent = await Bun.file(filePath).text();
17+
const contentWithShebang = `${shebang}\n${originalContent}`;
18+
await Bun.write(filePath, contentWithShebang);
19+
}
20+
21+
shebangProcess("./dist/index.js", "#!/usr/bin/env node");

0 commit comments

Comments
 (0)