@stylexswc/unplugin
v0.4.1
Published
Unplugin for StyleX RS compiler
Downloads
96
Maintainers
Readme
Unplugin with NAPI-RS StyleX compiler integration
Uplugin
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/unplugin
Usage
To use the plugin, you need to add it to your build tool configuration.
For every plugin have an example of how to use it in
apps/{pluginName}-unplugin-example
folder.
Plugins
// vite.config.ts
import StylexRsPlugin from '@stylexswc/unplugin/vite';
export default defineConfig({
plugins: [
StylexRsPlugin({
/* options */
}),
],
});
// rollup.config.js
import StylexRsPlugin from '@stylexswc/unplugin/rollup';
export default {
plugins: [
StylexRsPlugin({
/* options */
}),
],
};
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('@stylexswc/unplugin/webpack')({
/* options */
}),
],
};
// nuxt.config.js
export default defineNuxtConfig({
modules: [
[
'@stylexswc/unplugin/nuxt',
{
/* options */
},
],
],
});
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('@stylexswc/unplugin/webpack')({
/* options */
}),
],
},
};
// esbuild.config.js
import { build } from 'esbuild';
import StylexRsPlugin from '@stylexswc/unplugin/esbuild';
build({
plugins: [StylexRsPlugin()],
});