tools.js:
function someFunction() {
console.log(1 + 1);
}
export { someFunction };
main.js
window.onload = function() {
import { someFunction } from 'tools';
};
index.html:
<script src="http://localhost:8080/tools.js" type="module"></script>
<script src="http://localhost:8080/main.js "></script>
And yet I get the error on the subject. What am I doing wrong? Thanks.
importstatements outside the top lines of your file.