Skip to content

Commit 05a4a42

Browse files
committed
fix: update script and wasm fetch paths to be absolute
1 parent ccef642 commit 05a4a42

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/cli/generators.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ namespace webcc
10281028

10291029
void generate_html(const std::string &out_dir, const std::string &template_path)
10301030
{
1031-
const std::string script_tag = " <script src=\"app.js\"></script>";
1031+
const std::string script_tag = " <script src=\"/app.js\"></script>";
10321032
std::string html;
10331033

10341034
// Try to find a custom template

src/cli/js_templates.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ const run = async () => {
3535
3636
let mod;
3737
if (supportsStreaming()) {
38-
mod = await WebAssembly.instantiateStreaming(fetch('app.wasm'), imports);
38+
mod = await WebAssembly.instantiateStreaming(fetch('/app.wasm'), imports);
3939
} else {
40-
const response = await fetch('app.wasm');
40+
const response = await fetch('/app.wasm');
4141
const bytes = await response.arrayBuffer();
4242
mod = await WebAssembly.instantiate(bytes, imports);
4343
}

0 commit comments

Comments
 (0)