You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The /elm.hash.js file is being downloaded twice during page load, which is unnecessary and impacts performance.
This issue is visible on the elm-pages documentation website itself.
Problem
The
/elm.hash.js
file is being downloaded twice during page load, which is unnecessary and impacts performance.This issue is visible on the elm-pages documentation website itself.
Reproduction
/elm.53193920.js
file being downloaded twiceExpected Behavior
The Elm JavaScript file should be downloaded only once.
Proposed Solution
In the HTML (of the docs website), there are duplicate references to the same Elm JavaScript file:
I propose to replace
modulepreload
withpreload
and sync thecrossorigin
attribute for both the tags:Solution A
Solution B
Why?
crossorigin
should be present or absent in both the tags: https://issues.chromium.org/issues/40500102#comment15rel="modulepreload"
should be used for module scripts (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/modulepreload), so it should either be removed for normal scripts or (Solution C?) Elm should be compiled to a module and handled by Vite (for example, by using this script https://github.com/ChristophP/elm-esm/blob/master/src/index.js).I hope this is helpful, I could also make a PR with the solution you prefer, if that’s ok 😁
The text was updated successfully, but these errors were encountered: