Please take a look at the following code;
import * as test from "./test2.js"
function test1()
{
}
let a=1
console.log(test.b)
test.test1();
console.log( "Finished" );
<html>
<head>
<script type="module" src="./test.js"></script>
</head>
<body>
<p>Hello World!</p>
</body>
</html>
As you can see above, I import another JS file inside my module. But in this case I have two http requests in the network; one for "test.js" and one for "test2.js".
Can I send both files in one http request? I don't want to concatanate JS file. I am looking for a solution realted ES6 modules; something like "preload" keyword and please don't suggest external libraries to do it