-
Notifications
You must be signed in to change notification settings - Fork 86
feat: Add ability to disable ipx #1653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
includes some domain path and test updates
when ipx is removed, need to use sharp for image optimization
ensure basePath redirect is still added
don't add ipx function to netlifyConfig if ipx is disabled
also do general cleanup
✅ Deploy Preview for next-hp-edge-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-rsc-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-export-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-canary ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-plugin-edge-middleware ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for nextjs-plugin-custom-routes-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for next-i18next-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for ep-disable-ipx ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
if (destr(process.env.DISABLE_IPX)) { | ||
// If no image loader is specified, need to redirect to a 404 page since there's no | ||
// backing loader to serve local site images once deployed to Netlify | ||
if (!IS_LOCAL && imageconfig.loader && imageconfig.loader === 'default') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[sand] does this need the check for imageconfig.loader
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I had written that out of habit when a property is optional, but this could be achieved with the imageconfig.loader === 'default'
check
Summary
Allows for the ability to disable
ipx
via theDISABLE_IPX
environment variable.If this is enabled, this will require users to a loader (such as Cloudinary), otherwise the images that would've previously been served by
ipx
will return a 404.Test plan
Deploy preview - https://ep-disable-ipx.netlify.app
Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
Fixes #1605
Related documentation PR: https://github.com/netlify/docs/pull/2414
Standard checks:
🧪 Once merged, make sure to update the version if needed and that it was published correctly.