@divriots/jampack 0.27.0 → 0.27.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/dist/config-default.js +1 -0
- package/dist/config-types.d.ts +1 -0
- package/dist/optimize.js +1 -1
- package/package.json +1 -1
package/dist/config-default.js
CHANGED
|
@@ -16,6 +16,7 @@ const default_options = {
|
|
|
16
16
|
embed_size: 1500,
|
|
17
17
|
srcset_min_width: 390 * 2, // HiDPI phone
|
|
18
18
|
srcset_max_width: 1920 * 2, // 4K
|
|
19
|
+
srcset_step: 300,
|
|
19
20
|
max_width: 99999,
|
|
20
21
|
src_include: /^.*$/,
|
|
21
22
|
src_exclude: /^\/vercel\/image\?/, // Ignore /vervel/image? URLs because not local and most likely already optimized,
|
package/dist/config-types.d.ts
CHANGED
package/dist/optimize.js
CHANGED
|
@@ -564,7 +564,7 @@ async function _generateSrcSet({ options }, startSrc, imageWidth, imageHeight, t
|
|
|
564
564
|
return null;
|
|
565
565
|
}
|
|
566
566
|
// Start reduction
|
|
567
|
-
const step =
|
|
567
|
+
const step = options.image.srcset_step; //px
|
|
568
568
|
let valueW = !startSrc ? imageWidth : imageWidth - step;
|
|
569
569
|
valueW = Math.min(valueW, options.image.srcset_max_width);
|
|
570
570
|
while (valueW >= options.image.srcset_min_width) {
|