@netlify/plugin-nextjs
Advanced tools
Comparing version 5.0.0-beta.0 to 5.0.0-beta.1
@@ -11,3 +11,3 @@ | ||
writeTagsManifest | ||
} from "../../esm-chunks/chunk-G2VRYWGL.js"; | ||
} from "../../esm-chunks/chunk-A22224GM.js"; | ||
import "../../esm-chunks/chunk-AVWFCGVE.js"; | ||
@@ -14,0 +14,0 @@ import "../../esm-chunks/chunk-RSKIKBZH.js"; |
@@ -12,3 +12,3 @@ | ||
unpublishStaticDir | ||
} from "../../esm-chunks/chunk-62KDS27E.js"; | ||
} from "../../esm-chunks/chunk-Z7ZMLVTM.js"; | ||
import "../../esm-chunks/chunk-AVWFCGVE.js"; | ||
@@ -15,0 +15,0 @@ import "../../esm-chunks/chunk-RSKIKBZH.js"; |
@@ -9,4 +9,4 @@ | ||
createEdgeHandlers | ||
} from "../../esm-chunks/chunk-XD5TSLZO.js"; | ||
import "../../esm-chunks/chunk-HPGTYMVD.js"; | ||
} from "../../esm-chunks/chunk-UXLNY5XK.js"; | ||
import "../../esm-chunks/chunk-VP3PT3VV.js"; | ||
import "../../esm-chunks/chunk-RSKIKBZH.js"; | ||
@@ -13,0 +13,0 @@ export { |
@@ -9,6 +9,6 @@ | ||
createServerHandler | ||
} from "../../esm-chunks/chunk-PEBUKFKH.js"; | ||
import "../../esm-chunks/chunk-G2VRYWGL.js"; | ||
} from "../../esm-chunks/chunk-NOX2JUQZ.js"; | ||
import "../../esm-chunks/chunk-A22224GM.js"; | ||
import "../../esm-chunks/chunk-AVWFCGVE.js"; | ||
import "../../esm-chunks/chunk-HPGTYMVD.js"; | ||
import "../../esm-chunks/chunk-VP3PT3VV.js"; | ||
import "../../esm-chunks/chunk-RSKIKBZH.js"; | ||
@@ -15,0 +15,0 @@ export { |
@@ -11,3 +11,3 @@ | ||
SERVER_HANDLER_NAME | ||
} from "../esm-chunks/chunk-HPGTYMVD.js"; | ||
} from "../esm-chunks/chunk-VP3PT3VV.js"; | ||
import "../esm-chunks/chunk-RSKIKBZH.js"; | ||
@@ -14,0 +14,0 @@ export { |
@@ -8,9 +8,5 @@ | ||
import { | ||
createServerHandler | ||
} from "./esm-chunks/chunk-PEBUKFKH.js"; | ||
import { | ||
copyFetchContent, | ||
copyPrerenderedContent | ||
} from "./esm-chunks/chunk-G3GM7JNF.js"; | ||
import "./esm-chunks/chunk-G2VRYWGL.js"; | ||
import { | ||
@@ -21,3 +17,10 @@ copyStaticAssets, | ||
unpublishStaticDir | ||
} from "./esm-chunks/chunk-62KDS27E.js"; | ||
} from "./esm-chunks/chunk-Z7ZMLVTM.js"; | ||
import { | ||
createEdgeHandlers | ||
} from "./esm-chunks/chunk-UXLNY5XK.js"; | ||
import { | ||
createServerHandler | ||
} from "./esm-chunks/chunk-NOX2JUQZ.js"; | ||
import "./esm-chunks/chunk-A22224GM.js"; | ||
import "./esm-chunks/chunk-AVWFCGVE.js"; | ||
@@ -29,7 +32,4 @@ import { | ||
import { | ||
createEdgeHandlers | ||
} from "./esm-chunks/chunk-XD5TSLZO.js"; | ||
import { | ||
PluginContext | ||
} from "./esm-chunks/chunk-HPGTYMVD.js"; | ||
} from "./esm-chunks/chunk-VP3PT3VV.js"; | ||
import "./esm-chunks/chunk-RSKIKBZH.js"; | ||
@@ -36,0 +36,0 @@ |
@@ -12,3 +12,3 @@ | ||
setVaryHeaders | ||
} from "../esm-chunks/chunk-ZBX3SNQG.js"; | ||
} from "../esm-chunks/chunk-5N2CWXSJ.js"; | ||
import "../esm-chunks/chunk-RSKIKBZH.js"; | ||
@@ -15,0 +15,0 @@ export { |
import type { Context } from '@netlify/edge-functions' | ||
import matchers from './matchers.json' assert { type: 'json' } | ||
import { buildNextRequest, RequestData } from './lib/next-request.ts' | ||
import { buildResponse } from './lib/response.ts' | ||
import { FetchEventResult } from './lib/response.ts' | ||
import { | ||
type MiddlewareRouteMatch, | ||
getMiddlewareRouteMatcher, | ||
searchParamsToUrlQuery, | ||
} from './lib/routing.ts' | ||
type NextHandler = (params: { request: RequestData }) => Promise<FetchEventResult> | ||
const matchesMiddleware: MiddlewareRouteMatch = getMiddlewareRouteMatcher(matchers || []) | ||
/** | ||
@@ -23,9 +32,13 @@ * Runs a Next.js middleware as a Netlify Edge Function. It translates a web | ||
) { | ||
// Don't run in dev | ||
if (Netlify.env.has('NETLIFY_DEV')) { | ||
const nextRequest = buildNextRequest(request, context) | ||
const url = new URL(request.url) | ||
// While we have already checked the path when mapping to the edge function, | ||
// Next.js supports extra rules that we need to check here too, because we | ||
// might be running an edge function for a path we should not. If we find | ||
// that's the case, short-circuit the execution. | ||
if (!matchesMiddleware(url.pathname, request, searchParamsToUrlQuery(url.searchParams))) { | ||
return | ||
} | ||
const nextRequest = buildNextRequest(request, context) | ||
try { | ||
@@ -32,0 +45,0 @@ const result = await nextHandler({ request: nextRequest }) |
@@ -5,5 +5,8 @@ // NOTE: This is a fragment of a JavaScript program that will be inlined with | ||
import { AsyncLocalStorage } from 'node:async_hooks' | ||
import process from 'node:process' | ||
globalThis.process = process | ||
globalThis.AsyncLocalStorage = AsyncLocalStorage | ||
var _ENTRIES = {} |
{ | ||
"name": "@netlify/plugin-nextjs", | ||
"version": "5.0.0-beta.0", | ||
"version": "5.0.0-beta.1", | ||
"description": "Run Next.js seamlessly on Netlify", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2039635
198
63592
13