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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "routerino",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "A lightweight, SEO-optimized React router for modern web applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -120,11 +120,13 @@ async function generateResponsiveImages(
120
120
  variants: {},
121
121
  };
122
122
 
123
- // Generate responsive variants for each width
124
- for (const width of config.widths) {
125
- // Skip if image is smaller than target width
126
- if (dimensions && dimensions.width < width) continue;
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");