Setup wasm config for Bevy app

This commit is contained in:
Danny McGee
2023-09-27 15:33:55 -04:00
parent f85ead10b0
commit 9482cfb794
4 changed files with 26 additions and 6 deletions
Generated
+1 -1
View File
@@ -1799,7 +1799,7 @@ dependencies = [
]
[[package]]
name = "hello_world"
name = "hello-world"
version = "0.1.0"
dependencies = [
"bevy",
+3
View File
@@ -4,6 +4,9 @@ members = [
"./hello-world"
]
[workspace.dependencies.bevy]
version = "0.11.2"
[profile.dev]
opt-level = 1
+11 -2
View File
@@ -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"
+11 -3
View File
@@ -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",