-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 BUG: Image imports work in development but not in production #772
Comments
I'm finding the same issue as well, even with a manual set-up. I have certain assets that I want to run through the build, for example SVGs that I want optimized using SVGO. Those are put in an When running the The only way I'm finding for the assets to be copied is to put them in the public folder. However then I can't put them through the build process. |
This definitely feels connected to #492 to a certain degree - since if we had a set way to consumed and output compiled assets this might work easier.. though I imagine that an image included in |
I think by default that would make sense, and then layering any plugins on top of that for transformations. |
I think this is likely something we are getting for free via Snowpack but not handling during the build. |
FWIW, the docs say that this should work: https://docs.astro.build/guides/imports#other-assets |
FWIW: Same bug just happened to me too (Astro v0.20.12 via NPM, Mac) |
Thanks for the report! We believe that this has been fixed in astro v0.21, going out today. Let us know if you can still reproduce the issue after updating to v0.21 and we'll be happy to take a look. |
* updating astro-related deps * updating fontsource variable imports * Updating to the latest MDIO 0.6 font * chore: lint updates * chore: a few type fixes for lint warnings * linters are the worst * TEMP: rolling back @astrojs/netlify * latest Tailwind, less specific pnpm version * ah right, language tools expects the Props type at the top! Will follow-up separately * well that's fun, the pnpm@^8.0.0 syntax is valid but fails in CI builds * lint fixes for the latest Tailwind release * just peg to pnpm@8.6.12 --------- Co-authored-by: Tony Sullivan <tony.f.sullivan@outlook.com>
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
Image imports work in development but not in production.
I have a component,
Header
(src/components/Header.astro
) that imports an image from withinsrc/
:This seems to work just fine in development mode but
astro build
doesn't copy the asset to thedist/
folder.If
buildOptions.site
is set, the image doesn't get copied but if it's commented out it does.Steps to Reproduce
npm init astro
using template ‘Starter Kit (Generic)’ with Sveltesrc/
buildOptions.site
to any hostnamedist/
folderLink to Minimal Reproducible Example (Optional)
https://github.com/matiaskorhonen/astro-image-bug
The text was updated successfully, but these errors were encountered: