{"id":24969,"library":"babel-standalone-rollup","title":"Babel Standalone","description":"A standalone build of Babel 6.x for use in non-Node.js environments, particularly browsers. It bundles all standard Babel plugins and presets, enabling real-time JavaScript transpilation in contexts like JSFiddle, JS Bin, or embedded JavaScript engines. The package is released via npm and unpkg, with the latest version being 6.24.3. Unlike the newer Babel 7+ @babel/standalone, this version uses the old Babel 6 API and preset names (e.g., 'es2015' instead of '@babel/preset-env'). Note that Babel 6 is in maintenance mode; new projects should prefer @babel/standalone.","status":"maintenance","version":"6.24.3","language":"javascript","source_language":"en","source_url":"https://github.com/jetiny/babel-standalone-rollup","tags":["javascript","babel","babeljs","6to5","transpile","transpiler"],"install":[{"cmd":"npm install babel-standalone-rollup","lang":"bash","label":"npm"},{"cmd":"yarn add babel-standalone-rollup","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-standalone-rollup","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"babel-standalone is not a proper npm module; it must be loaded via a script tag or bundled as a standalone file. The global Babel object is only available after loading babel.min.js.","wrong":"import Babel from 'babel-standalone-rollup'; // fails - not a module","symbol":"Babel","correct":"// via script tag: global object\nconst output = Babel.transform(input, { presets: ['es2015'] }).code;"},{"note":"In Babel 6, presets use short names like 'es2015', 'react', 'stage-2'. Babel 7+ uses scoped '@babel/preset-*' names.","wrong":"Babel.transform(code, { presets: ['@babel/preset-env'] }) // wrong preset name for Babel 6","symbol":"Babel.transform","correct":"Babel.transform(code, { presets: ['es2015'] })"},{"note":"Custom plugins can be registered globally for use in transform options. The function should return a visitor object.","symbol":"Babel.registerPlugin","correct":"Babel.registerPlugin('myPlugin', myPluginFunction)"},{"note":"Inline scripts with type=\"text/babel\" are auto-transpiled. Use data-presets and data-plugins attributes (Babel 6 naming only).","wrong":"<script type=\"text/babel\" data-presets=\"@babel/preset-env\">...</script>","symbol":"script tags with type=\"text/babel\"","correct":"<script type=\"text/babel\" data-presets=\"es2015,react\">..."}],"quickstart":{"code":"<!DOCTYPE html>\n<html>\n<body>\n<div id=\"output\"></div>\n<script src=\"https://unpkg.com/babel-standalone@6.24.3/babel.min.js\"></script>\n<script type=\"text/babel\">\nconst getMessage = () => \"Hello World\";\ndocument.getElementById('output').innerHTML = getMessage();\n</script>\n</body>\n</html>","lang":"javascript","description":"Load Babel standalone from CDN and transpile inline ES6/ES2015 code using a script tag with type=\"text/babel\"."},"warnings":[{"fix":"Use legacy preset names: 'es2015', 'es2016', 'es2017', 'react', 'stage-0', etc. For new projects, use @babel/standalone from Babel 7.","message":"Preset names differ between Babel 6 and Babel 7. babel-standalone-rollup uses Babel 6 presets like 'es2015', 'react', 'stage-2'. Using '@babel/preset-env' will fail silently because it's not recognized.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Migrate to @babel/standalone for Babel 7 compatibility and new features.","message":"Babel 6 is in maintenance mode. The official standalone build is now @babel/standalone. babel-standalone-rollup may receive no further updates.","severity":"deprecated","affected_versions":">=6.0.0"},{"fix":"Use the unpkg CDN link or copy the dist file. For Node usage, install @babel/core instead.","message":"babel-standalone-rollup is not a proper npm module for bundling. It is distributed as a global script (babel.min.js) meant for direct browser inclusion. Requiring or importing it in Node or bundlers may not work as expected.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Pass presets/plugins to Babel.transform or use data-presets/data-plugins on script tags.","message":"The .babelrc configuration file is not supported in standalone mode. All presets and plugins must be passed explicitly via options or data attributes.","severity":"gotcha","affected_versions":">=6.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Switch to @babel/standalone and use '@babel/preset-env' instead of 'es2015'.","cause":"Using Babel 7 standalone but expecting Babel 6 preset names.","error":"Preset es2015 is not available"},{"fix":"Ensure <script src=\"...babel.min.js\"></script> is included before any script that references Babel.","cause":"The babel standalone script was not loaded before attempting to use the Babel global object.","error":"Babel is not defined"},{"fix":"Do not use npm import. Instead, add <script src=\"https://unpkg.com/babel-standalone@6/babel.min.js\"> to your HTML.","cause":"Trying to import/require babel-standalone-rollup in Node.js or a bundler; it is meant for browser script tags.","error":"Cannot find module 'babel-standalone-rollup'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}