babel-plugin-transform-hoist-loose-functions
This plugin hoists functions in loose-mode to their enclosing function or program scope.
This plugin was primarily developed to support using babel-minify on non-strict ES5 and below. Currently babel-minify has problems with non-strict nested functions.
Example
In
{ if a {} }
Out
{ {} if a {}}
Installation
npm install babel-plugin-transform-hoist-loose-functions
Usage
.babelrc
(Recommended)
Via .babelrc
Via CLI
babel --plugins transform-hoist-loose-functions script.js
Via Node API
;
Options
None