I'm currently fetching github issue data with GraphQL, but I get raw image data from github, which size can be super large.
What I want to do is copying those images to my server and compressing those images as I build my project.
Is there any way to solve this problem?
I've already tried some following plugins which seems helpful in this situation.
gatsby-transformer-remark
gatsby-remark-images
gatsby-remark-copy-linked-files
and now a part of my gatsby-config.js file is like this
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 590,
},
},
{
resolve: `gatsby-remark-copy-linked-files`,
options: {
destinationDir: `images`
}
}],
},
}
Hey @mo-ro,
Are you fetching the data from the GitHub's API (external data source)?
Hi @pranshuchittora ,
Yeah, you're right.
I don't think you can do that directly. You might need some kind of middleware to perform that task for you.
Hmm...
If I have those .md files and related images at my local, is it possible to optimize them with the plugins I mentioned?
If the Images are locally present then you can always perform those cool image optimizations.
Shall I close this issue?
Sure, thanks a lot!
You can always reopen this issue if you want any help related to that.
Happy Hacking :smiley:
Most helpful comment
You can always reopen this issue if you want any help related to that.
Happy Hacking :smiley: