Suppose that I have class like this (written in typescript) and I bundle it with webpack into bundle.js
.
export class EntryPoint {
static run() {
...
}
}
In my index.html I will include the bundle, but then I would also like to call that static method.
<script src="build/bundle.js"></script>
<script>
window.onload = function() {
EntryPoint.run();
}
</script>
However, the EntryPoint
is undefined in this case. How would I call the bundled javascript from another script then?
Added: Webpack config file.