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

@netlify/plugin-nextjs

Package Overview
Dependencies
Maintainers
21
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.7.4 to 5.8.0

dist/esm-chunks/package-4GFWM3PF.js

25

dist/build/advanced-api-routes.js

@@ -21,2 +21,3 @@

async function getAPIRoutesConfigs(ctx) {
const uniqueApiRoutes = /* @__PURE__ */ new Set();
const functionsConfigManifestPath = join(

@@ -27,8 +28,22 @@ ctx.publishDir,

);
if (!existsSync(functionsConfigManifestPath)) {
if (existsSync(functionsConfigManifestPath)) {
const functionsConfigManifest = JSON.parse(
await readFile(functionsConfigManifestPath, "utf-8")
);
for (const apiRoute of Object.keys(functionsConfigManifest.functions)) {
uniqueApiRoutes.add(apiRoute);
}
}
const pagesManifestPath = join(ctx.publishDir, "server", "pages-manifest.json");
if (existsSync(pagesManifestPath)) {
const pagesManifest = JSON.parse(await readFile(pagesManifestPath, "utf-8"));
for (const route of Object.keys(pagesManifest)) {
if (route.startsWith("/api/")) {
uniqueApiRoutes.add(route);
}
}
}
if (uniqueApiRoutes.size === 0) {
return [];
}
const functionsConfigManifest = JSON.parse(
await readFile(functionsConfigManifestPath, "utf-8")
);
const appDir = ctx.resolveFromSiteDir(".");

@@ -39,3 +54,3 @@ const pagesDir = join(appDir, "pages");

return Promise.all(
Object.keys(functionsConfigManifest.functions).map(async (apiRoute) => {
[...uniqueApiRoutes].map(async (apiRoute) => {
const filePath = getSourceFileForPage(apiRoute, [pagesDir, srcPagesDir], pageExtensions);

@@ -42,0 +57,0 @@ const sharedFields = {

8

dist/run/headers.js

@@ -45,3 +45,3 @@

var getHeaderValueArray = (header) => {
return header.split(",").map((value) => value.trim());
return header.split(",").map((value) => value.trim()).filter(Boolean);
};

@@ -146,3 +146,3 @@ var omitHeaderValues = (header, values) => {

};
var setCacheControlHeaders = (headers, request, requestContext) => {
var setCacheControlHeaders = ({ headers, status }, request, requestContext) => {
if (typeof requestContext.routeHandlerRevalidate !== "undefined" && ["GET", "HEAD"].includes(request.method) && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control")) {

@@ -156,2 +156,6 @@ const cdnCacheControl = (

}
if (status === 404 && request.url.endsWith(".php")) {
headers.set("cache-control", "public, max-age=0, must-revalidate");
headers.set("netlify-cdn-cache-control", `max-age=31536000, durable`);
}
const cacheControl = headers.get("cache-control");

@@ -158,0 +162,0 @@ if (cacheControl !== null && ["GET", "HEAD"].includes(request.method) && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control")) {

{
"name": "@netlify/plugin-nextjs",
"version": "5.7.4",
"version": "5.8.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