How to weed out large files in your Gatsby project

Sam Larsen Disney asked on Twitter:

Is there any way to see which file the gatsby-plugin-sharp.IMAGE_PROCESSING job is currently working on?

It turns out there is not:

Thanks for reaching out! This isn't something we currently support, apologies for any inconvenience. We'd love to gain more context on your use case; what challenges are you currently facing? Thanks again!

However, when I have experienced sharp processing hanging, there is always a huge image file hanging around somewhere. Not sure how large is large, but to find your larger files, you can run this query:

query MyQuery {
  allFile(sort: { order: DESC, fields: size }) {
    nodes {
      size
      prettySize
      relativePath
    }
  }
}

And in doing so myself, I see last year's Christmas card/drawing could be a tad bit smaller 🎄

And in doing so myself I see last years christmas card/drawing could be a tad bit smaller 🎄

 
All the best,
Queen Raae

Interested in more daily treasures like this one?
Sent directly to your inbox?