@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.
- package/dist/compressors/css.js +1 -0
- package/dist/config-default.js +2 -2
- package/dist/config-types.d.ts +2 -2
- package/dist/optimize.js +5 -2
- package/package.json +1 -1
package/dist/compressors/css.js
CHANGED
|
@@ -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) {
|
package/dist/config-default.js
CHANGED
package/dist/config-types.d.ts
CHANGED
|
@@ -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
|
|
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;
|
|
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
|
-
|
|
203
|
+
throw new Error('External images with `add-dimensions-only` is not implemented yet.');
|
|
201
204
|
}
|
|
202
205
|
}
|
|
203
206
|
/*
|