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

Stuck on a reef in the sharky waters around the Gatsby islands?

Book a 1-on-1 Gatsby Call with Queen Raae. Friendly advice you can put into action immediately, guaranteed!

Serious about Gatsby? Sign up for emails sent every weekday to help you get the most out of Gatsby!