nextjs-cleanup-assets
v1.0.11
Published
A CLI tool to remove unused assets in Next.js public folders
Maintainers
Readme
nextjs-cleanup-assets
A production-ready CLI tool to detect and remove unused assets from Next.js projects.
This tool scans your project source files, identifies unreferenced files inside a target folder (default: public), and safely removes them with support for dry runs, verbose output, and automatic empty-folder cleanup.
Features
- Detects unused assets in the
publicfolder - Supports custom folders via CLI flags
- Dry-run mode (preview without deleting)
- Verbose logging for detailed inspection
- Automatic removal of empty directories
- Fully compatible with Next.js and ESM projects
Installation
Using npx (recommended)
npx nextjs-cleanup-assetsUsing npm
npm i nextjs-cleanup-assets
npx cleanup-assets