-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby-plugin-sharp): added option to allow sharp process to continue with errors #27345
feat(gatsby-plugin-sharp): added option to allow sharp process to continue with errors #27345
Conversation
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.
Thanks for the PR! Can we also have a note in README about the new option?
Yes! I'll work on adding that note today. |
This is so good, thank you 💜 There were some changes in plugin sharp in master recently - we've validation for the plugin options: gatsby/packages/gatsby-plugin-sharp/src/gatsby-node.js Lines 65 to 82 in 63532f7
Can you merge master branch and add this option there as well? Sorry for the churn. |
…or-option # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
@vladar No problem! I've merged master and added the new option to that object. |
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.
Looks great, thanks 👍
Published in |
pipeline = !options.failOnError | ||
? sharp(file, { failOnError: false }) | ||
: sharp(file) |
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.
pipeline = sharp(file, { failOnError: options.failOnError })
why not?
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.
or
pipeline = sharp(file, { failOnError: !!options.failOnError })
Description
Added support for the passing of a plugin option that allows the sharp process to continue with errors so that sites with large media sites don't fail on
gatsby develop
orgatsby build
.This feature is optional and the default is set to fail on error (which is the current behavior)
Related Issues
Fixes #26857