0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

refactor: assuming it should be relative path

This commit is contained in:
Josh Chappelow 2024-08-18 14:13:44 +09:00
parent 0acfe7faff
commit 08c9867ea6

View file

@ -333,9 +333,12 @@ async function emitOptimizedImages(
globalThis.astroAsset.referencedImages.add(fsPath);
}
const pathToImg = prependForwardSlash(path.relative(
ctx.astroConfig.root.pathname,
path.join(path.dirname(ctx.filePath), node.attributes.src)
));
node.attributes[attributeName] = { ...src, fsPath };
// Serve optimizedSrc as src
node.attributes.src = src.src;
node.attributes.src = pathToImg;
}
} else {
throw new MarkdocError({