TLDR: How can I make a module (imported via ES6 syntax) globally scoped (or reference an imported class inside another class)?
I\'m importing
If you are using webpack it's easy to setup it. So here is a simple example how to implement it.
webpack.config.js
module.exports = {
entry: 'test.js',
output: {
filename: 'bundle.js',
path: 'home',
library: 'home' // it assigns this module to the global (window) object
}
...
}
some.html
Also if you open your bundle.js file you will see how webpack did it for you.
var home = // main point
/*****/ (function(modules) blablabla)
...
Also i suggest look at webpack library configuration.
I hope it will help you.
Thanks