-
Notifications
You must be signed in to change notification settings - Fork 18
Fix des images par défauts qui se supprimaient dans dist/images/
#469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Configures CleanWebpackPlugin to preserve the images directory and its contents during the cleaning process. This prevents the deletion of images when cleaning the dist folder.
Reviewer's GuideAdds configuration to CleanWebpackPlugin so that the dist/images directory and its contents are preserved during builds, preventing default images from being deleted, with no behavioral changes to other Webpack plugins. Sequence diagram for Webpack build with preserved dist/imagessequenceDiagram
actor Developer
participant Webpack
participant CleanWebpackPlugin
participant WebpackImageSizesPlugin
participant DistFolder as dist
participant ImagesFolder as dist_images
Developer->>Webpack: run build
Webpack->>CleanWebpackPlugin: initialize with patterns
CleanWebpackPlugin->>DistFolder: remove files matching **/*
CleanWebpackPlugin-->>ImagesFolder: skip images and images/**
CleanWebpackPlugin-->>Webpack: cleaning complete
Webpack->>WebpackImageSizesPlugin: run plugin
WebpackImageSizesPlugin->>ImagesFolder: generate default images
WebpackImageSizesPlugin-->>Webpack: generation complete
Webpack-->>Developer: build finished with images preserved
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- The change from two-space indentation to tabs in
config/plugins.jsmakes the file formatting inconsistent with the previous style; consider reverting to the original indentation to keep the file uniform. - The CleanWebpackPlugin exclusion
['**/*', '!images', '!images/**']will preserve the entireimagesdirectory and all its contents; if the goal is only to protect specific default assets, consider narrowing the pattern to those files (e.g.,!images/default-*.jpg) to avoid retaining stale or unused images between builds.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The change from two-space indentation to tabs in `config/plugins.js` makes the file formatting inconsistent with the previous style; consider reverting to the original indentation to keep the file uniform.
- The CleanWebpackPlugin exclusion `['**/*', '!images', '!images/**']` will preserve the entire `images` directory and all its contents; if the goal is only to protect specific default assets, consider narrowing the pattern to those files (e.g., `!images/default-*.jpg`) to avoid retaining stale or unused images between builds.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Description
Ce fix apporte une configuration sur le plugin CleanWebpackPlugin pour préserver le dossier images et ses contenus durant le processus. Cela évite la suppression des images par défaut notamment.
Lignes réellement modifiées
Summary by Sourcery
Bug Fixes: