
Research
6 Malicious Packagist Themes Ship Trojanized jQuery and FUNNULL Redirect Payloads
Six malicious Packagist packages posing as OphimCMS themes contain trojanized jQuery that exfiltrates URLs, injects ads, and loads FUNNULL-linked redirects.
@rolldown/plugin-babel
Advanced tools
Rolldown plugin for transforming code with Babel.
pnpm install @rolldown/plugin-babel @babel/core
import babel from '@rolldown/plugin-babel'
export default {
plugins: [
babel({
plugins: ['@babel/plugin-proposal-throw-expressions'],
}),
],
}
The plugin automatically configures Babel's parser for .jsx, .ts, and .tsx files.
Note: This plugin does not load Babel configuration files (e.g.,
babel.config.js,.babelrc). All Babel options must be passed directly through the plugin options.
includestring | RegExp | (string | RegExp)[]/\.(?:[jt]sx?|[cm][jt]s)(?:$|\?)/Only files matching the pattern will be processed.
excludestring | RegExp | (string | RegExp)[]/[\/\\]node_modules[\/\\]/Files matching the pattern will be skipped.
sourceMapbooleantrueSet to false to skip source map generation for better performance.
presets(babel.PresetItem | RolldownBabelPreset)[]List of Babel presets to apply. Supports both standard Babel presets and Rolldown-enhanced presets with per-file filtering (see Rolldown Babel Presets).
pluginsbabel.PluginItem[]List of Babel plugins to apply.
overridesInnerTransformOptions[]Array of additional configurations that are merged into the current configuration. Use with Babel's test/include/exclude options to conditionally apply overrides.
The following Babel options are forwarded directly:
assumptions, auxiliaryCommentAfter, auxiliaryCommentBefore, comments, compact, cwd, generatorOpts, parserOpts, retainLines, shouldPrintComment, targets, wrapPluginVisitorMethod
Standard Babel presets are applied to every file. When a preset should only apply to certain files, wrap it in a RolldownBabelPreset with a filter. Use the defineRolldownBabelPreset helper for type checking:
import babelPlugin, { defineRolldownBabelPreset } from '@rolldown/plugin-babel'
const myReactPreset = defineRolldownBabelPreset({
preset: ['@babel/preset-react'],
rolldown: {
filter: {
id: /\.tsx?$/,
moduleType: ['tsx', 'jsx'],
code: /from ['"]react['"]/,
},
},
})
export default {
plugins: [
babelPlugin({
presets: [myReactPreset],
}),
],
}
All filter dimensions are optional. When multiple dimensions are specified, all must match for the preset to apply.
idMatch files by path. Accepts a string glob, RegExp, array, or { include, exclude } object.
{ id: /\.tsx$/ }
{ id: '**/*.tsx' }
{ id: [/\.tsx$/, /\.jsx$/] }
{ id: { include: [/\.tsx$/], exclude: [/test\.tsx$/] } }
moduleTypeMatch by Rolldown module type. Accepts a string array or { include } object.
{
moduleType: ['tsx', 'jsx']
}
{
moduleType: {
include: ['tsx']
}
}
codeMatch by file content. Accepts a RegExp, array, or { include, exclude } object.
{ code: /import React/ }
{ code: { include: [/import React/], exclude: [/\/\/ @no-transform/] } }
configResolvedHookWhen used with Vite, a preset can define a configResolvedHook callback to conditionally enable or disable itself based on the resolved Vite config. The callback receives the ResolvedConfig and should return false to remove the preset.
defineRolldownBabelPreset({
preset: ['@babel/preset-react'],
rolldown: {
filter: { id: /\.[jt]sx$/ },
configResolvedHook(config) {
// Only apply during production builds
return config.command === 'build'
},
},
})
When running without Vite (pure Rolldown), configResolvedHook is ignored.
applyToEnvironmentHookWhen used with Vite, a preset can define an applyToEnvironmentHook callback to conditionally enable or disable itself based on the Vite environment. The callback receives the PartialEnvironment and should return false to remove the preset for that environment.
defineRolldownBabelPreset({
preset: ['@babel/preset-react'],
rolldown: {
filter: { id: /\.[jt]sx$/ },
applyToEnvironmentHook(environment) {
// Only apply in the client environment
return environment.name === 'client'
},
},
})
When running without Vite (pure Rolldown), applyToEnvironmentHook is ignored.
optimizeDepsA preset can declare dependencies that should be pre-bundled by Vite's dependency optimizer. The plugin automatically merges these into optimizeDeps.include in the Vite config.
defineRolldownBabelPreset({
preset: ['@babel/preset-react'],
rolldown: {
filter: { id: /\.[jt]sx$/ },
optimizeDeps: {
include: ['react', 'react-dom'],
},
},
})
When running without Vite (pure Rolldown), optimizeDeps is ignored.
Preset filters operate at two levels:
Per-file filtering — When Rolldown calls the transform hook, each preset's filter is checked against the current file. Presets whose filter doesn't match are skipped for that file.
Transform hook pre-filtering — The plugin computes a union of all preset filters to tell Rolldown which files to send to the transform hook in the first place. This avoids calling into the plugin for files that no preset would match.
You can mix standard Babel presets and Rolldown presets freely:
babelPlugin({
presets: [
'@babel/preset-env', // applied to all files
{
preset: ['@babel/preset-react'],
rolldown: { filter: { id: /\.[jt]sx$/ } },
},
],
})
MIT
FAQs
Rolldown plugin for Babel
The npm package @rolldown/plugin-babel receives a total of 522 weekly downloads. As such, @rolldown/plugin-babel popularity was classified as not popular.
We found that @rolldown/plugin-babel 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
Six malicious Packagist packages posing as OphimCMS themes contain trojanized jQuery that exfiltrates URLs, injects ads, and loads FUNNULL-linked redirects.

Security News
The GCVE initiative operated by CIRCL has officially opened its publishing ecosystem, letting organizations issue and share vulnerability identifiers without routing through a central authority.

Security News
The project is retiring its odd/even release model in favor of a simpler annual cadence where every major version becomes LTS.