-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathconstants.ts
53 lines (50 loc) · 2.08 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import destr from 'destr'
export const HANDLER_FUNCTION_NAME = '___netlify-handler'
export const ODB_FUNCTION_NAME = '___netlify-odb-handler'
export const API_FUNCTION_NAME = '___netlify-api-handler'
export const IMAGE_FUNCTION_NAME = '_ipx'
export const NEXT_PLUGIN_NAME = '@netlify/next-runtime'
export const NEXT_PLUGIN = '@netlify/plugin-nextjs'
export const HANDLER_FUNCTION_TITLE = 'Next.js SSR handler'
export const ODB_FUNCTION_TITLE = 'Next.js ISR handler'
export const API_FUNCTION_TITLE = 'Next.js API handler'
export const IMAGE_FUNCTION_TITLE = 'next/image handler'
// These are paths in .next that shouldn't be publicly accessible
export const HIDDEN_PATHS = destr(process.env.NEXT_KEEP_METADATA_FILES)
? []
: [
'/cache',
'/server',
'/serverless',
'/trace',
'/traces',
'/routes-manifest.json',
'/build-manifest.json',
'/prerender-manifest.json',
'/react-loadable-manifest.json',
'/BUILD_ID',
'/app-build-manifest.json',
'/app-path-routes-manifest.json',
'/export-marker.json',
'/images-manifest.json',
'/next-server.js.nft.json',
'/package.json',
'/prerender-manifest.js',
'/required-server-files.json',
'/static-manifest.json',
'/blobs-manifest.json',
]
export const ODB_FUNCTION_PATH = `/.netlify/builders/${ODB_FUNCTION_NAME}`
export const HANDLER_FUNCTION_PATH = `/.netlify/functions/${HANDLER_FUNCTION_NAME}`
export const DEFAULT_FUNCTIONS_SRC = 'netlify/functions'
export const CATCH_ALL_REGEX = /\/\[\.{3}(.*)](.json)?$/
export const OPTIONAL_CATCH_ALL_REGEX = /\/\[{2}\.{3}(.*)]{2}(.json)?$/
export const DYNAMIC_PARAMETER_REGEX = /\/\[(.*?)]/g
export const MINIMUM_REVALIDATE_SECONDS = 60
// 50MB, which is the warning max
export const LAMBDA_WARNING_SIZE = 1024 * 1024 * 50
// 250MB, which is the hard max
export const LAMBDA_MAX_SIZE = 1024 * 1024 * 250
export const DIVIDER = `
────────────────────────────────────────────────────────────────
`