I'm trying to understand ES6 modules in JavaScript. My understanding is that this generates a get-request to the server to fetch SomeClass.js:
<script src="path/SomeClass.js"></script>
If SomeClass is a module, I can do:
import {SomeClass} from "path/SomeClass.js"
Does this also generate the same request to the server? If I import the same module from two separate files, are two redundant requests being generated? If this is the case, are there good ways to do this more efficiently (e.g. importing in a parent class and then passing it to any children that need it)?
Please correct my understanding if I am way off.