From 2def93b927cf6800a061524d1e0b219e94c160e7 Mon Sep 17 00:00:00 2001 From: Julian Goldstein Date: Wed, 1 Jul 2026 13:46:52 -0500 Subject: [PATCH] template: define import.meta.main=false in bundle Substitutes import.meta.main -> false at bundle time so the import.meta.main self-test blocks in probe modules get dead-code eliminated from src/index.jsx. They only run when a module is the direct `yeet run` entry, and are now provably stripped once bundled. Co-Authored-By: Claude Opus 4.8 --- template/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/template/Makefile b/template/Makefile index 59f0eac..9c96809 100644 --- a/template/Makefile +++ b/template/Makefile @@ -40,6 +40,7 @@ all: bpf bundle # manager of your choice — esbuild inlines whatever it finds there. ESBUILD_FLAGS := --bundle --format=esm --platform=neutral \ --main-fields=module,main --conditions=import,module \ + --define:import.meta.main=false \ --outfile=src/index.jsx --jsx=automatic --jsx-import-source=yeet:tui bundle: | toolchain