babel-plugin-func-wrap

Wrap the whole script in a function — export as CommonJS, ES Modules, IIFE, or a global variable

global-var

Get the correct 'global' variable for the current runtime environment (`window` in browser, `global` in node, etc)