@@ -16,6 +16,7 @@ import { getRequiredServerFiles, NextConfig } from './config'
16
16
import { getPluginVersion } from './functionsMetaData'
17
17
import { makeLocaleOptional , stripLookahead , transformCaptureGroups } from './matchers'
18
18
import { RoutesManifest } from './types'
19
+
19
20
// This is the format as of [email protected]
20
21
interface EdgeFunctionDefinitionV1 {
21
22
env : string [ ]
@@ -38,7 +39,7 @@ export interface MiddlewareMatcher {
38
39
39
40
// This is the format after [email protected]
40
41
interface EdgeFunctionDefinitionV2 {
41
- env : string [ ]
42
+ env ? : string [ ]
42
43
files : string [ ]
43
44
name : string
44
45
page : string
@@ -376,7 +377,6 @@ export const writeEdgeFunctions = async ({
376
377
const { publish } = netlifyConfig . build
377
378
const nextConfigFile = await getRequiredServerFiles ( publish )
378
379
const nextConfig = nextConfigFile . config
379
- const usesAppDir = nextConfig . experimental ?. appDir
380
380
381
381
await copy ( getEdgeTemplatePath ( '../vendor' ) , join ( edgeFunctionRoot , 'vendor' ) )
382
382
await copy ( getEdgeTemplatePath ( '../edge-shared' ) , join ( edgeFunctionRoot , 'edge-shared' ) )
@@ -463,7 +463,7 @@ export const writeEdgeFunctions = async ({
463
463
name : edgeFunctionDefinition . name ,
464
464
pattern,
465
465
// cache: "manual" is currently experimental, so we restrict it to sites that use experimental appDir
466
- cache : usesAppDir ? 'manual' : undefined ,
466
+ cache : 'manual' ,
467
467
generator,
468
468
} )
469
469
// pages-dir page routes also have a data route. If there's a match, add an entry mapping that to the function too
@@ -473,7 +473,7 @@ export const writeEdgeFunctions = async ({
473
473
function : functionName ,
474
474
name : edgeFunctionDefinition . name ,
475
475
pattern : dataRoute ,
476
- cache : usesAppDir ? 'manual' : undefined ,
476
+ cache : 'manual' ,
477
477
generator,
478
478
} )
479
479
}
0 commit comments