planck.js icon indicating copy to clipboard operation
planck.js copied to clipboard

Testbed usage in webpack environment

Open MercurialUroboros opened this issue 3 years ago • 1 comments

Hi, I'm trying to use the testbed method within a webpack environment without luck.

I'm getting a main.ts?bc82:8 Uncaught TypeError: Object(...) is not a function I'm importing it like so: import { testbed, World, Vec2, Chain, Box, RevoluteJoint, Circle } from 'planck-js'

Any suggestion?

MercurialUroboros avatar Mar 01 '21 14:03 MercurialUroboros

testbed is not part of the main export, you can import it from testbed folder however:

import { testbed, World, Vec2, Chain, Box, RevoluteJoint, Circle } from 'planck-js/testbed';

shakiba avatar Mar 06 '21 22:03 shakiba

There is now a separate build file for testbed which could be used.

shakiba avatar Aug 23 '23 09:08 shakiba