Skip to content
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

CommonJS module system support #9

Closed
msipinski opened this issue Sep 22, 2021 · 1 comment
Closed

CommonJS module system support #9

msipinski opened this issue Sep 22, 2021 · 1 comment

Comments

@msipinski
Copy link
Contributor

Hi, I know that ECMAScript Modules are the future, but for now I have a problem using ESM packages in my Electron.js project. I think that having a "hybrid" package is better!

If my understanding is correct, we can extract the code from index.js to a new file index.cjs with a CJS style module.exports = and in index.js leave only a ESM style wrapper: import defaultShell from './index.cjs' and export default defaultShell.

@sindresorhus
Copy link
Owner

I don't plan to do a hybrid package. It comes with more problems than it solves. You can either stay on the previous version or use a bundler like Webpack.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants