When relying on output server or hybrid, and some of our pages rely on static resources (scripts/stylesheets), it is possible that the developer must run astro build two times in a row because of how the "hashes module" is generated (at the end of the build process).
However, in some circumstances, that shortcoming is avoidable. The specific circumstances are easy to define: when the only static resources that are relied upon happen to exist before the build ends (that is, when those resources are the ones present in the /public/ directory).
At this time we are still not taking advantage of these circumstances when they are present.
Proposed solution
[ ] Load JS and CSS resources from /public/ when they are available
[ ] When the "hashes module" is still not present and we enabled the SRI middleware, ensure that the generated virtual module at least exports the hashes obtained from /public/.
[ ] Ensure that we only log a warning message when loaded resources from /public/ are a strictly smaller subset of all the loaded static resources.
Problem statement
When relying on output
server
orhybrid
, and some of our pages rely on static resources (scripts/stylesheets), it is possible that the developer must runastro build
two times in a row because of how the "hashes module" is generated (at the end of the build process).However, in some circumstances, that shortcoming is avoidable. The specific circumstances are easy to define: when the only static resources that are relied upon happen to exist before the build ends (that is, when those resources are the ones present in the
/public/
directory).At this time we are still not taking advantage of these circumstances when they are present.
Proposed solution
/public/
when they are available/public/
./public/
are a strictly smaller subset of all the loaded static resources.