Getting js within www/ to work

This commit is contained in:
Greg Shuflin 2024-01-09 19:43:11 -08:00
parent 75122749ad
commit 0a9d7e4076
5 changed files with 1952 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>Game of Life</title>
<script src="js/bootstrap.js"></script>
</head>
<body>
</body>
</html>

5
game-of-life/www/js/bootstrap.js vendored Normal file
View File

@ -0,0 +1,5 @@
// A dependency graph that contains any wasm must all be imported
// asynchronously. This `bootstrap.js` file does the single async import, so
// that no one else needs to worry about it again.
import("./main.js")
.catch(e => console.error("Error importing `main.js`:", e));

View File

@ -0,0 +1,4 @@
import * as wasm from "wasm-game-of-life";
console.log("Yolo");
wasm.greet();

View File

@ -0,0 +1,12 @@
{
"name": "game-of-life",
"version": "0.0.2",
"license": "Apache-2.0/MIT",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
},
"devDependencies": {
"parcel": "^2.11.0"
}
}

File diff suppressed because it is too large Load Diff