1.3.0 • Published 7 years ago
@ahmadnassri/babel-build-all v1.3.0
Babel Build All
CLI utility to run
babel
CLI for all environments listed in your.babelrc
Install
npm install --only=production --save --global @ahmadnassri/babel-build-all
Usage
$ babel-build-all
- will look in the environment
$PATH
forbabel
executable - recommended ton use within an
npm-script
to auto populate$PATH
values
package.json
"scripts": {
...
"build": "babel-build-all",
...
}
assuming the following .babelrc
and content of src
folder in your project:
.babelrc
{
"env": {
"node4": {
"presets": [ ["env", { "targets": { "node": 4.0 } }] ],
"plugins": [...]
},
"node6": {
"presets": [ ["env", { "targets": { "node": 6.0 } }] ],
"plugins": [...]
},
"default": {
"presets": [ ["env", { "targets": { "node": 7.0 } }] ],
"plugins": [...]
}
}
}
./src
src
└── index.js
running babel-build-all
will produce target builds matching env
names in .babelrc
:
./build
build
├── node4
│ └── index.js
├── node6
│ └── index.js
└── default
└── index.js
:copyright: ahmadnassri.com · License: ISC · Github: @ahmadnassri · Twitter: @ahmadnassri