babel-plugin-global-scope
v1.0.5
Published
Turns all module scoped members into global members
Downloads
547
Readme
Babel plugin global scope
Transforms previously module scoped variables into globally scoped window properties
npm install babel-plugin-global-scope
Before
var globalVarA, globalVarB;
function globalFunc() {
var foo = "bar";
}
class GlobalClass {
}
After
var globalVarA, globalVarB;
function globalFunc() {
var foo = "bar";
}
class GlobalClass {
}
window.globalVarA = globalVarA;
window.globalVarB = globalVarB;
window.globalFunc = globalFunc;
window.GlobalClass = GlobalClass;