@monkeyplus/flow 6.0.36 → 6.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -146,14 +146,16 @@ export async function materializeGeneratedImages(config) {
|
|
|
146
146
|
...image,
|
|
147
147
|
signature
|
|
148
148
|
};
|
|
149
|
-
const outputPath = outputFilePath(config.outputDir, image.generate);
|
|
150
|
-
const cacheRelativePath = normalizeOutputPath(image.generate);
|
|
149
|
+
const outputPath = outputFilePath(config.outputDir, config.useIpxPath ? image.url : image.generate);
|
|
150
|
+
const cacheRelativePath = normalizeOutputPath(config.useIpxPath ? image.url : image.generate);
|
|
151
151
|
const cachePath = config.generatedCacheDir ? outputFilePath(config.generatedCacheDir, cacheRelativePath) : void 0;
|
|
152
152
|
activeCacheFiles.add(cacheRelativePath);
|
|
153
153
|
await ensureParentDir(outputPath);
|
|
154
|
-
const publicPreGeneratedPath = outputFilePath(config.publicDir, image.
|
|
154
|
+
const publicPreGeneratedPath = outputFilePath(config.publicDir, image.url);
|
|
155
155
|
if (existsSync(publicPreGeneratedPath)) {
|
|
156
|
-
|
|
156
|
+
if (publicPreGeneratedPath !== outputPath) {
|
|
157
|
+
await copyFile(publicPreGeneratedPath, outputPath);
|
|
158
|
+
}
|
|
157
159
|
return { cacheHit: 1, generated: 0 };
|
|
158
160
|
}
|
|
159
161
|
if (config.netlifyCache && cachePath && previousManifest[imageKey]?.signature === signature && existsSync(cachePath)) {
|
|
@@ -168,8 +168,8 @@ export function createImageResolver(imagesOptions, stateImages, runtime = {}) {
|
|
|
168
168
|
baseDir = getBaseDir(replacedPath, imagesOptions.dirImages);
|
|
169
169
|
}
|
|
170
170
|
const modifierSegment = getModifierSegment(image.modifiers);
|
|
171
|
-
const
|
|
172
|
-
image.generate = joinURL(
|
|
171
|
+
const relativePath = getRelativePath(replacedPath, baseDir);
|
|
172
|
+
image.generate = joinURL(`/${baseDir}`, modifierSegment === "_" ? "" : modifierSegment, relativePath);
|
|
173
173
|
if (originalExt) {
|
|
174
174
|
image.generate = image.generate.replace(originalExt, image.ext);
|
|
175
175
|
} else if (!image.generate.includes(".") && image.ext) {
|