Skip to content

Commit

Permalink
Working but not generating in 'dist'
Browse files Browse the repository at this point in the history
  • Loading branch information
oceanbluesky committed Dec 14, 2024
1 parent 61386d5 commit 63b1eb1
Show file tree
Hide file tree
Showing 28 changed files with 656 additions and 733 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ serde = { version = "^1.0.216", features = ["derive"] }
serde_json = "^1.0"
stylist = "^0.13"

[build-dependencies]
dotenv = "^0.15" # Build dependency for environment variables

# Allow wasm-bindgen to update dynamically while staying within major version 0.2
wasm-bindgen = "^0.2.99"

Expand Down
1 change: 0 additions & 1 deletion Dioxus.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

# Dioxus.toml

[application]
output = "dist"
serve_dir = "dist"
21 changes: 21 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

// build.rs (used to create 'dist' directory)
use std::env;
use std::fs;
use std::path::Path;

fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
let target_dir = Path::new(&out_dir).join("../../dist");

// Create the dist directory if it doesn't exist
if !target_dir.exists() {
fs::create_dir_all(&target_dir).unwrap();
}

println!("cargo:rerun-if-changed=src");
println!("cargo:rerun-if-changed=Dioxus.toml");

println!("Running build.rs...");
println!("OUT_DIR: {}", out_dir);
}
Binary file removed dist/assets/dioxus/name_bg.wasm
Binary file not shown.
Binary file removed dist/assets/images/Signature_FF_Logo_200pxBlack.png
Binary file not shown.
Binary file removed dist/assets/images/ethics_diagram.png
Binary file not shown.
36 changes: 20 additions & 16 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@

<!-- dist/index.html -->

<!DOCTYPE html>
<html>
<head>
<head>
<title>Eric Machmer</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8" />
<link rel="preload" href="/./wasm/github_bio_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="preload" href="/./wasm/github_bio.js" as="script">
<link rel="stylesheet" href="/assets/styles/tailwind.css">
</head>
<body>
<div id="main"></div>
<script>
// We can't use a module script here because we need to start the script immediately when streaming
import("/./wasm/github_bio.js").then(
({ default: init }) => {
init("/./wasm/github_bio_bg.wasm").then((wasm) => {
if (wasm.__wbindgen_start == undefined) {
wasm.main();
}
});
}
);
</script>
</body>
</html>

</head>
<body>
<div id="main"></div>
<script type="module">
import init from "./assets/dioxus/name.js";
init("./assets/dioxus/name_bg.wasm").then(wasm => {
if (wasm.__wbindgen_start == undefined) {
wasm.main();
}
});
</script>
</body>
</html>
Loading

0 comments on commit 63b1eb1

Please sign in to comment.