This package shows how you could install box2d-wasm
into a modern webpage. This uses <script type="module" />
to consume the ES module distribution of Box2D.
Grab yourself a copy of this repository, install the demo's dependencies with npm:
git clone https://github.com/Birch-san/box2d-wasm.git
cd box2d-wasm/demo/modern
npm ci
Copy the ES module distribution of Box2D into the public
folder (where the demo will be served from), and rename the copied folder to Box2D
:
cp -R node_modules/box2d-wasm/dist/es public
mv public/es public/Box2D
Serve the web application:
npm start
Navigate to localhost:5000.