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
ESM & CJS support for Rollup Plugin #451
Comments
The That is the only package that needs to be bundled as every other package is a plugin for Babel, ESLint or some bundler. |
@nmn Thanks for the reply. I probably expressed myself incorrenctly. What you are saying is true. The stylex package indeed supports both esm and cjs. But in my original post I mention |
My understanding was that Rollup was all-in on ESM, so only exporting an ESM build was intentional. This is also the case for the Babel and ESlint plugins which need to be CJS to work. We can probably add CJS support the rollup plugin without too much trouble. |
That would be brilliant. I don’t think the support for cjs should bring any hassle in the long run. Although we may hopefully see a future with single united module philosophy. 🙂 |
Hey @nmn, is the support planned on any roadmap? Can I help with this anyhow? Thanks! 🙏 |
@VojGin Happy to accept a PR as I haven't had the time to prioritize this yet. The |
Describe the feature request
StyleX (all of the packages, including plugins) is written and build as ES Module. So it can be easily imported to any ESM compatible project. But not all of the packages have support for CommonJS and it's currently impossible to import it into a CJS project. Can we have also CJS build support for all packages?
To give you an example. NX rollup executor configuration currently does not support ESM. This means StyleX currently can't be used in NX monorepo projects using rollup builder. (See this). The reason is that
stylexjs/rollup-plugin
does not support cjs.The text was updated successfully, but these errors were encountered: