stylex
stylex copied to clipboard
ESM & CJS support for Rollup Plugin
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.