Answer the question
In order to leave comments, you need to log in
How to get a variable from a script compiled by Babel?
module.js
const Module = (() => {
class Module {
static init() {
alert('it works!')
}
}
return Module
})()
export default Module
import Module from './module'
export { Module }
<script src="app.js"></script>
<script>
Module.init();
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question