{"id":19376,"library":"babelrc-rollup","title":"babelrc-rollup","description":"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.","status":"maintenance","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/eventualbuddha/babelrc-rollup","tags":["javascript","babel","rollup"],"install":[{"cmd":"npm install babelrc-rollup","lang":"bash","label":"npm"},{"cmd":"yarn add babelrc-rollup","lang":"bash","label":"yarn"},{"cmd":"pnpm add babelrc-rollup","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Companion plugin that applies the Babel config generated by babelrc-rollup","package":"rollup-plugin-babel","optional":false}],"imports":[{"note":"Default export; CommonJS require works but ESM is idiomatic for Rollup configs.","wrong":"const babelrc = require('babelrc-rollup')","symbol":"default","correct":"import babelrc from 'babelrc-rollup'"},{"note":"Path is relative to process.cwd() by default; do not include './' prefix.","wrong":"babelrc({ path: './.babelrc' })","symbol":"babelrc()","correct":"babelrc({ path: '.babelrc', addModuleOptions: true })"},{"note":"Older versions (pre-3.0.0) enabled this by default. v3+ requires explicit opt-in.","wrong":"babelrc({ findRollupPresets: true, addModuleOptions: true })","symbol":"babelrc with findRollupPresets","correct":"babelrc({ findRollupPresets: true })"}],"quickstart":{"code":"// rollup.config.js\nimport babelrc from 'babelrc-rollup';\nimport babel from 'rollup-plugin-babel';\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'esm'\n  },\n  plugins: [\n    babel(babelrc())\n  ]\n};","lang":"javascript","description":"Shows how to import babelrc-rollup and pass its output to rollup-plugin-babel in a Rollup config."},"warnings":[{"fix":"Add findRollupPresets: true to the options object passed to babelrc().","message":"v3.0.0: findRollupPresets default changed from true to false. If you relied on automatic -rollup preset resolution, you must explicitly set findRollupPresets: true.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Explicitly set findRollupPresets to false if you want exact preset matching, or upgrade to v3.0.0+.","message":"v2.0.0: findRollupPresets scans all presets for a -rollup suffix, which may pick up unintended replacements.","severity":"breaking","affected_versions":"2.0.0"},{"fix":"Consider using @rollup/plugin-babel with manual babel config or @babel/preset-env's modules: false.","message":"The package is effectively unmaintained since August 2016. Modern Rollup and Babel versions may not work correctly.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Explicitly set addModuleOptions: false if your presets handle modules themselves.","message":"addModuleOptions defaults to true, which sets modules: false for all presets. This may conflict with presets that already define modules options.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set addExternalHelpersPlugin: false only if you are sure you don't need it.","message":"addExternalHelpersPlugin defaults to true, which adds the external-helpers plugin. If not used, helpers may be duplicated.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install the -rollup preset: npm install --save-dev babel-preset-es2015-rollup, or disable findRollupPresets.","cause":"findRollupPresets enabled but the corresponding -rollup preset is not installed.","error":"Error: Cannot find module 'babel-preset-es2015-rollup'"},{"fix":"Ensure a .babelrc file exists at the project root, or pass a custom path option to babelrc().","cause":"The default path '.babelrc' does not exist or is not readable.","error":"Error: .babelrc file not found"},{"fix":"Use the default import: import babelrc from 'babelrc-rollup';","cause":"Wrong import style or version incompatibility (require instead of import or ES module mismatch).","error":"TypeError: babelrc is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}