Conversation
maksimryndin
left a comment
There was a problem hiding this comment.
Let's not hurry up here, probably, we just need some time to properly figure out how to do it with trunk
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a39c5159b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| stage = "post_build" | ||
| command = "sh" | ||
| command_arguments = ["-c", """ | ||
| WASM_OPT="$HOME/.cache/trunk/wasm-opt-version_123/bin/wasm-opt" |
There was a problem hiding this comment.
Resolve wasm-opt path dynamically
The post-build hook hardcodes WASM_OPT to ~/.cache/trunk/wasm-opt-version_123/bin/wasm-opt, so any environment where Trunk downloads a different wasm-opt version (or stores cache under a different base path) will skip optimization entirely. Because this commit also sets data-wasm-opt="0" in app/index.html, those builds have no fallback optimization path and silently ship larger/slower WASM artifacts than intended.
Useful? React with 👍 / 👎.
Closes #48
Enables wasm-opt.
I couldn't fix it directly during crate compilation. It failed because I couldn't pass the required flags there.
So I had to use a
post-buildhook inTrunk.toml.In general, the build was reduced by 50Kb, and the times are very similar.