@divriots/jampack 0.11.6 → 0.11.7

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.
@@ -18,6 +18,7 @@ export async function compressCSS(originalCode, type) {
18
18
  catch (e) {
19
19
  // Error while processing with lightningcss
20
20
  // Take original code
21
+ // TODO catch SyntaxError and report a Warning
21
22
  }
22
23
  let resultBuffer = undefined;
23
24
  if (lightCSSData && lightCSSData.length < originalCode.length) {
@@ -6,8 +6,8 @@ const default_options = {
6
6
  embed_size: 1500,
7
7
  srcset_min_width: 640,
8
8
  external: {
9
- process: 'download',
10
- src_include: /.*/,
9
+ process: 'off',
10
+ src_include: /^.*$/,
11
11
  src_exclude: null,
12
12
  },
13
13
  compress: true,
@@ -11,8 +11,8 @@ export type Options = {
11
11
  embed_size: number;
12
12
  srcset_min_width: number;
13
13
  external: {
14
- process: 'download' | 'add-dimensions-only' | 'off';
15
- src_include: RegExp | undefined;
14
+ process: 'download' | 'cdn-srcset-when-possible' | 'add-dimensions-only' | 'off';
15
+ src_include: RegExp;
16
16
  src_exclude: RegExp | null;
17
17
  };
18
18
  compress: boolean;
package/dist/optimize.js CHANGED
@@ -80,7 +80,7 @@ async function analyse(file) {
80
80
  }
81
81
  // Add CSS to head
82
82
  if (config.html.add_css_reset_as === 'inline') {
83
- const CSS = `<style>:where(img){height:auto;width:auto}</style>`;
83
+ const CSS = `<style>:where(img){height:auto;}</style>`;
84
84
  const heads = $('head');
85
85
  if (heads.length > 0) {
86
86
  heads.prepend(CSS);
@@ -195,9 +195,12 @@ async function processImage(htmlfile, $, imgElement, isAboveTheFold) {
195
195
  case 'download':
196
196
  // Download external image for local processing
197
197
  break;
198
+ case 'cdn-srcset-when-possible':
199
+ // Use unpic to use CDN capabilities
200
+ throw new Error('External images with `cdn-srcset-when-possible` is not implemented yet.');
198
201
  case 'add-dimensions-only':
199
202
  // Only add dimensions of image
200
- return;
203
+ throw new Error('External images with `add-dimensions-only` is not implemented yet.');
201
204
  }
202
205
  }
203
206
  /*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divriots/jampack",
3
- "version": "0.11.6",
3
+ "version": "0.11.7",
4
4
  "description": "Packer for static websites",
5
5
  "author": "Georges Gomes @georges-gomes",
6
6
  "bin": {