Skip to content

Commit 134233f

Browse files
committed
feat(node): support single-file executables via bun build --compile
1 parent 49ff53c commit 134233f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cli/src/templates/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
const root = require("path").join(__dirname, "..", "..");
22

3-
module.exports = require("node-gyp-build")(root);
3+
module.exports =
4+
typeof process.versions.bun === "string"
5+
// Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time
6+
? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-typescript.node`)
7+
: require("node-gyp-build")(root);
48

59
try {
610
module.exports.nodeTypeInfo = require("../../src/node-types.json");

0 commit comments

Comments
 (0)