@stylexswc/rollup-plugin
v0.4.1
Published
Stylex rollup plugin with NAPI-RS compiler
Downloads
435
Readme
Webpack plugin with NAPI-RS StyleX compiler integration
Webpack plugin
for an unofficial
napi-rs
compiler that includes the StyleX SWC code transformation under the hood.
Installation
To install the package, run the following command:
npm install --save-dev @stylexswc/webpack-plugin
Please install @stylexswc/rs-compiler
if you haven't done so already:
npm install --save-dev @stylexswc/rs-compiler
Usage
Modify Webpack config. For example:
const StylexPlugin = require('@stylexswc/webpack-plugin');
const path = require('path');
const config = (env, argv) => ({
entry: {
main: './js/index.js',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
plugins: [
new StylexPlugin({
filename: 'styles.[contenthash].css',
dev: argv.mode === 'development',
}),
],
cache: true,
});
module.exports = config;
Plugin Options
The options are similar like @stylexjs/babel-plugin
and can be found here