Skip to content

Commit b30752b

Browse files
committed
feat: check env var before verifying netlify forms
1 parent 8e0a3f0 commit b30752b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/build/verification.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ export async function verifyNetlifyFormsWorkaround(ctx: PluginContext) {
112112
}
113113

114114
export function verifyNetlifyForms(ctx: PluginContext, html: string) {
115-
if (!verifications.has('netlifyFormsWorkaround') && formDetectionRegex.test(html)) {
115+
if (
116+
process.env.NETLIFY_NEXT_VERIFY_FORMS !== '0' &&
117+
process.env.NETLIFY_NEXT_VERIFY_FORMS?.toUpperCase() !== 'FALSE' &&
118+
!verifications.has('netlifyFormsWorkaround') &&
119+
formDetectionRegex.test(html)
120+
) {
116121
ctx.failBuild(
117122
'@netlify/plugin-nextjs@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
118123
)

0 commit comments

Comments
 (0)