diff --git a/cli/src/templates/index.js b/cli/src/templates/index.js index 6657bcf4..a269e6da 100644 --- a/cli/src/templates/index.js +++ b/cli/src/templates/index.js @@ -1,6 +1,10 @@ const root = require("path").join(__dirname, "..", ".."); -module.exports = require("node-gyp-build")(root); +module.exports = + typeof process.versions.bun === "string" + // Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time + ? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-typescript.node`) + : require("node-gyp-build")(root); try { module.exports.nodeTypeInfo = require("../../src/node-types.json");