0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/integrations/image/test/fixtures/basic-picture
Alexey Shmalko b3e65991f7
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-01-30 15:29:41 -05:00
..
public
server
src fix(image): allow usage of image from any directory (#5932) 2023-01-30 15:29:41 -05:00
astro.config.mjs Adding an optional image service based on Squoosh (#4738) 2022-09-22 19:48:14 +00:00
package.json Adding an optional image service based on Squoosh (#4738) 2022-09-22 19:48:14 +00:00
social.png fix(image): allow usage of image from any directory (#5932) 2023-01-30 15:29:41 -05:00