Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@netlify/plugin-nextjs

Package Overview
Dependencies
Maintainers
20
Versions
261
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/plugin-nextjs - npm Package Compare versions

Comparing version 5.6.0 to 5.7.0-canary.0

dist/esm-chunks/package-SRGJOMMG.js

2

dist/build/functions/edge.js

@@ -479,3 +479,3 @@

}
const exports = `export default _ENTRIES["middleware_${name}"].default;`;
const exports = `const middlewareEntryKey = Object.keys(_ENTRIES).find(entryKey => entryKey.startsWith("middleware_${name}")); export default _ENTRIES[middlewareEntryKey].default;`;
await mkdir(dirname(join(destDir, `server/${name}.js`)), { recursive: true });

@@ -482,0 +482,0 @@ await writeFile(join(destDir, `server/${name}.js`), [...parts, exports].join("\n"));

@@ -65,3 +65,3 @@

if (ctx.buildConfig.output === "export") {
return copyStaticExport(ctx);
return Promise.all([copyStaticExport(ctx), setImageConfig(ctx)]);
}

@@ -68,0 +68,0 @@ await verifyAdvancedAPIRoutes(ctx);

@@ -145,8 +145,7 @@

};
var setCacheControlHeaders = (headers, request, requestContext, useDurableCache) => {
const durableCacheDirective = useDurableCache ? ", durable" : "";
var setCacheControlHeaders = (headers, request, requestContext) => {
if (typeof requestContext.routeHandlerRevalidate !== "undefined" && ["GET", "HEAD"].includes(request.method) && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control")) {
const cdnCacheControl = (
// if we are serving already stale response, instruct edge to not attempt to cache that response
headers.get("x-nextjs-cache") === "STALE" ? "public, max-age=0, must-revalidate" : `s-maxage=${requestContext.routeHandlerRevalidate === false ? 31536e3 : requestContext.routeHandlerRevalidate}, stale-while-revalidate=31536000${durableCacheDirective}`
headers.get("x-nextjs-cache") === "STALE" ? "public, max-age=0, must-revalidate" : `s-maxage=${requestContext.routeHandlerRevalidate === false ? 31536e3 : requestContext.routeHandlerRevalidate}, stale-while-revalidate=31536000, durable`
);

@@ -168,3 +167,3 @@ headers.set("netlify-cdn-cache-control", cdnCacheControl);

),
...useDurableCache ? ["durable"] : []
"durable"
].join(", ")

@@ -178,3 +177,3 @@ );

headers.set("cache-control", "public, max-age=0, must-revalidate");
headers.set("netlify-cdn-cache-control", `max-age=31536000${durableCacheDirective}`);
headers.set("netlify-cdn-cache-control", `max-age=31536000, durable`);
}

@@ -181,0 +180,0 @@ };

@@ -119,5 +119,6 @@ import type { Context } from '@netlify/edge-functions'

let rewrite = res.headers.get('x-middleware-rewrite')
let redirect = res.headers.get('location')
let nextRedirect = res.headers.get('x-nextjs-redirect')
// If we have both a redirect and a rewrite, the redirect must take precedence
let rewrite = !redirect && !nextRedirect ? res.headers.get('x-middleware-rewrite') : false

@@ -124,0 +125,0 @@ // Data requests (i.e. requests for /_next/data ) need special handling

{
"name": "@netlify/plugin-nextjs",
"version": "5.6.0",
"version": "5.7.0-canary.0",
"description": "Run Next.js seamlessly on Netlify",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc