Hi, New here! Really enjoying the hard work that has been put into the project thus far 😸
I've been experiencing multiple script imports of the same file in the index.html outputted by gatsby build.
gatsby new site cd sitegatsby build (doesn't happen in develop)public/ using a simple server and view in browser, see multiple resources being loaded twice.Resources should only be loaded once? Not sure if there is some reason why they are done twice
They get loaded twice.

npm list gatsby): [email protected]gatsby --version): 1.1.51NA
To my knowledge, double script imports doesn't cause double script loading. And we do have doubled scripts import because first ones are written to html files, so it start fetching them as fast as possible on browsers that don't supporting link preloads. Second "copies" of scripts are caused by webpack runtime that adds those dynamically to <head> (you can view html to see there are not there initially) when we want to load them (that's how we prefetch needed data and components for pages that user might go next).
Agree with @pieh that this shouldn't be a problem as the browser dedupes requests. Could you check the network tab in your browser dev tools to verify that there isn't multiple downloads happening?
@KyleAMathews yeah that's what confused me initially, as firefox displays it's loading both, while chrome does not 😕
Firefox:

Chrome:

EDIT:
Just noticed that firefox displays in the bottom status bar 2.32 MB / 1.15 MB transferred. So it seems like it just displays it in the network page but only loads it once
Oh interesting — that's not good.
Sorry just updated my comment. So I don’t think it’s an issue, just Firefox being a bit weird. Haven’t tested if it affects performance/load times
Hi there 👋
Actually, if you have several script tags with the same source file, it will be loaded once but, it will be parsed and executed at each call... (more on that here).
What about putting only one script tag and add a to properly preload it as soon as possible?
cc @KyleAMathews @pieh @wemyss