Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --bundle option to web commands #195

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Add --bundle option to web commands #195

wants to merge 13 commits into from

Conversation

TimJentzsch
Copy link
Collaborator

@TimJentzsch TimJentzsch commented Dec 23, 2024

Objective

Closes #68.

Adds the --bundle argument to the bevy build web and bevy run web commands.
This will pack all files needed for the web into a single folder.
The location of the bundle will be target/bevy_web/{profile}/{binary}.

This makes it a lot easier to deploy the app e.g. on itch.io or a generic web server.
It also unblocks the switch from trunk to the Bevy CLI for the Bevy 2D template: TheBevyFlock/bevy_new_2d#312.

Solution

  • Add the --bundle option to the build and run web commands.
  • Create a new WebBundle enum, which can represent a linked or packed bundle:
    • A linked bundle is what we use by default, which is optimized for dev. It keeps e.g. the asset folder and WASM artifacts in their place to avoid duplication and copy operations. When running the app, the local web server will "link" together all the files and folders needed to run the app.
    • A packed bundle is a folder that contains all the necessary web artifacts. They will be copied in the directory. This option is most useful to deploy the web app.

@TimJentzsch TimJentzsch marked this pull request as ready for review December 23, 2024 14:18
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.

Add --bundle option to build/run web commands
1 participant