-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The esm files inside dist/es6
folder should end with .mjs
#178
Comments
dist/es6
folder should end with .mjs
dist/es6
folder should end with .mjs
maybe better add |
Hi Viceice, Thank you for sharing your concern with us. We've carefully considered your feedback regarding the file extensions within the dist/es6 folder. Based on your concern, we'd like to provide some insight into our implementation approach. Our components are designed to support multiple targets, accommodating both ES5 and ES6 specifications. After careful consideration, when changing the module's extension to (.mjs), we may face potential compatibility issues that arise with older versions of Node.js. Specifically, Node.js version 11 and earlier may encounter challenges with the use of ES6 modules (.mjs files). In such cases, adhering to CommonJS modules (.js files) is the best way for us to provide optimal stability and compatibility for our packages across different specifications. Please feel free to reach out if you have any further concerns. Best regards, |
ok, alternatively add a { "type": "module" } this will inform newer nodejs versions that those files are esm instead of commonjs files |
Hi Viceice, Thank you for getting back to us. We appreciate your suggestion regarding adding { "type": "module" } to the package.json file in the es6 folder to indicate that the files are ECMAScript Modules (ESM). We value your input. However, we need to consider potential compatibility issues with our packages in older versions of Node.js, particularly versions 11 and earlier. Before Node.js version 12, full support for ECMAScript Modules (ESM) was not available. While Node.js 12 introduced experimental support for ESM, it only became fully stable in Node.js 13 and later versions. Older versions of Node.js may not properly interpret the type: "module" declaration in the package.json and could encounter issues when executing the ES modules. Given that our components need to support a wide range of Node.js versions, including older ones, it's crucial for us to consider the potential impact of using ECMAScript Modules (ESM) across different environments. If you have any further concerns or questions, please don't hesitate to reach out to us. We're here to help! Best regards, |
this won't break old nodejs, because they simply ignore the additional package.json |
The esm files inside
dist/es6
folder should end with.mjs
, otherwise those files are not correctly resolved by test runner, because they assumecjs
by default.Alternate is to add a simple
package.json
:so nodejs based resolvers know that those files are esm.
The text was updated successfully, but these errors were encountered: