image-minimizer-webpack-plugin
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -521,3 +521,3 @@ "use strict"; | ||
await imageminNormalizeConfig( /** @type {ImageminOptions} */ | ||
/** @type {?} */minimizerOptions || {}); | ||
/** @type {?} */minimizerOptions ?? {}); | ||
@@ -547,3 +547,4 @@ // @ts-ignore | ||
filename: newFilename, | ||
data: result, | ||
// imagemin@8 returns buffer, but imagemin@9 returns uint8array | ||
data: !Buffer.isBuffer(result) ? Buffer.from(result) : result, | ||
warnings: [...original.warnings], | ||
@@ -567,3 +568,3 @@ errors: [...original.errors], | ||
const minimizerOptionsNormalized = /** @type {ImageminOptions} */ | ||
await imageminNormalizeConfig( /** @type {ImageminOptions} */ /** @type {?} */options || {}); | ||
await imageminNormalizeConfig( /** @type {ImageminOptions} */ /** @type {?} */options ?? {}); | ||
@@ -595,3 +596,4 @@ // @ts-ignore | ||
filename: original.filename, | ||
data: result, | ||
// imagemin@8 returns buffer, but imagemin@9 returns uint8array | ||
data: !Buffer.isBuffer(result) ? Buffer.from(result) : result, | ||
warnings: [...original.warnings], | ||
@@ -666,3 +668,3 @@ errors: [...original.errors], | ||
const image = imagePool.ingestImage(new Uint8Array(original.data)); | ||
const squooshOptions = /** @type {SquooshOptions} */minifyOptions || {}; | ||
const squooshOptions = /** @type {SquooshOptions} */minifyOptions ?? {}; | ||
const preprocEntries = Object.entries(squooshOptions).filter(([key, value]) => { | ||
@@ -762,3 +764,3 @@ if (key === "resize" && value?.enabled === false) { | ||
const image = imagePool.ingestImage(new Uint8Array(original.data)); | ||
const squooshOptions = /** @type {SquooshOptions} */options || {}; | ||
const squooshOptions = /** @type {SquooshOptions} */options ?? {}; | ||
const preprocEntries = Object.entries(squooshOptions).filter(([key, value]) => { | ||
@@ -1006,3 +1008,3 @@ if (key === "resize" && value?.enabled === false) { | ||
encodeOptions | ||
} = /** @type {SvgoOptions} */minimizerOptions; | ||
} = /** @type {SvgoOptions} */minimizerOptions ?? {}; | ||
@@ -1009,0 +1011,0 @@ /** @type {import("svgo").Output} */ |
{ | ||
"name": "image-minimizer-webpack-plugin", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Webpack loader and plugin to optimize (compress) images using imagemin", | ||
@@ -41,3 +41,3 @@ "license": "MIT", | ||
"test": "npm run test:coverage", | ||
"prepare": "husky install && npm run build", | ||
"prepare": "husky && npm run build", | ||
"release": "standard-version" | ||
@@ -80,6 +80,6 @@ }, | ||
"@babel/preset-env": "^7.24.5", | ||
"@commitlint/cli": "^18.6.1", | ||
"@commitlint/config-conventional": "^18.6.2", | ||
"@commitlint/cli": "^19.3.0", | ||
"@commitlint/config-conventional": "^19.2.2", | ||
"@squoosh/lib": "^0.5.3", | ||
"@types/imagemin": "^8.0.5", | ||
"@types/imagemin": "^9.0.0", | ||
"@types/node": "^20.12.8", | ||
@@ -106,5 +106,5 @@ "@types/serialize-javascript": "^5.0.4", | ||
"file-type": "^16.5.4", | ||
"husky": "^8.0.3", | ||
"husky": "^9.0.11", | ||
"image-size": "^1.1.1", | ||
"imagemin": "^8.0.1", | ||
"imagemin": "^9.0.0", | ||
"imagemin-avif": "^0.1.6", | ||
@@ -127,3 +127,3 @@ "imagemin-gifsicle": "^7.0.0", | ||
"standard-version": "^9.5.0", | ||
"svgo": "^3.2.0", | ||
"svgo": "^3.3.2", | ||
"tempy": "^1.0.1", | ||
@@ -130,0 +130,0 @@ "typescript": "^5.4.5", |
147277
2490