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:
parent
0acfe7faff
commit
08c9867ea6
1 changed files with 5 additions and 2 deletions
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue