-
Notifications
You must be signed in to change notification settings - Fork 15
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: write granular info into skip file #128
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.
Great stuff. Thanks for the tests
reporter.info(`[gatsby-plugin-netlify] No Netlify functions needed. Skipping...`) | ||
await writeFile(join(program.directory, `.cache`, `.nf-skip-gatsby-functions`), ``) | ||
} | ||
const skipFilePath = join(program.directory, `.cache`, `.nf-skip-gatsby-functions`) |
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.
It's a little confusing that the skip file sets the value "true" when it shouldn't be skipped, but that's probably fine for an internal API, and I can see why it's needed for backwards-compat
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.
Yep, I went round in circles with this one for a while! As you mentioned, for backwards-compat I ending up settling on this approach because I didn't want to rename the skip file and it was confusing to negate the values in netlify-plugin-gatsby when checking if a function should be bundled.
This PR supports allowing API, SSR and DSG functions to be disabled individually by reporting which functions are needed in the skip file generated by the plugin.
The change maintains backward compatibility by ensuring that no skip file still indicates all functions are needed.