1.3.0 • Published 9 years ago
@ahmadnassri/babel-build-all v1.3.0
Babel Build All

CLI utility to run
babelCLI for all environments listed in your.babelrc
Install
npm install --only=production --save --global @ahmadnassri/babel-build-allUsage
$ babel-build-all- will look in the environment
$PATHforbabelexecutable - recommended ton use within an
npm-scriptto auto populate$PATHvalues
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.jsrunning 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