- Building Enterprise JavaScript Applications
- Daniel Li
- 79字
- 2021-07-23 16:31:11
@babel/cli
The Babel CLI is the most common (and easiest) way to run Babel. It gives you an executable (babel) which you can use on the terminal to transpile files and directories. It is available on npmjs.com, and so we can install it using yarn:
# Install @babel/cli as a development dependency
$ yarn add @babel/cli --dev
# transpile a single file
$ babel example.js -o compiled.js
# transpile an entire directory
$ babel src -d build