atinux/atidone

Regarding this code, 'if (! Import. meta. dev) return' will never be executed?

linpengteng opened this issue · 0 comments

export default defineNitroPlugin(async () => {
  if (!import.meta.dev) return

  onHubReady(async () => {
    await migrate(useDB(), { migrationsFolder: 'server/database/migrations' })
      .then(() => {
        consola.success('Database migrations done')
      })
      .catch((err) => {
        consola.error('Database migrations failed', err)
      })
  })
})

Regarding this code, 'if (! Import. meta. dev) return' will never be executed? I think, In the Nitro plugin of Nuxt, import.meta.dev is usually not true.