babel-plugin-transform-variable-declarations-with-var

1.0.4 • Public • Published

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]);
}

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-transform-variable-declarations-with-var

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

4.29 kB

Total Files

6

Last publish

Collaborators

  • budarin