pmndrs / use-cannon

👋💣 physics based hooks for @react-three/fiber
https://cannon.pmnd.rs
2.78k stars 156 forks source link

Please provide missing `main` key in package.json #131

Closed darwin closed 3 years ago

darwin commented 3 years ago

I'm consuming this npm package in a clojurescript project. Currently our tooling does not recognise module in package.json. I had to fork your project and add a missing main key to make it work: https://github.com/darwin/use-cannon/commit/4ea063cfb42f21d25fd0fb42018a7da0d551eca8

Thanks!

stockhuman commented 3 years ago

Hey @darwin, using module vs main suggests ES import syntax over commonjs' require. You can see in the very first phrase of the output file that what this library builds is ESM all the way down. As such, adding main (presently a recognized property for modules exporting with cjs syntax compatible with Node) would imply something that simply isn't true. Module is non-standard, but so is import syntax.

See this discussion and this announcement on the subject. If you have more up-to-date information about this, do share. Good luck with your project!