babel-plugin-transform-block-scope-to-iife
Replaces brackets used as scope in a file by an IIFE.
This prevents exposing variables in window
when const
or let
are transformed to var
after transpiling to ES5.
Input:
const Element = Polymer;
Output:
{ const Element } = Polymer;};
Install
npm i babel-plugin-transform-block-scope-to-iife
Usage
.babelrc
)
With a configuration file (
Via Node API
;
License
This project is licensed under the MIT License.