You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
Closes#229.
The `bevy run web` command cannot just wrap `cargo run`, as we don't
want to run a native application, but run the code in the user's
browser.
Hence, we have to manually build with `cargo build` instead.
This causes quite a lot of code (also including calling `wasm-bindgen`)
to be duplicated between `bevy build web` and `bevy run web`.
To ensure consistency and aid development, the code should be shared
where possible.
This will enable us to build more complex features like #226.
# Solution
- Extract reusable part of `bevy build web` into dedicated function.
- Add a conversion from run args to build args.
- Call the `bevy build web` logic in `bevy run web` as well.
The functionality _should_ be equivalent.
In the future, we might refine how exactly the shared build function is
called.
For example, I assume that we will pass the binary targets we want to
build from the outside instead of determining it in the function itself,
that will enable us to implement changes like #200 and #230.
0 commit comments