fix(webgl): strip the bundled native server from the WebGL build output#124
Merged
Conversation
On desktop the client launches a bundled native server for Singleplayer/Host, so a prior desktop build leaves StreamingAssets/server/ in the project. Unity copies the whole StreamingAssets folder into every build, so the ~70 MB Windows server (.exe + .pdb) was being baked into WebGL builds too. A browser can never run it (and it is not in the content manifest, so players never fetch it), but it bloats the web bundle and ships a stray platform binary. BuildScript.BuildWebGL now deletes <output>/StreamingAssets/server after the build. Only the build OUTPUT is touched; the source project keeps the bundled server so a later desktop Singleplayer build/run still finds it. CI builds were already clean (fresh checkout, no publish-local-server in the WebGL job); this hardens local builds. Re #121. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
A WebGL build was including the desktop bundled native server (
StreamingAssets/server/BlocksBeyondTheStars.GameServer.exe+.pdb, ~70 MB). Unity copies the wholeStreamingAssets/folder into every build, so if a prior desktop build leftStreamingAssets/server/in the project, it got baked into the WebGL bundle too.BuildScript.BuildWebGLnow deletes<output>/StreamingAssets/serverafter the build. Only the build output is touched; the source project keeps the bundled server so a later desktop Singleplayer build/run still finds it.Scope / impact
publish-local-server); this hardens local builds where a prior desktop build populatedStreamingAssets/server/.BuildScript.csis Unity editor code (not compiled by the .NET CI), so this is verified by inspection + a local WebGL build. The change uses only already-imported namespaces and is a guardedDirectory.Delete.Re #121.
🤖 Generated with Claude Code