Skip to content

template: define import.meta.main=false in bundle#31

Merged
julian-goldstein merged 1 commit into
masterfrom
bundle-stuff
Jul 1, 2026
Merged

template: define import.meta.main=false in bundle#31
julian-goldstein merged 1 commit into
masterfrom
bundle-stuff

Conversation

@julian-goldstein

Copy link
Copy Markdown
Contributor

Adds --define:import.meta.main=false to ESBUILD_FLAGS in template/Makefile.

esbuild substitutes import.meta.mainfalse at bundle time, so the if (import.meta.main) self-test blocks in probe modules get dead-code eliminated from src/index.jsx. Those blocks only ever run when a module is the direct yeet run entry; they're dormant once imported by main.jsx, and are now provably stripped from the bundle.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@julian-goldstein julian-goldstein merged commit 9d22218 into master Jul 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant