Fix assets not getting optimized when outDir
is outside the CWD (#8670)
* Fix assets not getting optimized when `outDir` is outside the CWD * Add missing import * Add changeset * Fix import, again. * Use getOutDirWithinCwd in the serverRoot declaration
This commit is contained in:
parent
87d5b841af
commit
e797b68160
2 changed files with 7 additions and 1 deletions
5
.changeset/little-onions-relax.md
Normal file
5
.changeset/little-onions-relax.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix asset optimization failing when outDir is outside the project directory
|
|
@ -7,6 +7,7 @@ import { getConfiguredImageService, isESMImportedImage } from '../internal.js';
|
|||
import type { LocalImageService } from '../services/service.js';
|
||||
import type { ImageMetadata, ImageTransform } from '../types.js';
|
||||
import { loadRemoteImage, type RemoteCacheEntry } from './remote.js';
|
||||
import { getOutDirWithinCwd } from "../../core/build/common.js";
|
||||
|
||||
interface GenerationDataUncached {
|
||||
cached: false;
|
||||
|
@ -48,7 +49,7 @@ export async function generateImage(
|
|||
serverRoot = config.build.server;
|
||||
clientRoot = config.build.client;
|
||||
} else {
|
||||
serverRoot = config.outDir;
|
||||
serverRoot = getOutDirWithinCwd(config.outDir);
|
||||
clientRoot = config.outDir;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue