Ability to remap @JSImport
s at linking time
#4837
Labels
enhancement
Feature request (that does not concern language semantics, see "language")
separate repo
Addressing this issue should be done in a separate repository. Closed here.
An interesting alternative to bundling is loading dependencies from a CDN. esm.run for example serves dependencies as minified, bundled ESM modules.
The catch is that import statements need refer to the CDN urls. If you control all the
@JSImport
s used by your application this is fine, but in general libraries will not want to hard-code a particular CDN into their imports. So ideally there would be a way to remap the imports at application linking time.Many browsers offer an "importmap" feature to achieve this kind of remapping. Still, I think this is an interesting feature for Scala.js itself, because it allows to deploy "self-contained" JS files that would work in any browser that supports ESM as well as Node.js (or Deno), without requiring additional configuration to remap imports.
The text was updated successfully, but these errors were encountered: