@netlify/plugin-nextjs 5.7.0-ipx.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/functions/edge.js +1 -5
- package/dist/build/image-cdn.js +59 -64
- package/dist/build/plugin-context.js +0 -13
- package/dist/esm-chunks/{package-O63J727E.js → package-KXKB2T7U.js} +2 -6
- package/dist/run/handlers/server.js +1 -2
- package/dist/run/handlers/tracing.js +1 -1
- package/dist/run/headers.js +4 -5
- package/package.json +2 -5
- package/dist/build/functions/ipx.js +0 -83
- package/dist/build/templates/ipx-edge-accept-handler.ts +0 -13
- package/dist/build/templates/ipx.ts +0 -11
|
@@ -392,7 +392,6 @@ var import_path_to_regexp = __toESM(require_dist(), 1);
|
|
|
392
392
|
import { cp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
393
393
|
import { dirname, join } from "node:path";
|
|
394
394
|
import { EDGE_HANDLER_NAME } from "../plugin-context.js";
|
|
395
|
-
import { createIpxEdgeAcceptHandler } from "./ipx.js";
|
|
396
395
|
var writeEdgeManifest = async (ctx, manifest) => {
|
|
397
396
|
await mkdir(ctx.edgeFunctionsDir, { recursive: true });
|
|
398
397
|
await writeFile(join(ctx.edgeFunctionsDir, "manifest.json"), JSON.stringify(manifest, null, 2));
|
|
@@ -477,7 +476,7 @@ var copyHandlerDependencies = async (ctx, { name, files, wasm }) => {
|
|
|
477
476
|
parts.push(`;// Concatenated file: ${file}
|
|
478
477
|
`, entrypoint);
|
|
479
478
|
}
|
|
480
|
-
const exports = `
|
|
479
|
+
const exports = `const middlewareEntryKey = Object.keys(_ENTRIES).find(entryKey => entryKey.startsWith("middleware_${name}")); export default _ENTRIES[middlewareEntryKey].default;`;
|
|
481
480
|
await mkdir(dirname(join(destDir, `server/${name}.js`)), { recursive: true });
|
|
482
481
|
await writeFile(join(destDir, `server/${name}.js`), [...parts, exports].join("\n"));
|
|
483
482
|
};
|
|
@@ -514,9 +513,6 @@ var createEdgeHandlers = async (ctx) => {
|
|
|
514
513
|
version: 1,
|
|
515
514
|
functions: netlifyDefinitions
|
|
516
515
|
};
|
|
517
|
-
if (ctx.imageService === "ipx") {
|
|
518
|
-
await createIpxEdgeAcceptHandler(ctx, netlifyManifest);
|
|
519
|
-
}
|
|
520
516
|
await writeEdgeManifest(ctx, netlifyManifest);
|
|
521
517
|
};
|
|
522
518
|
export {
|
package/dist/build/image-cdn.js
CHANGED
|
@@ -1528,7 +1528,6 @@ var require_picomatch2 = __commonJS({
|
|
|
1528
1528
|
|
|
1529
1529
|
// src/build/image-cdn.ts
|
|
1530
1530
|
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
1531
|
-
import { createIpxHandler } from "./functions/ipx.js";
|
|
1532
1531
|
function generateRegexFromPattern(pattern) {
|
|
1533
1532
|
return (0, import_picomatch.makeRe)(pattern).source;
|
|
1534
1533
|
}
|
|
@@ -1539,71 +1538,67 @@ var setImageConfig = async (ctx) => {
|
|
|
1539
1538
|
if (imageLoader !== "default") {
|
|
1540
1539
|
return;
|
|
1541
1540
|
}
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
//
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
if (remotePatterns
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
)}`,
|
|
1587
|
-
error
|
|
1588
|
-
);
|
|
1589
|
-
}
|
|
1541
|
+
ctx.netlifyConfig.redirects.push(
|
|
1542
|
+
{
|
|
1543
|
+
from: imageEndpointPath,
|
|
1544
|
+
// w and q are too short to be used as params with id-length rule
|
|
1545
|
+
// but we are forced to do so because of the next/image loader decides on their names
|
|
1546
|
+
// eslint-disable-next-line id-length
|
|
1547
|
+
query: { url: ":url", w: ":width", q: ":quality" },
|
|
1548
|
+
to: "/.netlify/images?url=:url&w=:width&q=:quality",
|
|
1549
|
+
status: 200
|
|
1550
|
+
},
|
|
1551
|
+
// when migrating from @netlify/plugin-nextjs@4 image redirect to ipx might be cached in the browser
|
|
1552
|
+
{
|
|
1553
|
+
from: "/_ipx/*",
|
|
1554
|
+
// w and q are too short to be used as params with id-length rule
|
|
1555
|
+
// but we are forced to do so because of the next/image loader decides on their names
|
|
1556
|
+
// eslint-disable-next-line id-length
|
|
1557
|
+
query: { url: ":url", w: ":width", q: ":quality" },
|
|
1558
|
+
to: "/.netlify/images?url=:url&w=:width&q=:quality",
|
|
1559
|
+
status: 200
|
|
1560
|
+
}
|
|
1561
|
+
);
|
|
1562
|
+
if (remotePatterns?.length !== 0 || domains?.length !== 0) {
|
|
1563
|
+
ctx.netlifyConfig.images ||= { remote_images: [] };
|
|
1564
|
+
ctx.netlifyConfig.images.remote_images ||= [];
|
|
1565
|
+
if (remotePatterns && remotePatterns.length !== 0) {
|
|
1566
|
+
for (const remotePattern of remotePatterns) {
|
|
1567
|
+
let { protocol, hostname, port, pathname } = remotePattern;
|
|
1568
|
+
if (pathname) {
|
|
1569
|
+
pathname = pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
1570
|
+
}
|
|
1571
|
+
const combinedRemotePattern = `${protocol ?? "http?(s)"}://${hostname}${port ? `:${port}` : ""}${pathname ?? "/**"}`;
|
|
1572
|
+
try {
|
|
1573
|
+
ctx.netlifyConfig.images.remote_images.push(
|
|
1574
|
+
generateRegexFromPattern(combinedRemotePattern)
|
|
1575
|
+
);
|
|
1576
|
+
} catch (error) {
|
|
1577
|
+
ctx.failBuild(
|
|
1578
|
+
`Failed to generate Image CDN remote image regex from Next.js remote pattern: ${JSON.stringify(
|
|
1579
|
+
{ remotePattern, combinedRemotePattern },
|
|
1580
|
+
null,
|
|
1581
|
+
2
|
|
1582
|
+
)}`,
|
|
1583
|
+
error
|
|
1584
|
+
);
|
|
1590
1585
|
}
|
|
1591
1586
|
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1587
|
+
}
|
|
1588
|
+
if (domains && domains.length !== 0) {
|
|
1589
|
+
for (const domain of domains) {
|
|
1590
|
+
const patternFromDomain = `http?(s)://${domain}/**`;
|
|
1591
|
+
try {
|
|
1592
|
+
ctx.netlifyConfig.images.remote_images.push(generateRegexFromPattern(patternFromDomain));
|
|
1593
|
+
} catch (error) {
|
|
1594
|
+
ctx.failBuild(
|
|
1595
|
+
`Failed to generate Image CDN remote image regex from Next.js domain: ${JSON.stringify(
|
|
1596
|
+
{ domain, patternFromDomain },
|
|
1597
|
+
null,
|
|
1598
|
+
2
|
|
1599
|
+
)}`,
|
|
1600
|
+
error
|
|
1601
|
+
);
|
|
1607
1602
|
}
|
|
1608
1603
|
}
|
|
1609
1604
|
}
|
|
@@ -23,7 +23,6 @@ var MODULE_DIR = fileURLToPath(new URL(".", import.meta.url));
|
|
|
23
23
|
var PLUGIN_DIR = join(MODULE_DIR, "../..");
|
|
24
24
|
var DEFAULT_PUBLISH_DIR = ".next";
|
|
25
25
|
var SERVER_HANDLER_NAME = "___netlify-server-handler";
|
|
26
|
-
var IPX_HANDLER_NAME = "_ipx";
|
|
27
26
|
var EDGE_HANDLER_NAME = "___netlify-edge-handler";
|
|
28
27
|
var PluginContext = class {
|
|
29
28
|
featureFlags;
|
|
@@ -117,9 +116,6 @@ var PluginContext = class {
|
|
|
117
116
|
const REQUIRED_BUILD_VERSION = ">=29.41.5";
|
|
118
117
|
return (0, import_semver.satisfies)(this.buildVersion, REQUIRED_BUILD_VERSION, { includePrerelease: true });
|
|
119
118
|
}
|
|
120
|
-
get imageService() {
|
|
121
|
-
return "ipx";
|
|
122
|
-
}
|
|
123
119
|
/**
|
|
124
120
|
* Absolute path of the directory containing the files for the serverless lambda function
|
|
125
121
|
* `.netlify/functions-internal`
|
|
@@ -131,10 +127,6 @@ var PluginContext = class {
|
|
|
131
127
|
get serverHandlerRootDir() {
|
|
132
128
|
return join(this.serverFunctionsDir, SERVER_HANDLER_NAME);
|
|
133
129
|
}
|
|
134
|
-
/** Absolute path of the ipx handler */
|
|
135
|
-
get ipxHandlerRootDir() {
|
|
136
|
-
return join(this.serverFunctionsDir, IPX_HANDLER_NAME);
|
|
137
|
-
}
|
|
138
130
|
get serverHandlerDir() {
|
|
139
131
|
if (this.relativeAppDir.length === 0) {
|
|
140
132
|
return this.serverHandlerRootDir;
|
|
@@ -161,10 +153,6 @@ var PluginContext = class {
|
|
|
161
153
|
get edgeHandlerDir() {
|
|
162
154
|
return join(this.edgeFunctionsDir, EDGE_HANDLER_NAME);
|
|
163
155
|
}
|
|
164
|
-
/** Absolute path of the ipx edge handler */
|
|
165
|
-
get ipxEdgeHandlerRootDir() {
|
|
166
|
-
return join(this.edgeFunctionsDir, IPX_HANDLER_NAME);
|
|
167
|
-
}
|
|
168
156
|
constructor(options) {
|
|
169
157
|
this.constants = options.constants;
|
|
170
158
|
this.featureFlags = options.featureFlags;
|
|
@@ -288,7 +276,6 @@ var PluginContext = class {
|
|
|
288
276
|
};
|
|
289
277
|
export {
|
|
290
278
|
EDGE_HANDLER_NAME,
|
|
291
|
-
IPX_HANDLER_NAME,
|
|
292
279
|
PluginContext,
|
|
293
280
|
SERVER_HANDLER_NAME
|
|
294
281
|
};
|
|
@@ -8,7 +8,7 @@ import "./chunk-OEQOKJGE.js";
|
|
|
8
8
|
|
|
9
9
|
// package.json
|
|
10
10
|
var name = "@netlify/plugin-nextjs";
|
|
11
|
-
var version = "5.7.0
|
|
11
|
+
var version = "5.7.0";
|
|
12
12
|
var description = "Run Next.js seamlessly on Netlify";
|
|
13
13
|
var main = "./dist/index.js";
|
|
14
14
|
var type = "module";
|
|
@@ -55,9 +55,6 @@ var bugs = {
|
|
|
55
55
|
url: "https://github.com/netlify/next-runtime/issues"
|
|
56
56
|
};
|
|
57
57
|
var homepage = "https://github.com/netlify/next-runtime#readme";
|
|
58
|
-
var dependencies = {
|
|
59
|
-
"@netlify/ipx": "^1.4.6"
|
|
60
|
-
};
|
|
61
58
|
var devDependencies = {
|
|
62
59
|
"@fastly/http-compute-js": "1.1.4",
|
|
63
60
|
"@netlify/blobs": "^7.3.0",
|
|
@@ -107,6 +104,7 @@ var clean_package = {
|
|
|
107
104
|
indent: 2,
|
|
108
105
|
remove: [
|
|
109
106
|
"clean-package",
|
|
107
|
+
"dependencies",
|
|
110
108
|
"devDependencies",
|
|
111
109
|
"scripts"
|
|
112
110
|
]
|
|
@@ -125,7 +123,6 @@ var package_default = {
|
|
|
125
123
|
license,
|
|
126
124
|
bugs,
|
|
127
125
|
homepage,
|
|
128
|
-
dependencies,
|
|
129
126
|
devDependencies,
|
|
130
127
|
"clean-package": clean_package
|
|
131
128
|
};
|
|
@@ -133,7 +130,6 @@ export {
|
|
|
133
130
|
bugs,
|
|
134
131
|
clean_package as "clean-package",
|
|
135
132
|
package_default as default,
|
|
136
|
-
dependencies,
|
|
137
133
|
description,
|
|
138
134
|
devDependencies,
|
|
139
135
|
engines,
|
|
@@ -3161,8 +3161,7 @@ var server_default = async (request, context) => {
|
|
|
3161
3161
|
span.setAttribute("responseCacheKey", requestContext.responseCacheKey);
|
|
3162
3162
|
}
|
|
3163
3163
|
await adjustDateHeader({ headers: response.headers, request, span, tracer, requestContext });
|
|
3164
|
-
|
|
3165
|
-
setCacheControlHeaders(response.headers, request, requestContext, useDurableCache);
|
|
3164
|
+
setCacheControlHeaders(response.headers, request, requestContext);
|
|
3166
3165
|
setCacheTagsHeaders(response.headers, requestContext);
|
|
3167
3166
|
setVaryHeaders(response.headers, request, nextConfig);
|
|
3168
3167
|
setCacheStatusHeader(response.headers);
|
|
@@ -67385,7 +67385,7 @@ var import_semantic_conventions = __toESM(require_src(), 1);
|
|
|
67385
67385
|
import { getLogger } from "./request-context.cjs";
|
|
67386
67386
|
var {
|
|
67387
67387
|
default: { version, name }
|
|
67388
|
-
} = await import("../../esm-chunks/package-
|
|
67388
|
+
} = await import("../../esm-chunks/package-KXKB2T7U.js");
|
|
67389
67389
|
var sdk = new import_sdk_node.NodeSDK({
|
|
67390
67390
|
resource: new import_resources.Resource({
|
|
67391
67391
|
[import_semantic_conventions.SEMRESATTRS_SERVICE_NAME]: name,
|
package/dist/run/headers.js
CHANGED
|
@@ -142,12 +142,11 @@ var adjustDateHeader = async ({
|
|
|
142
142
|
headers.set("x-nextjs-date", headers.get("date") ?? lastModifiedDate.toUTCString());
|
|
143
143
|
headers.set("date", lastModifiedDate.toUTCString());
|
|
144
144
|
};
|
|
145
|
-
var setCacheControlHeaders = (headers, request, requestContext
|
|
146
|
-
const durableCacheDirective = useDurableCache ? ", durable" : "";
|
|
145
|
+
var setCacheControlHeaders = (headers, request, requestContext) => {
|
|
147
146
|
if (typeof requestContext.routeHandlerRevalidate !== "undefined" && ["GET", "HEAD"].includes(request.method) && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control")) {
|
|
148
147
|
const cdnCacheControl = (
|
|
149
148
|
// if we are serving already stale response, instruct edge to not attempt to cache that response
|
|
150
|
-
headers.get("x-nextjs-cache") === "STALE" ? "public, max-age=0, must-revalidate" : `s-maxage=${requestContext.routeHandlerRevalidate === false ? 31536e3 : requestContext.routeHandlerRevalidate}, stale-while-revalidate=31536000
|
|
149
|
+
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`
|
|
151
150
|
);
|
|
152
151
|
headers.set("netlify-cdn-cache-control", cdnCacheControl);
|
|
153
152
|
return;
|
|
@@ -164,7 +163,7 @@ var setCacheControlHeaders = (headers, request, requestContext, useDurableCache)
|
|
|
164
163
|
...getHeaderValueArray(cacheControl).map(
|
|
165
164
|
(value) => value === "stale-while-revalidate" ? "stale-while-revalidate=31536000" : value
|
|
166
165
|
),
|
|
167
|
-
|
|
166
|
+
"durable"
|
|
168
167
|
].join(", ")
|
|
169
168
|
);
|
|
170
169
|
headers.set("cache-control", browserCacheControl || "public, max-age=0, must-revalidate");
|
|
@@ -173,7 +172,7 @@ var setCacheControlHeaders = (headers, request, requestContext, useDurableCache)
|
|
|
173
172
|
}
|
|
174
173
|
if (cacheControl === null && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control") && requestContext.usedFsRead) {
|
|
175
174
|
headers.set("cache-control", "public, max-age=0, must-revalidate");
|
|
176
|
-
headers.set("netlify-cdn-cache-control", `max-age=31536000
|
|
175
|
+
headers.set("netlify-cdn-cache-control", `max-age=31536000, durable`);
|
|
177
176
|
}
|
|
178
177
|
};
|
|
179
178
|
var setCacheTagsHeaders = (headers, requestContext) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/plugin-nextjs",
|
|
3
|
-
"version": "5.7.0
|
|
3
|
+
"version": "5.7.0",
|
|
4
4
|
"description": "Run Next.js seamlessly on Netlify",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -26,8 +26,5 @@
|
|
|
26
26
|
"bugs": {
|
|
27
27
|
"url": "https://github.com/netlify/next-runtime/issues"
|
|
28
28
|
},
|
|
29
|
-
"homepage": "https://github.com/netlify/next-runtime#readme"
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@netlify/ipx": "^1.4.6"
|
|
32
|
-
}
|
|
29
|
+
"homepage": "https://github.com/netlify/next-runtime#readme"
|
|
33
30
|
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
var require = await (async () => {
|
|
3
|
-
var { createRequire } = await import("node:module");
|
|
4
|
-
return createRequire(import.meta.url);
|
|
5
|
-
})();
|
|
6
|
-
|
|
7
|
-
import "../../esm-chunks/chunk-OEQOKJGE.js";
|
|
8
|
-
|
|
9
|
-
// src/build/functions/ipx.ts
|
|
10
|
-
import { cp, mkdir, writeFile } from "fs/promises";
|
|
11
|
-
import { join } from "path";
|
|
12
|
-
import { IPX_HANDLER_NAME } from "../plugin-context.js";
|
|
13
|
-
var sanitizeEdgePath = (imagesPath) => new URL(imagesPath, process.env.URL || "http://n").pathname;
|
|
14
|
-
var getAdjustedImageConfig = (ctx) => {
|
|
15
|
-
return {
|
|
16
|
-
...ctx.buildConfig.images,
|
|
17
|
-
basePath: [ctx.buildConfig.basePath, IPX_HANDLER_NAME].join("/")
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
var createIpxHandler = async (ctx) => {
|
|
21
|
-
await mkdir(ctx.ipxHandlerRootDir, { recursive: true });
|
|
22
|
-
await cp(
|
|
23
|
-
join(ctx.pluginDir, "dist/build/templates/ipx.ts"),
|
|
24
|
-
join(ctx.ipxHandlerRootDir, "_ipx.ts")
|
|
25
|
-
);
|
|
26
|
-
await writeFile(
|
|
27
|
-
join(ctx.ipxHandlerRootDir, "imageconfig.json"),
|
|
28
|
-
JSON.stringify(getAdjustedImageConfig(ctx))
|
|
29
|
-
);
|
|
30
|
-
await writeFile(
|
|
31
|
-
join(ctx.ipxHandlerRootDir, "_ipx.json"),
|
|
32
|
-
JSON.stringify({
|
|
33
|
-
version: 1,
|
|
34
|
-
config: {
|
|
35
|
-
name: "next/image handler",
|
|
36
|
-
generator: `${ctx.pluginName}@${ctx.pluginVersion}`,
|
|
37
|
-
timeout: 120
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
);
|
|
41
|
-
ctx.netlifyConfig.redirects.push(
|
|
42
|
-
{
|
|
43
|
-
from: ctx.buildConfig.images.path,
|
|
44
|
-
// eslint-disable-next-line id-length
|
|
45
|
-
query: { url: ":url", w: ":width", q: ":quality" },
|
|
46
|
-
to: `${ctx.buildConfig.basePath}/${IPX_HANDLER_NAME}/w_:width,q_:quality/:url`,
|
|
47
|
-
status: 301
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
from: `${ctx.buildConfig.basePath}/${IPX_HANDLER_NAME}/*`,
|
|
51
|
-
to: `/.netlify/builders/${IPX_HANDLER_NAME}`,
|
|
52
|
-
status: 200
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
var createIpxEdgeAcceptHandler = async (ctx, netlifyManifest) => {
|
|
57
|
-
await mkdir(ctx.ipxEdgeHandlerRootDir, { recursive: true });
|
|
58
|
-
await cp(
|
|
59
|
-
join(ctx.pluginDir, "dist/build/templates/ipx-edge-accept-handler.ts"),
|
|
60
|
-
join(ctx.ipxEdgeHandlerRootDir, "index.ts")
|
|
61
|
-
);
|
|
62
|
-
await writeFile(
|
|
63
|
-
join(ctx.ipxEdgeHandlerRootDir, "imageconfig.json"),
|
|
64
|
-
JSON.stringify(getAdjustedImageConfig(ctx))
|
|
65
|
-
);
|
|
66
|
-
netlifyManifest.functions.push({
|
|
67
|
-
function: IPX_HANDLER_NAME,
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
name: "next/image handler",
|
|
71
|
-
path: ctx.buildConfig.images.path ? sanitizeEdgePath(ctx.buildConfig.images.path) : "/_next/image",
|
|
72
|
-
generator: `${ctx.pluginName}@${ctx.pluginVersion}`
|
|
73
|
-
});
|
|
74
|
-
netlifyManifest.layers ??= [];
|
|
75
|
-
netlifyManifest.layers.push({
|
|
76
|
-
name: `https://ipx-edge-function-layer.netlify.app/mod.ts`,
|
|
77
|
-
flag: "ipx-edge-function-layer-url"
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
export {
|
|
81
|
-
createIpxEdgeAcceptHandler,
|
|
82
|
-
createIpxHandler
|
|
83
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
import { getHandler } from 'https://ipx-edge-function-layer.netlify.app/mod.ts'
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
|
-
// @ts-ignore Injected at build time
|
|
7
|
-
import imageconfig from './imageconfig.json' assert { type: 'json' }
|
|
8
|
-
|
|
9
|
-
export default getHandler({
|
|
10
|
-
formats: imageconfig?.formats,
|
|
11
|
-
basePath: imageconfig?.basePath,
|
|
12
|
-
imageCDNCompat: true,
|
|
13
|
-
})
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createIPXHandler } from '@netlify/ipx'
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
-
// @ts-ignore Injected at build time
|
|
5
|
-
import { basePath, domains, remotePatterns } from './imageconfig.json'
|
|
6
|
-
|
|
7
|
-
export const handler = createIPXHandler({
|
|
8
|
-
basePath,
|
|
9
|
-
domains,
|
|
10
|
-
remotePatterns,
|
|
11
|
-
})
|