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

Optimize dev experience for different targets #24

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
/wasm
21 changes: 17 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
[package]
name = "bevy_github_ci_template"
name = "bevy_template"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0 OR CC0-1.0"

[dependencies]
bevy = "0.14.0"

[target.'cfg(target_family = "wasm")'.dependencies]
wasm-bindgen = "0.2"

# The following block tweaks Bevy's features according to our build environment

[dev-dependencies.bevy]
version = "0.14.0"
features = ["dynamic_linking"]

[target.'cfg(not(target_family = "wasm"))'.dev-dependencies.bevy]
version = "0.14.0"
features = ["file_watcher", "embedded_watcher"]

# Compile with Performance Optimizations:
# https://bevyengine.org/learn/book/getting-started/setup/#compile-with-performance-optimizations

Expand All @@ -14,6 +30,3 @@ opt-level = 1
# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3

[dependencies]
bevy = "0.12"
12 changes: 7 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ use bevy::prelude::*;

fn main() {
App::new()
// Wasm builds will check for meta files (that don't exist) if this isn't set.
// This causes errors and even panics on web build on itch.
// See https://github.com/bevyengine/bevy_github_ci_template/issues/48.
.insert_resource(AssetMetaCheck::Never)
.add_plugins(DefaultPlugins)
.add_plugins(DefaultPlugins.set(AssetPlugin {
// Wasm builds will check for meta files (that don't exist) if this isn't set.
// This causes errors and even panics on web build on itch.
// See https://github.com/bevyengine/bevy_github_ci_template/issues/48.
meta_check: AssetMetaCheck::Never,
..default()
}))
.add_systems(Startup, setup)
.run();
}
Expand Down