{"id":13527083,"url":"https://github.com/rollup/rollup-plugin-babel","last_synced_at":"2026-01-14T03:24:22.439Z","repository":{"id":57167840,"uuid":"44689601","full_name":"rollup/rollup-plugin-babel","owner":"rollup","description":"This package has moved and is now available at @rollup/plugin-babel / https://github.com/rollup/plugins/tree/master/packages/babel","archived":true,"fork":false,"pushed_at":"2020-04-29T07:11:10.000Z","size":668,"stargazers_count":703,"open_issues_count":0,"forks_count":70,"subscribers_count":21,"default_branch":"master","last_synced_at":"2026-01-04T23:12:58.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rollup.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-21T16:30:59.000Z","updated_at":"2024-12-11T19:30:17.000Z","dependencies_parsed_at":"2022-09-05T16:51:51.730Z","dependency_job_id":null,"html_url":"https://github.com/rollup/rollup-plugin-babel","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/rollup/rollup-plugin-babel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-babel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-babel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-babel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-babel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollup","download_url":"https://codeload.github.com/rollup/rollup-plugin-babel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollup%2Frollup-plugin-babel/sbom","scorecard":{"id":783451,"data":{"date":"2025-08-11","repo":{"name":"github.com/rollup/rollup-plugin-babel","commit":"0f860b4f27f759d911f384272a38fcf04af5a881"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":2,"reason":"Found 8/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"28 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T05:27:55.475Z","repository_id":57167840,"created_at":"2025-08-23T05:27:55.475Z","updated_at":"2025-08-23T05:27:55.475Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28275643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T02:08:32.518Z","status":"ssl_error","status_checked_at":"2026-01-11T02:08:32.093Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:40.599Z","updated_at":"2026-01-14T03:24:22.418Z","avatar_url":"https://github.com/rollup.png","language":"JavaScript","readme":"# Moved\n\nThis package has moved and is now available at [@rollup/plugin-babel](https://github.com/rollup/plugins). Please update your dependencies. This repository is no longer maintained.\n\n# rollup-plugin-babel\n\nSeamless integration between Rollup and Babel.\n\n## Why?\n\nIf you're using Babel to transpile your ES6/7 code and Rollup to generate a standalone bundle, you have a couple of options:\n\n- run the code through Babel first, being careful to exclude the module transformer, or\n- run the code through Rollup first, and _then_ pass it to Babel.\n\nBoth approaches have disadvantages – in the first case, on top of the additional configuration complexity, you may end up with Babel's helpers (like `classCallCheck`) repeated throughout your code (once for each module where the helpers are used). In the second case, transpiling is likely to be slower, because transpiling a large bundle is much more work for Babel than transpiling a set of small files.\n\nEither way, you have to worry about a place to put the intermediate files, and getting sourcemaps to behave becomes a royal pain.\n\nUsing Rollup with rollup-plugin-babel makes the process far easier.\n\n## Installation\n\n\u003e babel 7.x\n\n```bash\nnpm install --save-dev rollup-plugin-babel@latest\n```\n\n\u003e babel 6.x\n\n```bash\nnpm install --save-dev rollup-plugin-babel@3\n```\n\n## Usage\n\n### Command Line (`rollup`)\n\n#### Configuration\n\n`rollup.config.js` ([docs](https://rollupjs.org/guide/en/#configuration-files)):\n\n```js\nimport babel from 'rollup-plugin-babel';\nimport pkg from './package.json';\n\nconst config = {\n\tinput: 'src/index.js',\n\toutput: [\n\t\t{\n\t\t\tfile: pkg.module,\n\t\t\tformat: 'esm',\n\t\t},\n\t],\n\tplugins: [babel()],\n};\n\nexport default config;\n```\n\n### Programmatic\n\n```js\nimport { rollup } from 'rollup';\nimport babel from 'rollup-plugin-babel';\n\nrollup({\n  input: 'main.js',\n  plugins: [\n    babel({\n      exclude: 'node_modules/**'\n    })\n  ]\n}).then(...)\n```\n\nAll options are as per the [Babel documentation](https://babeljs.io/), plus the following:\n\n- `options.externalHelpers`: a boolean value indicating whether to bundle in the Babel helpers\n- `options.include` and `options.exclude`: each a minimatch pattern, or array of minimatch patterns, which determine which files are transpiled by Babel (by default, all files are transpiled)\n- `options.externalHelpersWhitelist`: an array which gives explicit control over which babelHelper functions are allowed in the bundle (by default, every helper is allowed)\n- `options.extensions`: an array of file extensions that Babel should transpile (by default the Babel defaults of .js, .jsx, .es6, .es, .mjs. are used)\n\nBabel will respect `.babelrc` files – this is generally the best place to put your configuration.\n\n### External dependencies\n\nIdeally, you should only be transforming your source code, rather than running all of your external dependencies through Babel – hence the `exclude: 'node_modules/**'` in the example above. If you have a dependency that exposes untranspiled ES6 source code that doesn't run in your target environment, then you may need to break this rule, but it often causes problems with unusual `.babelrc` files or mismatched versions of Babel.\n\nWe encourage library authors not to distribute code that uses untranspiled ES6 features (other than modules) for this reason. Consumers of your library should _not_ have to transpile your ES6 code, any more than they should have to transpile your CoffeeScript, ClojureScript or TypeScript.\n\nUse `babelrc: false` to prevent Babel from using local (i.e. to your external dependencies) `.babelrc` files, relying instead on the configuration you pass in.\n\n### Helpers\n\nIn some cases Babel uses _helpers_ to avoid repeating chunks of code – for example, if you use the `class` keyword, it will use a `classCallCheck` function to ensure that the class is instantiated correctly.\n\nBy default, those helpers will be inserted at the top of the file being transformed, which can lead to duplication. This rollup plugin automatically deduplicates those helpers, keeping only one copy of each one used in the output bundle. Rollup will combine the helpers in a single block at the top of your bundle. To achieve the same in Babel 6 you must use the `external-helpers` plugin.\n\nAlternatively, if you know what you're doing, you can use the `transform-runtime` plugin. If you do this, use `runtimeHelpers: true`:\n\n```js\nrollup.rollup({\n  ...,\n  plugins: [\n    babel({ runtimeHelpers: true })\n  ]\n}).then(...)\n```\n\nBy default `externalHelpers` option is set to `false` so babel helpers will be included in your bundle.\n\nIf you do not wish the babel helpers to be included in your bundle at all (but instead reference the global `babelHelpers` object), you may set the `externalHelpers` option to `true`:\n\n```js\nrollup.rollup({\n  ...,\n  plugins: [\n    babel({\n      plugins: ['external-helpers'],\n      externalHelpers: true\n    })\n  ]\n}).then(...)\n```\n\n### Modules\n\n_This is not needed for Babel 7 - it knows automatically that Rollup understands ES modules \u0026 that it shouldn't use any module transform with it. The section below describes what needs to be done for Babel 6._\n\nThe `env` preset includes the [transform-es2015-modules-commonjs](http://babeljs.io/docs/plugins/transform-es2015-modules-commonjs/) plugin, which converts ES6 modules to CommonJS – preventing Rollup from working. Since Babel 6.3 it's possible to deactivate module transformation with `\"modules\": false`. So there is no need to use the old workaround with `babel-preset-es2015-rollup`, that will work for Babel \u003c6.13. Rollup will throw an error if this is incorrectly configured.\n\nHowever, setting `modules: false` in your `.babelrc` may conflict if you are using `babel-register`. To work around this, specify `babelrc: false` in your rollup config. This allows Rollup to bypass your `.babelrc` file. In order to use the `env` preset, you will also need to specify it with `modules: false` option:\n\n```js\nplugins: [\n\tbabel({\n\t\tbabelrc: false,\n\t\tpresets: [['env', { modules: false }]],\n\t}),\n];\n```\n\n## Configuring Babel 6\n\n**The following applies to Babel 6 only. If you're using Babel 5, do `npm i -D rollup-plugin-babel@1`, as version 2 and above no longer supports Babel 5**\n\n```bash\nnpm install --save-dev rollup-plugin-babel@3 babel-preset-env babel-plugin-external-helpers\n```\n\n```js\n// .babelrc\n{\n  \"presets\": [\n    [\n      \"env\",\n      {\n        \"modules\": false\n      }\n    ]\n  ],\n  \"plugins\": [\n    \"external-helpers\"\n  ]\n}\n```\n\n## Custom plugin builder\n\n`rollup-plugin-babel` exposes a plugin-builder utility that allows users to add custom handling of Babel's configuration for each file that it processes.\n\n`.custom` accepts a callback that will be called with the loader's instance of `babel` so that tooling can ensure that it using exactly the same `@babel/core` instance as the loader itself.\n\nIt's main purpose is to allow other tools for configuration of transpilation without forcing people to add extra configuration but still allow for using their own babelrc / babel config files.\n\n### Example\n\n```js\nimport babel from 'rollup-plugin-babel';\n\nexport default babel.custom(babelCore =\u003e {\n\tfunction myPlugin() {\n\t\treturn {\n\t\t\tvisitor: {},\n\t\t};\n\t}\n\n\treturn {\n\t\t// Passed the plugin options.\n\t\toptions({ opt1, opt2, ...pluginOptions }) {\n\t\t\treturn {\n\t\t\t\t// Pull out any custom options that the plugin might have.\n\t\t\t\tcustomOptions: { opt1, opt2 },\n\n\t\t\t\t// Pass the options back with the two custom options removed.\n\t\t\t\tpluginOptions,\n\t\t\t};\n\t\t},\n\n\t\tconfig(cfg /* Passed Babel's 'PartialConfig' object. */, { code, customOptions }) {\n\t\t\tif (cfg.hasFilesystemConfig()) {\n\t\t\t\t// Use the normal config\n\t\t\t\treturn cfg.options;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...cfg.options,\n\t\t\t\tplugins: [\n\t\t\t\t\t...(cfg.options.plugins || []),\n\n\t\t\t\t\t// Include a custom plugin in the options.\n\t\t\t\t\tmyPlugin,\n\t\t\t\t],\n\t\t\t};\n\t\t},\n\n\t\tresult(result, { code, customOptions, config, transformOptions }) {\n\t\t\treturn {\n\t\t\t\t...result,\n\t\t\t\tcode: result.code + '\\n// Generated by some custom plugin',\n\t\t\t};\n\t\t},\n\t};\n});\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-babel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollup%2Frollup-plugin-babel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollup%2Frollup-plugin-babel/lists"}