Registry / devops / babili-standalone

babili-standalone

JSON →
library0.0.10jsnpmunverified

Standalone build of Babili (babel-minify) for use in non-Node.js environments including browsers. Version 0.0.10 is the latest stable release. This package is deprecated in favor of babel-standalone's minify preset. It provides a browser-friendly API (Babili.transform) and can be loaded via CDN, Bower, or npm. Key differentiator: It allows client-side ES6+ minification without Node.js setup, but requires Babel-standalone to be loaded first.

npm install babili-standalone
INSTALL
IMPORT
SIG · BABILI-STANDALONE
B
babili-standalone
devopsjavascriptv0.0.10
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.

default (Babili)
// UMD - loaded via <script> tag const Babili = window.Babili;
import Babili from 'babili-standalone';
No ES module exports; use global variable. Avoid import/require in Node as it is not ESM-compatible.
transform
Babili.transform(source, options);
Babili.transformAsync(source, options);
Only synchronous transform available; no async variant.
version
Babili.version;
Babili.VERSION;
Property is lowercase 'version'.

Shows how to include Babel and Babili scripts from CDN, then run synchronous minification on a simple ES6 class.

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Babili-standalone example</title> </head> <body> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babili-standalone/0.0.10/babili.min.js"></script> <script> var input = 'class Foo { constructor(bar) { this.bar = bar; } }; new Foo();'; var output = Babili.transform(input).code; console.log(output); </script> </body> </html>
Debug
Known issues
deprecatedbabili-standalone is deprecated in favor of @babel/preset-minify in babel-standalone.
fix
Use babel-standalone with @babel/preset-minify instead.
affects: >=0.0.0
gotchaBabili.transform requires Babel-standalone to be loaded first.
fix
Load babel.min.js before babili.min.js in your HTML.
affects: >=0.0.0
gotchaOnly synchronous transform; no support for asynchronous or streaming transformations.
fix
If you need async, switch to babel-standalone with minify preset and use Babel.transformAsync.
affects: >=0.0.0
Errors
Common errors & fixes
ReferenceError: Babili is not defined
Babili script loaded before Babel script, or not loaded at all.
fix
Ensure babel.min.js is loaded before babili.min.js and both scripts are in the page.
Babili.transform is not a function
Babili object is undefined or incorrect library version.
fix
Check that you are using the correct CDN URL: https://cdnjs.cloudflare.com/ajax/libs/babili-standalone/0.0.10/babili.min.js
Cannot find module 'babili-standalone' (when using require)
Node.js environment is not supported; this is browser-only.
fix
Use babel-standalone with @babel/preset-minify for Node.js usage.
Upgrade
Version history
0.0.10latest on npm
Audit
Dependencies
babel-standalonerequiredBabili requires Babel to be loaded first for transformation
Agent activity
5 hits · last 30 days
node
4
Resources
babili-standalone — npm install babili-standalone · libregistry