(options: NextAnalyzeOptions, directory?: string)
| 19 | } |
| 20 | |
| 21 | const nextAnalyze = async (options: NextAnalyzeOptions, directory?: string) => { |
| 22 | process.on('SIGTERM', () => { |
| 23 | saveCpuProfile() |
| 24 | process.exit(143) |
| 25 | }) |
| 26 | process.on('SIGINT', () => { |
| 27 | saveCpuProfile() |
| 28 | process.exit(130) |
| 29 | }) |
| 30 | |
| 31 | const { profile, mangling, experimentalAppOnly, output, port } = options |
| 32 | |
| 33 | if (!mangling) { |
| 34 | warn( |
| 35 | `Mangling is disabled. ${italic('Note: This may affect performance and should only be used for debugging purposes.')}` |
| 36 | ) |
| 37 | } |
| 38 | |
| 39 | if (profile) { |
| 40 | warn( |
| 41 | `Profiling is enabled. ${italic('Note: This may affect performance.')}` |
| 42 | ) |
| 43 | } |
| 44 | |
| 45 | const dir = getProjectDir(directory) |
| 46 | |
| 47 | if (!existsSync(dir)) { |
| 48 | printAndExit(`> No such directory exists as the project root: ${dir}`) |
| 49 | } |
| 50 | |
| 51 | return analyze({ |
| 52 | dir, |
| 53 | reactProductionProfiling: profile, |
| 54 | noMangling: !mangling, |
| 55 | appDirOnly: experimentalAppOnly, |
| 56 | output, |
| 57 | port, |
| 58 | }) |
| 59 | } |
| 60 | |
| 61 | export { nextAnalyze } |
nothing calls this directly
no test coverage detected