fait-babel v1.0.0
installation
fait-babel requires fait. Install them both with:
npm install --save-dev fait fait-babelfait 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
9 years ago