Getting js within www/ to work
This commit is contained in:
parent
75122749ad
commit
0a9d7e4076
10
game-of-life/www/index.html
Normal file
10
game-of-life/www/index.html
Normal 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
5
game-of-life/www/js/bootstrap.js
vendored
Normal 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));
|
4
game-of-life/www/js/main.js
Normal file
4
game-of-life/www/js/main.js
Normal file
@ -0,0 +1,4 @@
|
||||
import * as wasm from "wasm-game-of-life";
|
||||
|
||||
console.log("Yolo");
|
||||
wasm.greet();
|
12
game-of-life/www/package.json
Normal file
12
game-of-life/www/package.json
Normal 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"
|
||||
}
|
||||
}
|
1921
game-of-life/www/pnpm-lock.yaml
Normal file
1921
game-of-life/www/pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user