-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
We're building via esbuild in ESM format (https://esbuild.github.io/api/#format-esm)
For which they state:
Do not forget type="module" as this will break your code in subtle and confusing ways (omitting type="module" means that all top-level variables will end up in the global scope, which will then collide with top-level variables that have the same name in other JavaScript files).
So we need to ensure scripts are fetched as modules.
Browser compatibility looks okay: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#browser_compatibility
Will just need some general testing to ensure nothing messes up, specifically since the script will be deferred.
Need to check with all elements loaded after the script.