diff --git a/Cargo.lock b/Cargo.lock index ff4fbdf..adf75f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1799,7 +1799,7 @@ dependencies = [ ] [[package]] -name = "hello_world" +name = "hello-world" version = "0.1.0" dependencies = [ "bevy", diff --git a/Cargo.toml b/Cargo.toml index f04766a..5113a52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,9 @@ members = [ "./hello-world" ] +[workspace.dependencies.bevy] +version = "0.11.2" + [profile.dev] opt-level = 1 diff --git a/hello-world/Cargo.toml b/hello-world/Cargo.toml index ad6ba50..ba775ee 100644 --- a/hello-world/Cargo.toml +++ b/hello-world/Cargo.toml @@ -1,9 +1,18 @@ [package] -name = "hello_world" +name = "hello-world" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.11.2", features = ["dynamic_linking"] } +bevy = { workspace = true } + +[target.'cfg(not(target_family = "wasm"))'.dependencies.bevy] +workspace = true +features = ["dynamic_linking"] + +# FIXME: Profiles for the non-root package are ignored, but [target] keys are +# not allowed in the root package >_< +# [target.'cfg(target_family = "wasm")'.profile.release] +# opt-level = "z" diff --git a/hello-world/project.json b/hello-world/project.json index d91b738..2b4b00a 100644 --- a/hello-world/project.json +++ b/hello-world/project.json @@ -1,5 +1,5 @@ { - "name": "hello_world", + "name": "hello-world", "$schema": "../node_modules/nx/schemas/project-schema.json", "projectType": "application", "sourceRoot": "./hello-world/src", @@ -12,11 +12,19 @@ "configurations": { "production": { "release": true + }, + "web": { + "release": true, + "target": "wasm32-unknown-unknown" } } }, - "launch": { - "executor": "@nxrs" + "run": { + "executor": "@nxrs/cargo:build", + "options": { + "release": false, + "run": true + } }, "test": { "executor": "@nxrs/cargo:test",