@divriots/jampack 0.9.0 → 0.9.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/cache.js +1 -1
- package/dist/optimize.js +2 -3
- package/package.json +1 -1
package/dist/cache.js
CHANGED
|
@@ -26,7 +26,7 @@ async function cleanCache(full) {
|
|
|
26
26
|
// Delete old cache versions
|
|
27
27
|
await files
|
|
28
28
|
.filter((f) => f !== VERSION)
|
|
29
|
-
.forEach(async (f) => fs.
|
|
29
|
+
.forEach(async (f) => fs.rm(path.join(CACHE_FOLDER, f), { recursive: true }));
|
|
30
30
|
}
|
|
31
31
|
function computeCacheHash(buffer, options) {
|
|
32
32
|
if ($state.args.nocache) {
|
package/dist/optimize.js
CHANGED
|
@@ -249,9 +249,8 @@ async function processImage(htmlfile, $, imgElement, isAboveTheFold) {
|
|
|
249
249
|
* Only above the fold
|
|
250
250
|
*/
|
|
251
251
|
let isEmbed = false;
|
|
252
|
-
let imageToEmbed;
|
|
253
252
|
if (isAboveTheFold) {
|
|
254
|
-
imageToEmbed = newImage;
|
|
253
|
+
let imageToEmbed = newImage;
|
|
255
254
|
// If new image was not generated then take the old image
|
|
256
255
|
if (!imageToEmbed) {
|
|
257
256
|
imageToEmbed = {
|
|
@@ -287,7 +286,7 @@ async function processImage(htmlfile, $, imgElement, isAboveTheFold) {
|
|
|
287
286
|
}
|
|
288
287
|
}
|
|
289
288
|
}
|
|
290
|
-
if (isEmbed && (
|
|
289
|
+
if (isEmbed && (await originalImage.getExt()) === 'svg') {
|
|
291
290
|
// SVG has a different behaviour with image size
|
|
292
291
|
// Needs to be tested more
|
|
293
292
|
// For the moment skip image size for SVG
|