Allow relative assets in rust > 1.88 (#4658)

* Allow relative assets in rust > 1.88 and assets outside of the crate in
binary crates

* undo changes to assets outside of the crate

* don't use relative assets in examples
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-09-15 10:43:30 -07:00
1 parent 707bde2986
commit 5104644b34
10 files changed
+28 -14

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ mod bevy_scene_plugin;
mod demo_renderer;
// CSS Styles
static STYLES: Asset = asset!("./src/styles.css");
static STYLES: Asset = asset!("/src/styles.css");
type Color = OpaqueColor<Srgb>;
+1 -1
View File
@@ -10,7 +10,7 @@ fn app() -> Element {
let mut animated_classes = use_signal(|| ["animated-text", ""]);
rsx! {
document::Link { rel: "stylesheet", href: asset!("./examples/assets/visible.css") }
document::Link { rel: "stylesheet", href: asset!("/examples/assets/visible.css") }
div {
class: "container",
+1 -1
View File
@@ -11,7 +11,7 @@ use winit::window::WindowAttributes;
mod demo_renderer;
// CSS Styles
static STYLES: Asset = asset!("./src/styles.css");
static STYLES: Asset = asset!("/src/styles.css");
// WGPU settings required by this example
const FEATURES: Features = Features::PUSH_CONSTANTS;