Registry / devops / babelrc-rollup

babelrc-rollup

JSON →
library3.0.0jsnpmunverified

Builds a Babel configuration for rollup-plugin-babel by reading a .babelrc file. Current stable version is 3.0.0 (August 2016, no recent updates). It simplifies Rollup integration by automatically converting presets to Rollup-compatible versions (e.g., es2015 → es2015-rollup) and adding the external-helpers plugin. Unlike manual configuration, it reads .babelrc and handles preset option passing (array syntax) for Babel v6.13+. Key differentiator: removes manual setup for Rollup+Babel, but is largely superseded by Rollup's built-in Babel handling.

npm install babelrc-rollup
INSTALL
IMPORT
SIG · BABELRC-ROLLUP
B
babelrc-rollup
devopsjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import babelrc from 'babelrc-rollup'
const babelrc = require('babelrc-rollup')
Default export; CommonJS require works but ESM is idiomatic for Rollup configs.
babelrc()
babelrc({ path: '.babelrc', addModuleOptions: true })
babelrc({ path: './.babelrc' })
Path is relative to process.cwd() by default; do not include './' prefix.
babelrc with findRollupPresets
babelrc({ findRollupPresets: true })
babelrc({ findRollupPresets: true, addModuleOptions: true })
Older versions (pre-3.0.0) enabled this by default. v3+ requires explicit opt-in.

Shows how to import babelrc-rollup and pass its output to rollup-plugin-babel in a Rollup config.

// rollup.config.js import babelrc from 'babelrc-rollup'; import babel from 'rollup-plugin-babel'; export default { input: 'src/main.js', output: { file: 'dist/bundle.js', format: 'esm' }, plugins: [ babel(babelrc()) ] };
babelrc-rollup --version
Debug
Known issues
breakingv3.0.0: findRollupPresets default changed from true to false. If you relied on automatic -rollup preset resolution, you must explicitly set findRollupPresets: true.
fix
Add findRollupPresets: true to the options object passed to babelrc().
affects: >=2.0.0 <3.0.0
breakingv2.0.0: findRollupPresets scans all presets for a -rollup suffix, which may pick up unintended replacements.
fix
Explicitly set findRollupPresets to false if you want exact preset matching, or upgrade to v3.0.0+.
affects: 2.0.0
deprecatedThe package is effectively unmaintained since August 2016. Modern Rollup and Babel versions may not work correctly.
fix
Consider using @rollup/plugin-babel with manual babel config or @babel/preset-env's modules: false.
affects: >=0.0.0
gotchaaddModuleOptions defaults to true, which sets modules: false for all presets. This may conflict with presets that already define modules options.
fix
Explicitly set addModuleOptions: false if your presets handle modules themselves.
affects: >=0.0.0
gotchaaddExternalHelpersPlugin defaults to true, which adds the external-helpers plugin. If not used, helpers may be duplicated.
fix
Set addExternalHelpersPlugin: false only if you are sure you don't need it.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-es2015-rollup'
findRollupPresets enabled but the corresponding -rollup preset is not installed.
fix
Install the -rollup preset: npm install --save-dev babel-preset-es2015-rollup, or disable findRollupPresets.
Error: .babelrc file not found
The default path '.babelrc' does not exist or is not readable.
fix
Ensure a .babelrc file exists at the project root, or pass a custom path option to babelrc().
TypeError: babelrc is not a function
Wrong import style or version incompatibility (require instead of import or ES module mismatch).
fix
Use the default import: import babelrc from 'babelrc-rollup';
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
rollup-plugin-babelrequiredCompanion plugin that applies the Babel config generated by babelrc-rollup
Agent activity
6 hits · last 30 days
node
6
Resources
babelrc-rollup — npm install babelrc-rollup · libregistry