@@ -16,22 +16,23 @@ genrule(
1616 cmd = """
1717 set -euo pipefail
1818 # provide a writable home dir
19- export HOME=`pwd`
19+ export HOME="$$(pwd)/NOHOME"
20+ mkdir "$$HOME"
2021 # index.js should not be a symlink
2122 cat index.js > i.js && mv i.js index.js
22- NPM =$(location @nodejs //:bin/npm )
23- "$$NPM" ci
24- "$$NPM" exec -- @vercel/ncc build index.js -o $(RULEDIR)/generated --no-cache
23+ BUN =$(location @bun //:bin/bun )
24+ $$BUN install --no-save
25+ $$BUN build --target=node --outfile=$@ index.js
2526 """ ,
26- srcs = ["package.json" , "package-lock.json " , "index.js" ],
27+ srcs = ["package.json" , "bun.lockb " , "index.js" ],
2728 tags = ["requires-network" ],
28- tools = ["@nodejs//:bin/npm" ],
29- outs = ["generated/index.js " ],
29+ tools = ["@nodejs//:bin/npm" , "@bun//:bin/bun" ],
30+ outs = ["generated/bundle.mjs " ],
3031 visibility = ["//:__subpackages__" ],
3132)
3233
3334updatesrc_diff_and_update (
3435 name = "update" ,
35- srcs = ["dist/index.js " ],
36+ srcs = ["dist/bundle.mjs " ],
3637 outs = [":dist" ],
3738)
0 commit comments