| 46 | } |
| 47 | |
| 48 | function start() { |
| 49 | try { |
| 50 | // eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.8.0+ and only called if it exists |
| 51 | module.enableCompileCache?.() |
| 52 | // flush the cache after 10s because the cache is not flushed until process end |
| 53 | // for dev server, the cache is never flushed unless manually flushed because the process.exit is called |
| 54 | // also flushing the cache in SIGINT handler seems to cause the process to hang |
| 55 | setTimeout(() => { |
| 56 | try { |
| 57 | // eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.12.0+ and only called if it exists |
| 58 | module.flushCompileCache?.() |
| 59 | } catch {} |
| 60 | }, 10 * 1000).unref() |
| 61 | } catch {} |
| 62 | return import('../dist/node/cli.js') |
| 63 | } |
| 64 | |
| 65 | if (profileIndex > 0) { |
| 66 | process.argv.splice(profileIndex, 1) |