Skip to content

template: write the esbuild bundle to dist/index.jsx - #35

Open
julian-goldstein wants to merge 1 commit into
masterfrom
dist-output
Open

julian-goldstein wants to merge 1 commit into
masterfrom
dist-output

Conversation

@julian-goldstein

Copy link
Copy Markdown
Contributor

Summary

Move the esbuild output from src/index.jsx to dist/index.jsx and gitignore dist/ as a whole, so the generated bundle no longer sits inside the source tree.

  • The yeet entry ladder already checks dist/ before src/ (ENTRY_DIRS = ["dist", "src"], shipped in yeet v0.22.0), so yeet run . picks up the built bundle exactly as before.
  • make clean now removes dist/ instead of src/index.jsx.
  • template/.gitignore and the repo .gitignore ignore dist/ instead of the single file.
  • tsconfig.json drops the src/index.jsx exclude (dist was already excluded).
  • README updated to point at dist/index.jsx.

The BPF object stays in bin/. probe.js loads it as ../bin/probe.bpf.o relative to import.meta.dirname, which resolves to the same bin/ whether the running entry is src/main.jsx or dist/index.jsx.

Test plan

  • scripts/new a project, make bundle (with a local esbuild): output is dist/index.jsx, nothing written to src/
  • git status in the scaffolded project does not show dist/; git check-ignore -v dist/index.jsx matches the new rule
  • yeet run . on Linux picks dist/index.jsx and loads bin/probe.bpf.o

The bundle used to land in src/index.jsx, next to the sources it was built
from, and had to be gitignored by name. Move it to dist/, which the yeet
entry ladder already tries before src/ (dist/index.jsx wins over
src/main.jsx), and ignore the whole directory.

- Makefile: --outfile=dist/index.jsx; `make clean` drops dist/.
- .gitignore (template + repo): ignore dist/ instead of src/index.jsx.
- tsconfig: drop the now-redundant src/index.jsx exclude (dist is already
  excluded).
- README: point at dist/index.jsx and list dist/ in the layout.

The BPF object stays in bin/; probe.js resolves it as ../bin/probe.bpf.o
relative to import.meta.dirname, which works from both src/ and dist/.
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