piqnt / planck.js

2D JavaScript Physics Engine
http://piqnt.com/planck.js/
MIT License
4.9k stars 236 forks source link

dist folder missing in npm package... #16

Closed michahell closed 7 years ago

michahell commented 7 years ago

as title says. I see the /dist folder here on GH, but not if I npm install.

shakiba commented 7 years ago

Yes, but those files do not export anything. Are they usable with npm?

michahell commented 7 years ago

ah, I c. I was wondering how to use planck in a project. Is the recommended way to import only required modules? if so, is there an example MWE to get started ? the testbed plunker seems to include just one big testbed js file.

shakiba commented 7 years ago

planck-with-testbed.js includes a renderer, it is very helpful for development or getting started, but I do not recommend it for production. You could reference the build file in your html page (as explained on readme page) or use var planck = require('planck-js/testbed'); with node/npm.

For production, I recommend integrating it with the rendering/ui library you would like to use (also explained on readme page). You could directly include the build files (without testbed) in your html or use var planck = require('planck-js'); with node/npm.

michahell commented 7 years ago

Thanks! I chose to copy planck.min.js from the dist folder into my project as I don't want to complicate a simple test case with a full module loader / bundler for now.

shakiba commented 7 years ago

You are welcome! It is also published to bower if you use it.