Related to https://github.com/tcoopman/image-webpack-loader/pull/412, this PR upgrades imagemin-webp from v6 to v7. Per the release notes, v7 changes it output format to ESM which necessitates the use of import instead of require, which can also be noted in the failing CI in the above linked PR from dependabot:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/runner/work/image-webpack-loader/image-webpack-loader/node_modules/imagemin-webp/index.js
require() of ES modules is not supported.
After changing to import, the previously failing npm run test is now passing while using imagemin-webp@7.
This is required to upgrade/remove a transient dependency trim-newlines which currently has a "High" security vulnerability, causing Dependabot alerts across several repositories.
Related to https://github.com/tcoopman/image-webpack-loader/pull/412, this PR upgrades
imagemin-webp
from v6 to v7. Per the release notes, v7 changes it output format to ESM which necessitates the use ofimport
instead ofrequire
, which can also be noted in the failing CI in the above linked PR from dependabot:After changing to
import
, the previously failingnpm run test
is now passing while usingimagemin-webp@7
.This is required to upgrade/remove a transient dependency
trim-newlines
which currently has a "High" security vulnerability, causing Dependabot alerts across several repositories.