I have a Javascript module called out.js
export default function out(str) {
//Some Code
console.log(str);
}
I ran the webpack bundler and created a bundle.js file. And now I am Importing it to my index.html using a tag.
<!DOCTYPE html>
<html>
<head><script defer src="bundle.js"></script></head>
<body>
<script>
out("Hello")
</script>
</body>
</html>
But when I get the following error on the webpage.
index.html:6 Uncaught ReferenceError: out is not defined
I have tried named exports as well as default exports for the out.js, still I get the same error.