diff --git a/src/index.ts b/src/index.ts index 296da96949..82874fe888 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,17 +25,9 @@ import { verifyPublishDir, } from './build/verification.js' -const skipPlugin = - process.env.NETLIFY_NEXT_PLUGIN_SKIP === 'true' || process.env.NETLIFY_NEXT_PLUGIN_SKIP === '1' -const skipText = 'Skipping Next.js plugin due to NETLIFY_NEXT_PLUGIN_SKIP environment variable.' const tracer = wrapTracer(trace.getTracer('Next.js runtime')) export const onPreDev = async (options: NetlifyPluginOptions) => { - if (skipPlugin) { - console.warn(skipText) - return - } - await tracer.withActiveSpan('onPreDev', async () => { const context = new PluginContext(options) @@ -45,11 +37,6 @@ export const onPreDev = async (options: NetlifyPluginOptions) => { } export const onPreBuild = async (options: NetlifyPluginOptions) => { - if (skipPlugin) { - console.warn(skipText) - return - } - await tracer.withActiveSpan('onPreBuild', async (span) => { // Enable Next.js standalone mode at build time process.env.NEXT_PRIVATE_STANDALONE = 'true' @@ -68,11 +55,6 @@ export const onPreBuild = async (options: NetlifyPluginOptions) => { } export const onBuild = async (options: NetlifyPluginOptions) => { - if (skipPlugin) { - console.warn(skipText) - return - } - await tracer.withActiveSpan('onBuild', async (span) => { const ctx = new PluginContext(options) @@ -106,22 +88,12 @@ export const onBuild = async (options: NetlifyPluginOptions) => { } export const onPostBuild = async (options: NetlifyPluginOptions) => { - if (skipPlugin) { - console.warn(skipText) - return - } - await tracer.withActiveSpan('onPostBuild', async () => { await publishStaticDir(new PluginContext(options)) }) } export const onSuccess = async () => { - if (skipPlugin) { - console.warn(skipText) - return - } - await tracer.withActiveSpan('onSuccess', async () => { const prewarm = [process.env.DEPLOY_URL, process.env.DEPLOY_PRIME_URL, process.env.URL].filter( // 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 () => { } export const onEnd = async (options: NetlifyPluginOptions) => { - if (skipPlugin) { - console.warn(skipText) - return - } - await tracer.withActiveSpan('onEnd', async () => { await unpublishStaticDir(new PluginContext(options)) })