Read babel plugin handbook -> https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md
Try http://astexplorer.net/#/Pcw9baefXI for a visual understanding.
Add a description for the plugin here
In
let tips = [
"Paste or drop some JavaScript here and explore the syntax tree created by chosen parser.",
"You can use all the cool new features from ES6 and even more. Enjoy!"
];
function printTips() {
tips.forEach((tip, i) => console.log(`Tip ${i}:` + tip));
}
Out
let spit = ["Paste or drop some JavaScript here and explore the syntax tree created by chosen parser.", "You can use all the cool new features from ES6 and even more. Enjoy!"];
function spiTtnirp() {
spit.hcaErof((pit, i) => elosnoc.gol(`Tip ${ i }:` + pit));
}
$ npm install babel-plugin-boilerplate
.babelrc
{
"plugins": ["boilerplate"]
}
$ babel --plugins boilerplate script.js
require("babel-core").transform("code", {
plugins: ["boilerplate"]
});