babel-plugin-transform-variable-declarations-with-var
v1.0.4
Published
Babel plugin for replacing const and let variable declarations with var kind
Downloads
9
Readme
babel-plugin-transform-variable-declarations-with-var
Transforms const and let variable declarations with var kind
Install
Using npm:
npm install --save-dev babel-plugin-transform-variable-declarations-with-var
or using yarn:
yarn add babel-plugin-transform-variable-declarations-with-var --dev
Usage
With a configuration file (Recommended)
return {
plugins: ['babel-plugin-transform-variable-declarations-with-var'],
};
Examples
In
const a = 1;
const array = [1, 2, 3, a];
let b = 'a';
for (let i = 0; i < array.length; i++) {
b = b + String(array[i]);
}
Out
var a = 1;
var array = [1, 2, 3, a];
var b = 'a';
for (var i = 0; i < array.length; i++) {
b = b + String(array[i]);
}