Skip to content

Commit 5801d10

Browse files
committed
update classic demo to work with v5.0.1. that was horrid.
1 parent 4ec8c75 commit 5801d10

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

demo/classic/.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/node_modules/
2-
/public/Box2D.js
3-
/public/Box2D.wasm
2+
/public/wasm-feature-detect.js
3+
/public/entry.js
4+
/public/build/

demo/classic/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ This package shows how you could install `box2d-wasm` into a webpage, using old-
66

77
## Setup
88

9-
Grab yourself a copy of this repository, install the demo's dependencies with npm, and copy `Box2D.js` & `Box2D.wasm` into `public`, where the demo will be served from:
9+
Grab yourself a copy of this repository, install the demo's dependencies with npm, and copy the following files into `public`, where the demo will be served from:
1010

1111
```bash
1212
git clone https://github.com/Birch-san/box2d-wasm.git
1313
cd box2d-wasm/demo/classic
1414
npm ci
15-
cp node_modules/box2d-wasm/build/umd/Box2D.{js,wasm} public
15+
mkdir -p public/build/flavour/{simd,standard}/umd
16+
cp node_modules/wasm-feature-detect/dist/umd/index.js public/wasm-feature-detect.js
17+
cp node_modules/box2d-wasm/entry/umd/entry.js public
18+
cp node_modules/box2d-wasm/build/flavour/simd/umd/Box2D.simd.{js,wasm} public/build/flavour/simd/umd
19+
cp node_modules/box2d-wasm/build/flavour/standard/umd/Box2D.{js,wasm} public/build/flavour/standard/umd
1620
```
1721

1822
## Run

demo/classic/package-lock.json

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/classic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"sirv-cli": "^1.0.0"
1010
},
1111
"dependencies": {
12-
"box2d-wasm": "4.0.0"
12+
"box2d-wasm": "5.0.1"
1313
}
1414
}

demo/classic/public/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
}
1717
</style>
1818

19-
<script src='Box2D.js'></script>
19+
<script src='wasm-feature-detect.js'></script>
20+
<script src='entry.js'></script>
2021
<script src='demo.js'></script>
2122
</head>
2223

0 commit comments

Comments
 (0)