How to make sure the script tag run in the order I define and also synchronously, because in the module I will import some other module remotely, and then use it later.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script defer="false" async="false" type="module">
// will have import some module remotely here as well
console.log('one');
</script>
<script defer="false" async="false" type="text/javascript">
console.log('two');
</script>
<script defer="false" async="false" type="module">
console.log('three');
</script>
<script defer="false" async="false" type="text/javascript">
console.log('four');
</script>
</body>
</html>
Console Output:
two
four
one
three
My finding is the engine will run all the vanilla script in order first then only run the module script in order. How can I change this behavior?