astro/.changeset/heavy-meals-complain.md
Alexey Shmalko c54a115e29 fix(image): allow usage of image from any directory (#5932)
Currently, @astrojs/image allows *importing* images from srcDir
only. Importing images from outside srcDir fails miserably *in dev
mode* and produces incorrect src.

This happens because `path.relative(fileURLToPath(config.srcDir), id)`
resolves to "../something" and when joined with '/@astroimage' cancels
it out (`join('/@astroimage', '../../something')` => `'/something'`).

Rework /@astroimage URL scheme to be similar to "/@fs/" scheme—always
export absolute path to the target file.
2023-02-03 12:18:19 -05:00

5 lines
66 B
Markdown

---
'@astrojs/image': minor
---
Allow images from outside srcDir