
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@rolldown/plugin-emotion
Advanced tools
Rolldown plugin for minification and optimization of Emotion styles.
This plugin utilizes Rolldown's native magic string API instead of Babel and is more performant than using @emotion/babel-plugin with @rolldown/plugin-babel.
pnpm add -D @rolldown/plugin-emotion
import emotion from '@rolldown/plugin-emotion'
export default {
plugins: [
emotion({
// options
}),
],
}
The plugin handles imports from these Emotion packages out of the box:
@emotion/css@emotion/styled@emotion/react@emotion/primitives@emotion/nativesourceMapbooleantrue in development, false otherwiseGenerate source maps for Emotion CSS. Source maps help trace styles back to their original source in browser DevTools.
autoLabel'never' | 'dev-only' | 'always''dev-only'Controls when debug labels are added to styled components and css calls.
'never' — Never add labels'dev-only' — Only add labels in development mode'always' — Always add labelslabelFormatstring"[local]"Defines the format of generated debug labels. Only relevant when autoLabel is not 'never'.
Supports placeholders:
[local] — The variable name that the result of css or styled call is assigned to[filename] — The file name (without extension)[dirname] — The directory name of the fileemotion({
autoLabel: 'always',
labelFormat: '[dirname]--[filename]--[local]',
})
importMapRecord<string, ImportMapConfig>Custom import mappings for non-standard Emotion packages. Maps package names to their export configurations, allowing the plugin to transform custom libraries that re-export Emotion utilities.
emotion({
importMap: {
'my-emotion-lib': {
myStyled: {
canonicalImport: ['@emotion/styled', 'default'],
},
myCss: {
canonicalImport: ['@emotion/react', 'css'],
},
},
},
})
Each entry maps an export name to its canonical Emotion equivalent via canonicalImport: [packageName, exportName].
Results of the benchmark that can be run by pnpm bench in ./benchmark directory:
name hz min max mean p75 p99 p995 p999 rme samples
· @rolldown/plugin-emotion 9.7954 98.4954 108.83 102.09 103.34 108.83 108.83 108.83 ±2.23% 10
· @rolldown/plugin-babel 3.7139 254.48 295.01 269.26 277.63 295.01 295.01 295.01 ±3.49% 10
· @rollup/plugin-swc 7.5542 128.56 139.14 132.38 134.82 139.14 139.14 139.14 ±1.78% 10
@rolldown/plugin-emotion - bench/emotion.bench.ts > Emotion Benchmark
1.30x faster than @rollup/plugin-swc
2.64x faster than @rolldown/plugin-babel
The benchmark was ran on the following environment:
OS: macOS Tahoe 26.3
CPU: Apple M4
Memory: LPDDR5X-7500 32GB
MIT
The implementation is based on swc-project/plugins/packages/emotion (Apache License 2.0). Test cases are also adapted from it.
FAQs
Rolldown plugin for Emotion CSS-in-JS
The npm package @rolldown/plugin-emotion receives a total of 799 weekly downloads. As such, @rolldown/plugin-emotion popularity was classified as not popular.
We found that @rolldown/plugin-emotion demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.