-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add CJS version #2
Comments
Per @denysovkos's PR #5 and this issue, I started thinking about the approach to support CJS. Here are some takeaways:
The approach I'm currently considering implementing:
Regardless, the decision won't affect #1. Thoughts @ai @denysovkos? |
Just to clarify, Node 10 dead doesn’t mean that you can return to ESM. CJS apps/libs can use ESM dependencies. ESM is like a virus :D. The single ESM dependency inside the dependency tree will force everyone up by the stack to move to ESM. This is why ESM transition will take a while. At least, year or two. |
(Just to explain the problems of ESM transition. Right now Jest has no ESM support with mocks. It means that some big apps just can’t move to ESM right now.) |
@alexeyraspopov I am totally fine with another branch for Maybe better to ship binary and avoid of all of this cjs vs esm vs whatever_else? |
Valid point, I'm experiencing quite a lot of trouble because of this. |
as said it might be a drastic change, my discord bot is fully CJS and cause |
@Nigelrex, I'll be publishing a fresh version soon. Just finished adding proper level of testing for both module types in #8 |
|
For PostCSS and Autoprefixer it is impossible to go to ESM-only mode in next 2 years.
Can you add CJS version? I prefer copy pasting with
export
replacement to have smallest npm package.Here is a way to switch between CJS and ESM in
package.json
: https://github.com/ai/nanocolors/blob/main/package.json#L24-L25 https://github.com/ai/nanocolors/blob/main/package.json#L26-L33The text was updated successfully, but these errors were encountered: