Registry / devops / babel-compile

babel-compile

JSON →
library2.0.0jsnpmunverified

A CLI tool built on babel-core for compiling .js/.jsx files to ES6 with automatic source map generation, output directory cleaning, and configuration loading from NPM modules. Version 2.0.0 is the current stable release with low release cadence. It provides an alternative to the Babel CLI for batch compilation with extra features like source maps with correct file references and cleaning the output directory to avoid stale files. It requires a Babel preset (e.g., babel-preset-es2015).

npm install babel-compile
INSTALL
IMPORT
SIG · BABEL-COMPILE
B
babel-compile
devopsjavascriptv2.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

babel-compile (CLI)
npx babel-compile -p es2015 src:lib
require('babel-compile')
This is a CLI tool, not a module. Use npx or install globally. No JavaScript import exists.
compile function (internal)
Not intended for direct import; use CLI only.
The package does not export a public API for programmatic use.

Shows installation and basic usage of babel-compile CLI with es2015 preset, compiling src/ to lib/.

npm install babel-compile --save-dev npm install babel-preset-es2015 --save-dev # Add to package.json scripts: # "compile": "babel-compile -p es2015 src:lib" # Run: npm run compile
babel-compile --version
Debug
Known issues
gotchaSource maps require Node >=0.12 or source-map-support module for proper stack traces.
fix
Install source-map-support and require it in your entry point.
affects: >=0.0.0
gotchaThe tool only works with .js and .jsx files; other extensions are ignored.
fix
Rename files to .js or .jsx, or use a different compiler.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-es2015'
babel-compile requires an explicit preset to be installed; it does not ship with one.
fix
Run: npm install babel-preset-es2015 --save-dev
SyntaxError: Unexpected token import
Compiled output may still contain ES6 features if a preset is not provided or configured correctly.
fix
Ensure babel-preset-es2015 (or appropriate preset) is installed and passed via -p option.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
babel-preset-es2015requiredRequired for ES2015 compilation; babel-compile itself does not include presets.
Agent activity
4 hits · last 30 days
node
4
Resources
babel-compile — npm install babel-compile · libregistry