Skip to content

TrySound/babel-plugin-iife-wrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-iife-wrap Build Status

Wrap file with iife.

Install

With npm do:

npm i babel-plugin-iife-wrap --D

Example

Input

window.a = 1;

Output

;(function () {
  window.a = 1;
}());

Usage

In your Babel configuration:

{
  "plugins": ["iife-wrap"]
}

Note that Webpack outputs a bundle wrapped with iife by default.

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Bogdan Chadkin

About

Babel plugin to wrap file with iife

Resources

License

Stars

Watchers

Forks

Packages

No packages published