diff --git a/bun.lockb b/bun.lockb index 9fecbbe..0f5dc32 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 54d2d05..76fada5 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,11 @@ }, "dependencies": { "@babel/parser": "^7.26.2", - "@dimforge/rapier2d": "^0.14.0", + "@dimforge/rapier2d-compat": "^0.14.0", "@lit/reactive-element": "^2.0.4", "leaflet": "^1.9.4", "perfect-arrows": "^0.3.7", - "perfect-freehand": "^1.2.2", - "vite-plugin-wasm": "^3.3.0" + "perfect-freehand": "^1.2.2" }, "devDependencies": { "@types/leaflet": "^1.9.14", diff --git a/src/folk-physics.ts b/src/folk-physics.ts index 2786088..3fd0709 100644 --- a/src/folk-physics.ts +++ b/src/folk-physics.ts @@ -1,8 +1,9 @@ import { DOMRectTransform } from './common/DOMRectTransform.ts'; import { FolkBaseSet } from './folk-base-set.ts'; import { PropertyValues } from '@lit/reactive-element'; -import * as RAPIER from '@dimforge/rapier2d'; import { FolkShape } from './folk-shape'; +import RAPIER, { init } from '@dimforge/rapier2d-compat'; +await init(); export class FolkPhysics extends FolkBaseSet { static override tagName = 'folk-physics'; diff --git a/vite.config.ts b/vite.config.ts index be50083..321baf2 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,6 @@ import { resolve } from 'node:path'; import { readdirSync } from 'node:fs'; import { defineConfig, IndexHtmlTransformContext, Plugin } from 'vite'; -import vitePluginWasm from 'vite-plugin-wasm'; const demoDir = resolve(__dirname, 'demo'); @@ -66,7 +65,7 @@ const linkGenerator = (): Plugin => { export default defineConfig({ root: 'demo', - plugins: [linkGenerator(), vitePluginWasm()], + plugins: [linkGenerator()], build: { target: 'esnext', rollupOptions: {