@stylexswc/webpack-plugin weekly downloads statistics
By stylexswc · npm · Webpack plugins
StyleX plugin for webpack powered by a Rust NAPI-RS/SWC compiler. Fast StyleX transforms and CSS extraction without Babel.
@stylexswc/webpack-plugin has 41,983 recorded weekly downloads on npm, an increase of 38.4% over the past 30 days, ranking #835 of 3,247 tracked listings.
About @stylexswc/webpack-plugin
@stylexswc/webpack-plugin
StyleX plugin for webpack, powered by a Rust compiler (NAPI-RS + SWC). Part of the StyleX SWC Plugin workspace.
This plugin compiles StyleX code in your webpack build
with
@stylexswc/rs-compiler,
a Rust implementation of the StyleX transform, instead of the official Babel
plugin. Your StyleX code stays exactly the same — only the build step changes,
with per-file transforms 5x to 10x faster than Babel
(performance). The
plugin transforms your source files, collects the generated rules, and extracts
them into a dedicated CSS chunk.
This is a community project and is not affiliated with Meta. It tracks the official StyleX releases
<!-- stylex-compatibility:start -->(currently compatible with StyleX v0.19.2)<!-- stylex-compatibility:end -->and requires Node.js 20 or newer. For Next.js projects, use
@stylexswc/nextjs-plugin
instead — it wires this plugin into the Next.js build for you.
Installation
npm install --save-dev @stylexswc/webpack-plugin
The Rust compiler (@stylexswc/rs-compiler) is installed automatically as a
dependency. Your application still needs the StyleX runtime:
npm install @stylexjs/stylex
Usage
Add the plugin to your webpack config:
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({
rsOptions: {
dev: argv.mode === 'development',
},
}),
],
cache: true,
});
module.exports = config;
Then import the carrier stylesheet once at the entry point of your app (e.g.
index.js, App.tsx):
import '@stylexswc/webpack-plugin/stylex.css';
The plugin appends the extracted StyleX CSS to this asset during the build. Like
a regular CSS file, it must flow through your CSS pipeline, so a css-loader +
MiniCssExtractPlugin.loader rule (or webpack's built-in CSS support) has to
cover .css files.
The carrier import is a recommendation, not a hard requirement. The plugin
also appends tiny per-module CSS imports to every StyleX module, so any part of
the bundle that renders a StyleX component pulls the stylesheet in on its own —
most builds emit correct CSS even without the carrier. What the carrier adds is
a guarantee that doesn't depend on your module graph: the stylesheet is always
present and loaded with the entrypoint. That matters when something consumes
StyleX output without rendering a StyleX component — plain CSS reading
defineVars custom properties (var(--x…)), or injected markup carrying StyleX
class names. If styles would actually be lost (no CSS asset exists to receive
them at all), the plugin raises a compilation warning; it stays silent as long
as the output is correct, carrier or not.
[!IMPORTANT] Migrating from 0.17.x: version 0.18.0 reworks the CSS extraction architecture. The CSS is no longer injected through auto-generated
stylex.virtual.cssimports — add theimport '@stylexswc/webpack-plugin/stylex.css';carrier import to your app entrypoint (recommended; see above for when you can skip it). Paths embedded in module identifiers are now relative tocompiler.context, which changes chunk hashes once and makes builds reproducible across machines.
Plugin Options
Basic Options
rsOptions
- Type:
Partial<StyleXOptions> - Optional
- Description: StyleX compiler options passed to
@stylexswc/rs-compiler. For the standard options, see the official StyleX documentation.
[!NOTE] The
includeandexcludeoptions are exclusive to the Rust compiler and are not available in the official StyleX Babel plugin.
rsOptions.include
- Type:
(string | RegExp)[] - Optional
- Description: Glob patterns or regular expressions selecting the files to transform. When specified, only files matching at least one pattern are transformed. Patterns are matched against paths relative to the current working directory.
rsOptions.exclude
- Type:
(string | RegExp)[] - Optional
- Description: Glob patterns or regular expressions excluding files from the
transform. A file matching any exclude pattern is skipped even if it matches
an
includepattern. Patterns are matched against paths relative to the current working directory.
stylexImports
- Type:
Array<string | { as: string, from: string }> - Default:
['stylex', '@stylexjs/stylex'] - Description: Specifies where StyleX is imported from. Supports both string paths and import aliases.
useCSSLayers
- Type:
boolean - Default:
false - Description: Wraps the generated CSS in cascade layers for better style isolation.
nextjsMode
- Type:
boolean - Default:
false - Description: Enables Next.js-specific optimizations and compatibility features. Leave off unless the plugin is driven by the Next.js integration.
extractCSS
- Type:
boolean - Optional
- Default:
true - Description: Controls whether the generated CSS is extracted into a separate file.
loaderOrder…
Description from the npm listing.
- atomic-css
- css-extraction
- css-in-js
- napi-rs
- react
- rust
- stylex
- swc
- webpack
- webpack-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm Webpack plugins plugins
All 20 @stylexswc/webpack-plugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@stylexswc/webpack-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.