Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

298
Views
How to find unused images in public folder in react app

i have a big project with a lot of images in the public folder of react app, is there a way to find all the unused images and clean them up ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This is a common issue and this question led to me to search for answers. I stumbled upon this video which helped to partly resolve the issue.

The problem here is that, the plugin used in the video unused-files-webpack-plugin does not support Webpack 5. An issue was raised to update the plugin to support Webpack 5 but the author of the package hasn't issued an update.

A similar package that can be used is the webpack-deadcode-plugin. You can use the implementation from the video and substitute the unused-files-webpack-plugin with the webpack-deadcode-plugin making a few changes (such as to the patterns property which you would have to change to something like: patterns: ['src/**/*.(png|jpg|jpeg)'] for your use case) to adapt the new plugin.

Edit: This answer assumes you are using webpack as your bundler.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!