( phase: PHASE_TYPE, dir: string, customConfig?: object | null, reactProductionProfiling?: boolean, debugPrerender?: boolean, pid?: number )
| 1491 | // Generate cache key based on parameters that affect config output |
| 1492 | // We need a unique key for cache because there can be multiple values |
| 1493 | function getCacheKey( |
| 1494 | phase: PHASE_TYPE, |
| 1495 | dir: string, |
| 1496 | customConfig?: object | null, |
| 1497 | reactProductionProfiling?: boolean, |
| 1498 | debugPrerender?: boolean, |
| 1499 | pid?: number |
| 1500 | ): string { |
| 1501 | // The next.config.js is unique per project, so we can use the dir as the major key |
| 1502 | // to generate the unique config key. Include PID to invalidate on server restart. |
| 1503 | const keyData = JSON.stringify({ |
| 1504 | dir, |
| 1505 | phase, |
| 1506 | hasCustomConfig: Boolean(customConfig), |
| 1507 | reactProductionProfiling: Boolean(reactProductionProfiling), |
| 1508 | debugPrerender: Boolean(debugPrerender), |
| 1509 | pid: pid || 0, |
| 1510 | }) |
| 1511 | |
| 1512 | return djb2Hash(keyData).toString(36) |
| 1513 | } |
| 1514 | |
| 1515 | type LoadConfigOptions = { |
| 1516 | customConfig?: object | null |
no test coverage detected
searching dependent graphs…