use rapier compat

This commit is contained in:
“chrisshank” 2024-12-15 20:00:06 -08:00
parent 5c7b0723ed
commit 0c07abac02
4 changed files with 5 additions and 6 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -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",

View File

@ -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';

View File

@ -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: {