Find Unused Images is a lightweight VS Code extension designed to help developers clean up their projects by identifying image files that are no longer referenced in the codebase.
✨ Features
Custom Scope: Specify the directory to scan for images and the directory to search for references (e.g., scan images in src/assets but search for usages in src/).
Flexible Scanning: Supports common image formats (.png, .jpg, .jpeg, .gif, .svg, .webp, .ico, .bmp) and ignores standard build folders (node_modules, dist, etc.).
Visual Report: Generates a Markdown report listing all unused images with clickable links for quick verification.
🚀 Usage
Open your project in VS Code.
Open the Command Palette (Cmd+Shift+P on macOS / Ctrl+Shift+P on Windows).
Type and select "Find Unused Images".
Follow the prompts:
Image Directory: Enter the relative path of your image folder (e.g., src/assets). Leave empty to scan the entire project.
Search Directory: Enter the relative path where your code lives (e.g., src). Leave empty to search the entire project.
Wait for the scan to complete. A report file will open automatically.
⚠️ Note
This plugin uses static string matching (checks if the image filename exists in code files).
Dynamic references (e.g., imgSrc = 'icon-' + index + '.png') cannot be detected and may be falsely reported as unused. Please verify before deleting files.
中文
Find Unused Images 是一个轻量级的 VS Code 插件,旨在帮助开发者查找项目中不再使用的图片文件,以此来清理冗余资源并减小项目体积。