Skip to content

feat: restore NETLIFY_NEXT_PLUGIN_SKIP #3017

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

Merged
merged 3 commits into from
Jul 31, 2025
Merged

Conversation

hrishikesh-k
Copy link
Contributor

Description

Next.js Runtime v4 offered NETLIFY_NEXT_PLUGIN_SKIP environment variable that could be used to skip any work done by Next.js Runtime on Netlify. In v5, this variable was removed. However, there are still some use-cases which could require this to be explicitly set.

Documentation

No documentation changes. Feel free to let me know what needs to be updated and I'll do that.

Tests

No tests added, since this appeared to be a fairly simple change? I could be wrong but I'm also not sure what to test for here.

Relevant links (GitHub issues, etc.) or a picture of cute animal

https://linear.app/netlify/issue/FRB-1952/

@hrishikesh-k hrishikesh-k requested a review from a team as a code owner July 29, 2025 11:25
@hrishikesh-k
Copy link
Contributor Author

Instead of checking for the same condition in every event handler, I could have also checked this once and conditonally return the event handlers as documented here: https://docs.netlify.com/extend/develop-and-share/develop-build-plugins/#dynamic-events, but I thought that might be a bigger change. I am still open to change it into that, so let me know.

pieh
pieh previously approved these changes Jul 30, 2025
@@ -53,6 +65,11 @@ export const onPreBuild = async (options: NetlifyPluginOptions) => {
}

export const onBuild = async (options: NetlifyPluginOptions) => {
if (skipPlugin) {
console.warn(skipText)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will repeat skipText quite a bit for each hook. For comparison v4 did omit logs/warnings in some of hooks like

if (shouldSkip()) {
return
}

I think it's fine as-is and we can maybe change this later if we think it's too spammy in practice, but more important is to restore ability to skip, so let's ship this

@pieh pieh changed the title ft: restore NETLIFY_NEXT_PLUGIN_SKIP feat: restore NETLIFY_NEXT_PLUGIN_SKIP Jul 30, 2025
@pieh pieh mentioned this pull request Jul 30, 2025
@pieh pieh merged commit 0b51c47 into opennextjs:main Jul 31, 2025
35 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants