Buckets:
| import '../server/lib/cpu-profile' | |
| import { saveCpuProfile } from '../server/lib/cpu-profile' | |
| import { existsSync } from 'fs' | |
| import { italic } from '../lib/picocolors' | |
| import analyze from '../build/analyze' | |
| import { warn } from '../build/output/log' | |
| import { printAndExit } from '../server/lib/utils' | |
| import { getProjectDir } from '../lib/get-project-dir' | |
| export type NextAnalyzeOptions = { | |
| experimentalAnalyze?: boolean | |
| profile?: boolean | |
| mangling: boolean | |
| port: number | |
| output: boolean | |
| experimentalAppOnly?: boolean | |
| } | |
| const nextAnalyze = async (options: NextAnalyzeOptions, directory?: string) => { | |
| process.on('SIGTERM', () => { | |
| saveCpuProfile() | |
| process.exit(143) | |
| }) | |
| process.on('SIGINT', () => { | |
| saveCpuProfile() | |
| process.exit(130) | |
| }) | |
| const { profile, mangling, experimentalAppOnly, output, port } = options | |
| if (!mangling) { | |
| warn( | |
| `Mangling is disabled. ${italic('Note: This may affect performance and should only be used for debugging purposes.')}` | |
| ) | |
| } | |
| if (profile) { | |
| warn( | |
| `Profiling is enabled. ${italic('Note: This may affect performance.')}` | |
| ) | |
| } | |
| const dir = getProjectDir(directory) | |
| if (!existsSync(dir)) { | |
| printAndExit(`> No such directory exists as the project root: ${dir}`) | |
| } | |
| return analyze({ | |
| dir, | |
| reactProductionProfiling: profile, | |
| noMangling: !mangling, | |
| appDirOnly: experimentalAppOnly, | |
| output, | |
| port, | |
| }) | |
| } | |
| export { nextAnalyze } | |
Xet Storage Details
- Size:
- 1.48 kB
- Xet hash:
- f1d3a0da2066d4e1d79a3778086f23a9ab477a5e4165d2082ef5fde749b4943e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.