Skip to content

Conversation

@ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Mar 1, 2022

Adds support for Gatsby Image CDN. We do this using @netlify/ipx, which now has support for Gatsby's base64-encoded params.

This PR adds an ODB with @netlify/ipx, and a rewrite from /_gatsby/image/* to that builder. It also sets the env var GATSBY_CLOUD_IMAGE_CDN, which enables this feature.

The version in this PR can be installed as @netlify/plugin-gatsby@images. For a live example using that release see: https://gatsby-image-cdn-demo.netlify.app/

Example image

This PR temporarily changes the e2e tests to run gatsby build before the tests. This is to work around a bug introduced in Gatsby 4.9.0, which prevents gatsby build running correctly in Jest. We can revert this once the bug is fixed.

@netlify
Copy link

netlify bot commented Mar 1, 2022

✔️ Deploy Preview for netlify-plugin-gatsby-demo canceled.

🔨 Explore the source changes: 6733c6e

🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-gatsby-demo/deploys/621f722bfe678f00084e3d9c

@ascorbic ascorbic marked this pull request as ready for review March 2, 2022 13:36
@ascorbic ascorbic self-assigned this Mar 2, 2022
@ascorbic
Copy link
Contributor Author

ascorbic commented Mar 2, 2022

Ah good point with the file link. I'll open an issue to add support for that

@kodiakhq kodiakhq bot merged commit 77b5aa4 into main Mar 2, 2022
@kodiakhq kodiakhq bot deleted the mk/image-cdn branch March 2, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants