@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.
@@ -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,
@@ -23,6 +23,7 @@ export type Options = {
23
23
  embed_size: number;
24
24
  srcset_min_width: number;
25
25
  srcset_max_width: number;
26
+ srcset_step: number;
26
27
  max_width: number;
27
28
  src_include: RegExp;
28
29
  src_exclude: RegExp | null;
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 = 300; //px
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divriots/jampack",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
4
4
  "cache-version": {
5
5
  "img": "v1",
6
6
  "img-ext": "v1"