Add a bevy run command which conveniently runs your Bevy app.
It mostly wraps cargo run, but also provides a web sub command, which makes it a lot easier to target the browser.
This option will compile your app for WASM, create JS bindings, add an index.html file if you don't provide one yourself and serves the build locally to open it in your browser.
The default index.html file is mostly what we had in bevy_quickstart.
This is the last part of #24.
Closes #8.
Testing
Checkout the bevy-run branch.
Run cargo install --path . to install this version of the Bevy CLI.
Navigate to your Bevy app.
Run bevy run web.
Note that your app must be compatible with WASM. If you have features or profiles enabled by default which are not compatible with WASM, you need to disable them. E.g. bevy run --no-default-features web.
If you have a custom index.html configured for trunk, it might also not work out of the box. You can try removing the entire web folder to try the default setup.
Add a
bevy run
command which conveniently runs your Bevy app.It mostly wraps
cargo run
, but also provides aweb
sub command, which makes it a lot easier to target the browser.This option will compile your app for WASM, create JS bindings, add an
index.html
file if you don't provide one yourself and serves the build locally to open it in your browser. The defaultindex.html
file is mostly what we had inbevy_quickstart
.This is the last part of #24. Closes #8.
Testing
bevy-run
branch.cargo install --path .
to install this version of the Bevy CLI.bevy run web
.Note that your app must be compatible with WASM. If you have features or profiles enabled by default which are not compatible with WASM, you need to disable them. E.g.
bevy run --no-default-features web
. If you have a customindex.html
configured fortrunk
, it might also not work out of the box. You can try removing the entireweb
folder to try the default setup.A good example project is of course
bevy_new_2d
, which you can test on this branch: https://github.com/TheBevyFlock/bevy_new_2d/pull/312