Skip to content

Commit ba13f81

Browse files
committed
chore: NETLIFY_NEXT_PLUGIN_SKIP is now handled by builds
1 parent 5f3dec9 commit ba13f81

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

src/index.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,9 @@ import {
2525
verifyPublishDir,
2626
} from './build/verification.js'
2727

28-
const skipPlugin =
29-
process.env.NETLIFY_NEXT_PLUGIN_SKIP === 'true' || process.env.NETLIFY_NEXT_PLUGIN_SKIP === '1'
30-
const skipText = 'Skipping Next.js plugin due to NETLIFY_NEXT_PLUGIN_SKIP environment variable.'
3128
const tracer = wrapTracer(trace.getTracer('Next.js runtime'))
3229

3330
export const onPreDev = async (options: NetlifyPluginOptions) => {
34-
if (skipPlugin) {
35-
console.warn(skipText)
36-
return
37-
}
38-
3931
await tracer.withActiveSpan('onPreDev', async () => {
4032
const context = new PluginContext(options)
4133

@@ -45,11 +37,6 @@ export const onPreDev = async (options: NetlifyPluginOptions) => {
4537
}
4638

4739
export const onPreBuild = async (options: NetlifyPluginOptions) => {
48-
if (skipPlugin) {
49-
console.warn(skipText)
50-
return
51-
}
52-
5340
await tracer.withActiveSpan('onPreBuild', async (span) => {
5441
// Enable Next.js standalone mode at build time
5542
process.env.NEXT_PRIVATE_STANDALONE = 'true'
@@ -68,11 +55,6 @@ export const onPreBuild = async (options: NetlifyPluginOptions) => {
6855
}
6956

7057
export const onBuild = async (options: NetlifyPluginOptions) => {
71-
if (skipPlugin) {
72-
console.warn(skipText)
73-
return
74-
}
75-
7658
await tracer.withActiveSpan('onBuild', async (span) => {
7759
const ctx = new PluginContext(options)
7860

@@ -106,22 +88,12 @@ export const onBuild = async (options: NetlifyPluginOptions) => {
10688
}
10789

10890
export const onPostBuild = async (options: NetlifyPluginOptions) => {
109-
if (skipPlugin) {
110-
console.warn(skipText)
111-
return
112-
}
113-
11491
await tracer.withActiveSpan('onPostBuild', async () => {
11592
await publishStaticDir(new PluginContext(options))
11693
})
11794
}
11895

11996
export const onSuccess = async () => {
120-
if (skipPlugin) {
121-
console.warn(skipText)
122-
return
123-
}
124-
12597
await tracer.withActiveSpan('onSuccess', async () => {
12698
const prewarm = [process.env.DEPLOY_URL, process.env.DEPLOY_PRIME_URL, process.env.URL].filter(
12799
// If running locally then the deploy ID is a placeholder value. Filtering for `https://0--` removes it.
@@ -132,11 +104,6 @@ export const onSuccess = async () => {
132104
}
133105

134106
export const onEnd = async (options: NetlifyPluginOptions) => {
135-
if (skipPlugin) {
136-
console.warn(skipText)
137-
return
138-
}
139-
140107
await tracer.withActiveSpan('onEnd', async () => {
141108
await unpublishStaticDir(new PluginContext(options))
142109
})

0 commit comments

Comments
 (0)