1.0.0 β€’ Published 8 years ago

fait-babel v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

installation

fait-babel requires fait. Install them both with:

npm install --save-dev fait fait-babel

fait will create a barebones makefile: to load fait-babel, add:

$(call require, fait-babel)

Usage

Run make babel to compile Javascript files from src into lib. fait-babel uses .babelrc your current working directory (and creates an skeleton .babelrc if you don't have one).

To add plugins or presets, run make babel-install-plugins plugins+=plugin presets+=preset, where plugin and preset are the names of what you want to install (minus the leading babel-preset- or babel-plugin-). You can install multiple plugins or presets at once.

Documentation

Rules

πŸ“„ babel ⬅️ $(~babel-dst-files) πŸ”—

Default entry target.

πŸ“‘ $(~babel-dst-files): $$(babel-dst-dir)/% ⬅️ $$(babel-src-dir)/% .babelrc πŸ”—

Compile all $(babel-src-dir) Javascript files to $(babel-dst-dir).

πŸ“ƒ babel-install-plugins πŸ”—

Install Babel plugins and write to .babelrc. Configured by the variables $(plugins) and $(presets), which you should pass on the command line.

If you want to e.g. install babel-preset-es2015 and babel-plugin-transform-runtime, the command would be make babel-install-plugins presets+=es2015 plugins+=transform-runtime.

If you install transform-runtime, babel-runtime is also installed.

Uses @quarterto/bae under the hood.

πŸ“ƒ babel-remove-plugins πŸ”—

Same as babel-install-plugins but uninstalls and removes things from .babelrc instead.

Variables

🚩 $(babel-src-dir) πŸ”—

Directory to look for source Javascript files (determined by $(babel-extensions)).

🚩 $(babel-dst-dir) πŸ”—

Directory to put compiled Javascript files.

🚩 $(babel-extensions) πŸ”—

Extensions that we consider "Javascript source files". .js and .jsx by default.

🚩 $(babel-opts) πŸ”—

Options to pass to Babel.

Licence

MIT