:bug: BugGood First Issue✨ Parcel 2
描述
Native module scripts (e.g. <script type="module">) are typically loaded by browsers with high priority. However, when targeting browsers without native support, Parcel inserts <script defer nomodule> tags, which are loaded with low priority. See https://addyosmani.com/blog/script-priorities/.
With that said, these scripts still need the defer attribute to emulate the execution timing of native modules. One workaround to boost priority of deferred scripts is to also insert a <link rel="preload" as="script"> into the document head with an href with the same value as the script's src.
We should consider adding these link tags as well when including js targeted at these environments.
Related: #6980