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#201.
Allows users to quickly try out different configurations without
modifying `Cargo.toml`.
For us, it's most useful for finding the best default config for the web
profiles.
# Solution
Add support for `--config` argument for `bevy build` and `bevy run`,
analogue to the `cargo` counterpart.
This essentially allows you to modify the `Cargo.toml` without editing
the file, e.g. `--config "profile.web.debug=false"`.
We already exploit `cargo`'s `--config` arg to configure our default web
compilation profiles.
So we have to ensure that the user-provided args _overwrite_ our default
ones.
To do this, we change the default web profiles to be prepended to the
user-provided `--config` args, instead of converting them to `--config`
arguments directly.
Since `--config` is resolved left-to-right, the defaults will be
overwritten by the user.
# Testing
Try for example:
```
bevy build --config "profile.web.debug=false" --config 'profile.web.inherits= "release"' web
```
Now instead of
```
Finished `web` profile [unoptimized + debuginfo] target(s)
```
you should get
```
Finished `web` profile [optimized] target(s)
```
Debug info removed and optimizations enabled!
(Of course this can be done easier via `bevy build --release web`, but
like this it's easier to benchmark different compilation profiles to
choose the best default)
0 commit comments