three-stdlib
three-stdlib copied to clipboard
Project doesn't use proper ESM & CJS file extensions
-
threeversion:0.140.0 -
@types/threeversion:0.139.0 -
three-stdlibversion:2.10.1
Problem description:
The currently used file extensions for ESM and CJS (.js for ESM and .cjs.js for CJS`) can cause problems in certain environments that rely on them (e.g. Nuxt3), because they are non-standard in Node.js.
Relevant code:
package.json
{
"main": "index.cjs.js",
"module": "index.js"
}
Suggested solution:
The file extensions should follow the Node.js convention to provide the best compatibility across all environments.
For example: .js for CJS and .mjs for ESM
I recommend reading up on the native ESM guide written by the creators of Nuxt3, especially the library author guide part should be of interest.