auto-babel v0.4.0
auto-babel
auto-babel is a project that aims to bring autoprefixer-like functionality to babel.
Word of warning
Use with caution: the tests run (es-feature-tests) aren't indicate of perfect spec compliance.
Using auto-babel
auto-babel outputs a list of transformers to blacklist based on feature support. For example, if all the browsers and environments you target support let and const, you don't need to run the es6.blockScoping transpiler.
API
var autoBabel = require('auto-babel');
var blacklistedTransformers = autoBabel('last 2 versions', '> 0.12.7');
babel.transform(code, { blacklist: blacklistedTransformers });CLI
./cli.js -e 'last 2 Chrome versions' -n '> 0.12.7'
[ 'es6.blockScoping',
'es6.constants',
'es6.spec.blockScoping',
'es6.spec.symbols',
'es6.spec.templateLiterals',
'es6.templateLiterals',
'regenerator' ]Running the tests
Environment setup
Install the grunt command line tool
npm install grunt-cli -gInstall project dependencies
npm installnode/iojs tests
Run the tests
make run-nodeFiles are output to "build/results" in json format
Browser tests
The browser tests are run using sauce labs so all tests can be run from a single computer.
1 - Add sauce labs credentials.
export SAUCE_USERNAME=$USERNAME
export SAUCE_ACCESS_KEY=$KEY2 - Set up sauce connect tunnel
node_modules/sauce-tunnel/vendor/linux/bin/sc -D featuretests.io3 - Run the tests
make run-browserProcess results
node processResults.js creates/updates the data.json file used at runtime.