Conversation
Contributor
|
forcer la transformation de toutes les images en WebP |
Contributor
|
tester |
- Added imagemin-webp to package.json and updated yarn.lock. - Configured WebP generation in webpack.common.js. - Updated SCSS files to support WebP images. - Removed obsolete logo SVG file.
Replace yarn set version berry with corepack enable to match packageManager and avoid lockfile v8→v9 migration blocked in PRs. Upgrade actions/setup-node to v4 with yarn cache.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 50732ce. Configure here.
…ate instance Move ImageMinimizerPlugin to plugins (generator + optional prod minifier) so ?as=webp works when minimization is off. Remove it from optimization.minimizer to keep a single instance and avoid asset name conflicts. Minor shorthand for mode in dev/prod config.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Sur la base de cette doc : https://webpack.js.org/plugins/image-minimizer-webpack-plugin/#loader-generator-example-for-imagemin
Par défaut webpack va garder également le fichier non converti dans le dossier compilé.
Pour l'appel au fichier dans le code, il faut lui passer l'option
presetdu generator :?as=webpExemple :
background-image: url(../img/static/logo.jpg?as=webp)et Webpack viendra automatiquement convertir le fichier en webp et remplacer l'url :background-image: url(images/logo.webp)Exemple :
background-image: url(../img/static/logo.jpg)et Webpack ne fera pas la conversion et gardera le fichier jpg :background-image: url(images/logo.jpg)La conversion se fait au
yarn buildSi elle doit se faire aussi en mode dev, il faudrait déplacer le code au dessus :
Note
Medium Risk
Build pipeline now rewrites image URLs to generated WebP assets and changes how images are processed in dev vs prod, which could break asset paths or output if misconfigured. CI also changes yarn/node setup (Corepack + cached yarn), which can surface lockfile/packaging issues.
Overview
Adds WebP support by configuring
ImageMinimizerPluginas a webpack loader/generator so assets requested with?as=webpare emitted as.webp(and keeps production-only minification in the same plugin instance).Updates SCSS (
background-staticmixin and login logo) to request WebP variants via?as=webp, adds theimagemin-webpdependency, and removes the now-unusedlogo-beapi.svg.Modernizes GitHub Actions by enabling Corepack, upgrading
actions/setup-nodetov4, and enabling Yarn caching.Reviewed by Cursor Bugbot for commit 56120c3. Bugbot is set up for automated code reviews on this repo. Configure here.