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

Switch from trunk to bevy run web #312

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ opt-level = 3
[profile.dev.package.wgpu-types]
debug-assertions = false

# The default profile is optimized for Wasm builds because
# that's what [Trunk reads](https://github.com/trunk-rs/trunk/issues/605).
# Optimize for size in the wasm-release profile to reduce load times and bandwidth usage on web.
[profile.release]
# Optimize for size in web builds to reduce load times and bandwidth usage.
[profile.web-release]
inherits = "release"
# Compile the entire crate as one unit.
# Slows compile times, marginal improvements.
codegen-units = 1
Expand All @@ -77,12 +76,3 @@ lto = "thin"
opt-level = "s"
# Strip all debugging information from the binary to slightly reduce file size.
strip = "debuginfo"

# Override some settings for native builds.
[profile.release-native]
# Default to release profile values.
inherits = "release"
# Optimize with performance in mind.
opt-level = 3
# Keep debug information in the binary.
strip = "none"
16 changes: 3 additions & 13 deletions Cargo.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ opt-level = 3
[profile.dev.package.wgpu-types]
debug-assertions = false

# The default profile is optimized for Wasm builds because
# that's what [Trunk reads](https://github.com/trunk-rs/trunk/issues/605).
# Optimize for size in the wasm-release profile to reduce load times and bandwidth usage on web.
[profile.release]
# Optimize for size in web builds to reduce load times and bandwidth usage.
[profile.web]
inherits = "release"
# Compile the entire crate as one unit.
# Slows compile times, marginal improvements.
codegen-units = 1
Expand All @@ -77,12 +76,3 @@ lto = "thin"
opt-level = "s"
# Strip all debugging information from the binary to slightly reduce file size.
strip = "debuginfo"

# Override some settings for native builds.
[profile.release-native]
# Default to release profile values.
inherits = "release"
# Optimize with performance in mind.
opt-level = 3
# Keep debug information in the binary.
strip = "none"
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,20 @@ Feel free to move things around however you want, though.

## Run your game

We recommend running your game with the [Bevy CLI](https://github.com/TheBevyFlock/bevy_cli).

Running your game locally is very simple:

- Use `cargo run` to run a native dev build.
- Use [`trunk serve`](https://trunkrs.dev/) to run a web dev build.
- Use `bevy run` to run a native dev build.
- Use `bevy run --no-default-features web` to run a web dev build.

If you're using [VS Code](https://code.visualstudio.com/), this template comes with a [`.vscode/tasks.json`](./.vscode/tasks.json) file.

<details>
<summary>Run release builds</summary>

- Use `cargo run --profile release-native --no-default-features` to run a native release build.
- Use `trunk serve --release --no-default-features` to run a web release build.
- Use `bevy run --release --no-default-features` to run a native release build.
- Use `bevy run --profile web-release --no-default-features web` to run a web release build.

</details>

Expand Down
15 changes: 0 additions & 15 deletions Trunk.toml

This file was deleted.

1 change: 0 additions & 1 deletion post-generate.rhai
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Rename template files.
file::rename(".github/workflows/release.yaml.template", ".github/workflows/release.yaml");
file::rename("Cargo.toml.template", "Cargo.toml");
file::rename("web/index.html.template", "web/index.html");
file::rename("src/main.rs.template", "src/main.rs");
file::rename("src/lib.rs.template", "src/lib.rs");
file::rename("src/audio.rs.template", "src/audio.rs");
Expand Down
38 changes: 0 additions & 38 deletions web/index.html

This file was deleted.

41 changes: 0 additions & 41 deletions web/index.html.template

This file was deleted.

57 changes: 0 additions & 57 deletions web/restart-audio-context.js

This file was deleted.

56 changes: 0 additions & 56 deletions web/style.css

This file was deleted.