-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi xiel,
woudl you consider adding "type"="module" to the package.json, seeing as ESM is pretty much the way forward for the JS ecosystem? I finally moved the dependency back to this package from our fork and ran into some issues with Vite and SSR today.
From the Node docs:
Node.js will treat the following as ES modules when passed to node as the initial input, or when referenced by import statements or import() expressions:
- Files with an .mjs extension.
- Files with a .js extension when the nearest parent package.json file contains a top-level "type" field with a value of "module".
The esm export of wheel-gestures uses .esm.js as its extension, which does not get picked up by node and results in vite thinking its a common js module when trying to build the server bundle.
You could either change the filename of the esm build to wheel-gestures.mjs or add "type"="module" to the package.json.
Thanks again for making the suggested changes with the exports field!