-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathconstants.ts
37 lines (35 loc) · 1.54 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
export const HANDLER_FUNCTION_NAME = '___netlify-handler'
export const ODB_FUNCTION_NAME = '___netlify-odb-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 IMAGE_FUNCTION_TITLE = 'next/image handler'
// These are paths in .next that shouldn't be publicly accessible
export const HIDDEN_PATHS = [
'/cache/*',
'/server/*',
'/serverless/*',
'/trace',
'/traces',
'/routes-manifest.json',
'/build-manifest.json',
'/prerender-manifest.json',
'/react-loadable-manifest.json',
'/BUILD_ID',
]
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 = `
────────────────────────────────────────────────────────────────
`