Scroll to navigation

BABEL.JS(1) User Commands BABEL.JS(1)

NAME

babel.js - The compiler for writing next generation JavaScript

SYNOPSIS

babel [options] <files ...>

OPTIONS

The filename to use when reading from stdin. This will be used in source-maps, errors etc.
A comma-separated list of preset names.
A comma-separated list of plugin names.
Path to a .babelrc file to use.
The name of the 'env' to use when loading configs and plugins. Defaults to the value of BABEL_ENV, or else NODE_ENV, or else 'development'.
The project-root resolution mode. One of 'root' (the default), 'upward', or 'upward-optional'.

--source-type [script|module]

Whether or not to look up .babelrc and .babelignore files.
List of glob paths to **not** compile.
List of glob paths to **only** compile.
Enable or disable ANSI syntax highlighting of code frames. (on by default)
Write comments to generated output. (true by default)
Retain line numbers. This will result in really ugly code.
Do not include superfluous whitespace characters and line terminators.
Save as many bytes when printing. (false by default)
Print a comment before any injected non-user code.
Print a comment after any injected non-user code.

-s, --source-maps [true|false|inline|both]

Set `file` on returned source map.
Set `sources[0]` on returned source map.
The root from which all sources are relative.
Optional prefix for the AMD module formatter that will be prepended to the filename on module definitions.
Insert an explicit id for modules.
Specify a custom name for module ids.
List of extensions to compile when a directory has been the input. [.js,.jsx,.es6,.es,.mjs,.cjs]
Preserve the file extensions of the input files.
Recompile files on changes.
Do not compile files before watching.
Compile all input files into a single file.
Compile an input directory of modules into an output directory.
Compile into an output directory relative to input directory or file. Requires --out-dir [out]
When compiling a directory copy over non-compilable files.
Include dotfiles when compiling and copying non-compilable files.
Exclude ignored files when copying non-compilable files.
Log everything. This option conflicts with --quiet
Don't log anything. This option conflicts with --verbose
Delete the out directory before compilation.
Use a specific extension for the output files
output the version number
display help for command
December 2021 babel.js 7.16.6+ds1+~cs214.259.181