If you have 2 <script> tags that share a dependency, that dependency will get chunked out if it is above a certain size (is this size threshold documented somewhere?).
However, this can yield non-standard behavior compared to using normal ES modules. For example, exporting an object, all importers will get a reference to the same object. So one function change the object, other importers should see those changes.
The second script tag would have to import that shared module from the first script tag (a mechanism for that exists already).
But sharing local variables between the script tags is still something we wouldn't support (what do you think?)
(How I think we could implement it)
I think taking all the script tags as one bundlegroup and each script tag as a bundle would automatically cause that behavior. Currently we completely ignore that fact that these bundles are actually related (so two script tags behave just like two worker calls - which is quite a simplification).
that dependency will get chunked out if it is above a certain size (is this size threshold documented somewhere?).