Registry / serialization / babel-standalone-rollup

babel-standalone-rollup

JSON →
library6.24.3jsnpmunverified

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.

npm install babel-standalone-rollup
INSTALL
IMPORT
SIG · BABEL-STANDALONE-R
B
babel-standalone-rollup
serializationjavascriptv6.24.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

Babel
// via script tag: global object const output = Babel.transform(input, { presets: ['es2015'] }).code;
import Babel from 'babel-standalone-rollup'; // fails - not a module
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.
Babel.transform
Babel.transform(code, { presets: ['es2015'] })
Babel.transform(code, { presets: ['@babel/preset-env'] }) // wrong preset name for Babel 6
In Babel 6, presets use short names like 'es2015', 'react', 'stage-2'. Babel 7+ uses scoped '@babel/preset-*' names.
Babel.registerPlugin
Babel.registerPlugin('myPlugin', myPluginFunction)
Custom plugins can be registered globally for use in transform options. The function should return a visitor object.
script tags with type="text/babel"
<script type="text/babel" data-presets="es2015,react">...
<script type="text/babel" data-presets="@babel/preset-env">...</script>
Inline scripts with type="text/babel" are auto-transpiled. Use data-presets and data-plugins attributes (Babel 6 naming only).

Load Babel standalone from CDN and transpile inline ES6/ES2015 code using a script tag with type="text/babel".

<!DOCTYPE html> <html> <body> <div id="output"></div> <script src="https://unpkg.com/babel-standalone@6.24.3/babel.min.js"></script> <script type="text/babel"> const getMessage = () => "Hello World"; document.getElementById('output').innerHTML = getMessage(); </script> </body> </html>
Debug
Known issues
gotchaPreset 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.
fix
Use legacy preset names: 'es2015', 'es2016', 'es2017', 'react', 'stage-0', etc. For new projects, use @babel/standalone from Babel 7.
affects: >=6.0.0
deprecatedBabel 6 is in maintenance mode. The official standalone build is now @babel/standalone. babel-standalone-rollup may receive no further updates.
fix
Migrate to @babel/standalone for Babel 7 compatibility and new features.
affects: >=6.0.0
gotchababel-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.
fix
Use the unpkg CDN link or copy the dist file. For Node usage, install @babel/core instead.
affects: >=6.0.0
gotchaThe .babelrc configuration file is not supported in standalone mode. All presets and plugins must be passed explicitly via options or data attributes.
fix
Pass presets/plugins to Babel.transform or use data-presets/data-plugins on script tags.
affects: >=6.0.0
Errors
Common errors & fixes
Preset es2015 is not available
Using Babel 7 standalone but expecting Babel 6 preset names.
fix
Switch to @babel/standalone and use '@babel/preset-env' instead of 'es2015'.
Babel is not defined
The babel standalone script was not loaded before attempting to use the Babel global object.
fix
Ensure <script src="...babel.min.js"></script> is included before any script that references Babel.
Cannot find module 'babel-standalone-rollup'
Trying to import/require babel-standalone-rollup in Node.js or a bundler; it is meant for browser script tags.
fix
Do not use npm import. Instead, add <script src="https://unpkg.com/babel-standalone@6/babel.min.js"> to your HTML.
Upgrade
Version history
6.24.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
16
OpenAI (training)
1
Resources
babel-standalone-rollup — npm install babel-standalone-rollup · libregistry