template: write the esbuild bundle to dist/index.jsx - #35
Open
julian-goldstein wants to merge 1 commit into
Open
julian-goldstein wants to merge 1 commit into
julian-goldstein wants to merge 1 commit into
Conversation
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/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move the esbuild output from
src/index.jsxtodist/index.jsxand gitignoredist/as a whole, so the generated bundle no longer sits inside the source tree.dist/beforesrc/(ENTRY_DIRS = ["dist", "src"], shipped in yeet v0.22.0), soyeet run .picks up the built bundle exactly as before.make cleannow removesdist/instead ofsrc/index.jsx.template/.gitignoreand the repo.gitignoreignoredist/instead of the single file.tsconfig.jsondrops thesrc/index.jsxexclude (distwas already excluded).dist/index.jsx.The BPF object stays in
bin/.probe.jsloads it as../bin/probe.bpf.orelative toimport.meta.dirname, which resolves to the samebin/whether the running entry issrc/main.jsxordist/index.jsx.Test plan
scripts/newa project,make bundle(with a local esbuild): output isdist/index.jsx, nothing written tosrc/git statusin the scaffolded project does not showdist/;git check-ignore -v dist/index.jsxmatches the new ruleyeet run .on Linux picksdist/index.jsxand loadsbin/probe.bpf.o