@netlify/plugin-nextjs 5.12.1 → 5.13.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/content/prerendered.js +41 -13
- package/dist/build/content/server.js +32 -7
- package/dist/build/content/static.js +1 -1
- package/dist/build/functions/edge.js +105 -12
- package/dist/build/functions/server.js +1 -1
- package/dist/build/plugin-context.js +33 -2
- package/dist/esm-chunks/{chunk-FKDTZJRV.js → chunk-5V5HA6YA.js} +24 -24
- package/dist/index.js +1 -1
- package/dist/run/config.js +1 -0
- package/dist/run/handlers/cache.cjs +15 -3
- package/dist/run/handlers/server.js +92 -92
- package/dist/run/handlers/tags-handler.cjs +1 -1
- package/dist/run/handlers/tracer.cjs +24 -24
- package/dist/run/next.cjs +2 -2
- package/edge-runtime/lib/cjs.ts +330 -0
- package/edge-runtime/shim/node.js +16 -0
- package/package.json +3 -1
- package/edge-runtime/lib/middleware.test.ts +0 -92
- package/edge-runtime/lib/util.test.ts +0 -39
- /package/edge-runtime/shim/{index.js → edge.js} +0 -0
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { assertEquals } from 'https://deno.land/std@0.175.0/testing/asserts.ts'
|
|
2
|
-
import { rewriteDataPath } from './util.ts'
|
|
3
|
-
|
|
4
|
-
Deno.test('rewriteDataPath', async (t) => {
|
|
5
|
-
await t.step('should rewrite a data url', async () => {
|
|
6
|
-
const dataUrl = '/_next/data/build-id/rewrite-me.json'
|
|
7
|
-
const newRoute = '/target'
|
|
8
|
-
const result = rewriteDataPath({ dataUrl, newRoute })
|
|
9
|
-
assertEquals(result, '/_next/data/build-id/target.json')
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
await t.step('should rewrite a data url with a base path', async () => {
|
|
13
|
-
const dataUrl = '/baseDir/_next/data/build-id/rewrite-me.json'
|
|
14
|
-
const newRoute = '/target'
|
|
15
|
-
const result = rewriteDataPath({ dataUrl, newRoute, basePath: '/baseDir' })
|
|
16
|
-
assertEquals(result, '/baseDir/_next/data/build-id/target.json')
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
await t.step('should rewrite from an index data url', async () => {
|
|
20
|
-
const dataUrl = '/_next/data/build-id/index.json'
|
|
21
|
-
const newRoute = '/target'
|
|
22
|
-
const result = rewriteDataPath({ dataUrl, newRoute })
|
|
23
|
-
assertEquals(result, '/_next/data/build-id/target.json')
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
await t.step('should rewrite to an index data url', async () => {
|
|
27
|
-
const dataUrl = '/_next/data/build-id/rewrite-me.json'
|
|
28
|
-
const newRoute = '/'
|
|
29
|
-
const result = rewriteDataPath({ dataUrl, newRoute })
|
|
30
|
-
assertEquals(result, '/_next/data/build-id/index.json')
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
await t.step('should rewrite to a route with a trailing slash', async () => {
|
|
34
|
-
const dataUrl = '/_next/data/build-id/rewrite-me.json'
|
|
35
|
-
const newRoute = '/target/'
|
|
36
|
-
const result = rewriteDataPath({ dataUrl, newRoute })
|
|
37
|
-
assertEquals(result, '/_next/data/build-id/target.json')
|
|
38
|
-
})
|
|
39
|
-
})
|
|
File without changes
|