Fix: image service warning #299
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Saw this warning in the console:
Moving the image service config to the adapter fixes this.
Associated issue
N.A.
How to test
Compare outputs:
This is where it occured to me: https://github.com/voorhoede/head-start/actions/runs/16499688786/job/46654533282#step:7:13
This has the fix: https://github.com/voorhoede/head-start/actions/runs/16499833417/job/46655076140#step:7:13
Result
Setting
imageServicetocompile, will result in Astro processing the image for every size which is used in the project. The next examples shows how Astro processes the images withimageService: 'compile'. Setting the option topasstroughwill result in that the images never get processed.In this example Astro will prerender the page and process the image during build which will result in multiple versions for the different sizes as you can see in the image:
When setting prerender to false. Astro won't process the image during build, however wil still serve the original image file:
Checklist
I have made updated relevant documentation files (in project README, docs/, etc)I have added a decision log entry if the change affects the architecture or changes a significant technology