
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@stylexswc/nextjs-swc-plugin
Advanced tools
[!CAUTION] DEPRECATED: This package is deprecated as of version 0.5.0. Please migrate to
@stylexswc/nextjs-pluginwhich is the official replacement.
To migrate from this package to the new one:
npm uninstall @stylexswc/nextjs-swc-plugin
npm install --save-dev @stylexswc/nextjs-plugin
next.config.js according to the Advanced Options section.[!IMPORTANT] The plugin API has been updated since version 0.5.0. If you're upgrading from an earlier version, please note that the configuration options have changed. See the Plugin Options section for the updated API.
Next.js plugin for an unofficial
StyleX SWC
plugin.
Since version 12, Next.js uses SWC Compiler by default. According to Vercel, compilation using the SWC Compiler is 17x faster than Babel.
However, if you have a Babel config, the application will out put of SWC Compiler and continue to use Babel.
This plugin allows us to use StyleX and take advantage of SWC Compiler.
The usage of StyleX does not change, all changes are internal. All you need to do, is install SWC StyleX plugin and update Next.js config.
Install the package and SWC plugin by using:
npm install --save-dev @stylexswc/nextjs-plugin
stylexImportsArray<string | { as: string, from: string }>['stylex', '@stylexjs/stylex']useCSSLayersbooleanfalsetransformCss(css: string) => string | Buffer | Promise<string | Buffer>Partial<StyleXOptions>const path = require('path');
const stylexPlugin = require('@stylexswc/nextjs-swc-plugin');
const rootDir = __dirname;
module.exports = stylexPlugin({})({
transpilePackages: ['@stylexjs/open-props'],
// Optionally, add any other Next.js config below
experimental: {
swcPlugins: [[
"@stylexswc/swc-plugin",
{
dev: process.env.NODE_ENV === 'development',
genConditionalClasses: true,
treeshakeCompensation: true,
aliases: {
'@/*': [path.join(rootDir, '*')],
},
unstable_moduleResolution: {
type: 'commonJS',
rootDir: rootDir,
},
},
]],
},
});
FAQs
Stylex NextJS plugin with swc plugin
We found that @stylexswc/nextjs-swc-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.