routerino 2.3.0 → 2.3.1
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.
- package/package.json +1 -1
- package/routerino-forge.js +6 -4
package/package.json
CHANGED
package/routerino-forge.js
CHANGED
|
@@ -120,11 +120,13 @@ async function generateResponsiveImages(
|
|
|
120
120
|
variants: {},
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
// Filter widths to only include those applicable to this image
|
|
124
|
+
const applicableWidths = config.widths.filter(
|
|
125
|
+
(width) => !dimensions || dimensions.width >= width
|
|
126
|
+
);
|
|
127
127
|
|
|
128
|
+
// Generate responsive variants for applicable widths only
|
|
129
|
+
for (const width of applicableWidths) {
|
|
128
130
|
// Generate WebP version in output directory
|
|
129
131
|
const webpPath = path.join(outputDir, `${base}-${width}w.webp`);
|
|
130
132
|
await generateImageVariant(inputPath, webpPath, width, "webp");
|