Install the package by using:
npm install --save-dev @stylexjs/rollup-plugin
or with yarn:
yarn add --dev @stylexjs/rollup-plugin
Add the following to you rollup.config.mjs
import stylexPlugin from '@stylexjs/rollup-plugin';
const config = {
input: './index.js',
output: {
file: './.build/bundle.js',
format: 'es',
},
plugins: [stylexPlugin({ fileName: 'stylex.css' })],
};
export default config;