I have been trying to package a super simple ES6 style class object to the browser. Example
class Foo {
constructor(){
this.name = "Foo";
}
}
module.exports = Foo;
Sure I can use this in my node projects just fine, but it's also a useful object for the browser. So far I have tried webpack and browserify, but they do not expose the object globally. I was hoping to basically include the generated script file and be able to call let foo = new Foo() from the browser. How can I do this?
*note that literally the only thing stopping me from just including the file in the browser directly is the module.exports