joshwcomeau / use-sound

A React Hook for playing sound effects
MIT License
2.76k stars 98 forks source link

Fix path in conditional import for ESM #71

Closed blasterpistol closed 3 years ago

blasterpistol commented 3 years ago

There is no path like ./dist/use-sound.esm.mjs, only ./dist/use-sound.esm.js. It fixes build error Module not found: Error: Can't resolve 'use-sound' in bundlers such as Webpack.

joshwcomeau commented 3 years ago

Hm, I wonder if this is the type of thing that depends on the Node version or something 🤔 I remember seeing bits about .mjs for certain Node versions.

But yeah, when I build it locally, I get a .js, so I'll go with this for now