您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

16 行
569 B

  1. // Hook eseguito una sola volta all'avvio del server Next.
  2. // L'unico compito attuale è il bootstrap del factory preset quando data/ è vuoto.
  3. export async function register() {
  4. // Esegui solo nel runtime Node (l'instrumentation può girare anche su Edge,
  5. // dove fs/spawn non esistono).
  6. if (process.env.NEXT_RUNTIME !== 'nodejs') return;
  7. const { bootstrapFromFactoryPresetIfEmpty } = await import('@/lib/bootstrap');
  8. try {
  9. await bootstrapFromFactoryPresetIfEmpty();
  10. } catch (err) {
  11. console.warn('[instrumentation] Bootstrap error:', err);
  12. }
  13. }