How to set shouldDownloadFiles in gatsby-config?

Hi! I want to download my homepage images on front so I can transform/optimize my images during build. But I can't find a good explanation about how to tell Prismic, which images should be downloaden. I tried something like this:

   shouldDownloadFiles: {
          "": true,

But returned Null on localfile.

The documentation on this is pretty vague. I was able to make it work after some trial and error:

 shouldDownloadFiles: {
          '': true, //non-repeatable image field 
          '': true, // image field in a slice

I think if the image you're referencing is contained in a slice, you'll simply need to add the "primary" field as shown in my example.

Thanks! Got it to work :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.