
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@stylexjs/esbuild-plugin
Advanced tools
Use StyleX with esbuild bundler.
This plugin transforms files that contain stylexjs
imports and generates a
stylexjs
CSS bundle.
npm install --save-dev @stylexjs/esbuild-plugin
import esbuild from 'esbuild';
import stylexPlugin from '@stylexjs/esbuild-plugin';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
esbuild.build({
entryPoints: ['src/index.js'],
bundle: true,
outfile: './build/bundle.js',
minify: true,
plugins: [
stylexPlugin({
// If set to 'true', bundler will inject styles in-line
// Do not use in production
dev: false,
// Required. File path for the generated CSS file
generatedCSSFileName: path.resolve(__dirname, 'build/stylex.css'),
// Aliases for StyleX package imports
// default: '@stylexjs/stylex'
stylexImports: ['@stylexjs/stylex'],
// Required for CSS variable support
unstable_moduleResolution: {
// type: 'commonJS' | 'haste'
// default: 'commonJS'
type: 'commonJS',
// The absolute path to the root of your project
rootDir: __dirname,
},
}),
],
});
It inherits all options from @stylexjs/babel-plugin
and can be found here 🔗. Along with other options like
generatedCSSFileName: string // Default: 'stylex.css'
The name of the output css file.
useCSSLayers: boolean // Default: false
Enabling this option switches Stylex from using :not(#\#)
to using @layers
for handling CSS specificity.
babelConfig: {
plugins: PluginItem[],
presets: PluginItem[]
} // Default: { plugins: [], presets: [] }
List of custom babel plugins and presets which can be used during code transformation.
You can see the example usage here.
0.11.1 (Mar 3, 2025)
create
compilation regression for string and number keys.FAQs
StyleX esbuild plugin
The npm package @stylexjs/esbuild-plugin receives a total of 609 weekly downloads. As such, @stylexjs/esbuild-plugin popularity was classified as not popular.
We found that @stylexjs/esbuild-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.