|
| 1 | +diff --git a/dist/runtime/app.mjs b/dist/runtime/app.mjs |
| 2 | +index 6e968f59e719851b0fc166bc02a30e41ebbb8e63..10d19fed1cf71f82d912be1210dc9ec906fe9d6f 100644 |
| 3 | +--- a/dist/runtime/app.mjs |
| 4 | ++++ b/dist/runtime/app.mjs |
| 5 | +@@ -22,7 +22,7 @@ import { nitroAsyncContext } from "./context.mjs"; |
| 6 | + import { plugins } from "#internal/nitro/virtual/plugins"; |
| 7 | + import errorHandler from "#internal/nitro/virtual/error-handler"; |
| 8 | + import { handlers } from "#internal/nitro/virtual/server-handlers"; |
| 9 | +-function createNitroApp() { |
| 10 | ++async function createNitroApp() { |
| 11 | + const config = useRuntimeConfig(); |
| 12 | + const hooks = createHooks(); |
| 13 | + const captureError = (error, context = {}) => { |
| 14 | +@@ -140,7 +140,7 @@ function createNitroApp() { |
| 15 | + }; |
| 16 | + for (const plugin of plugins) { |
| 17 | + try { |
| 18 | +- plugin(app); |
| 19 | ++ await plugin(app); |
| 20 | + } catch (err) { |
| 21 | + captureError(err, { tags: ["plugin"] }); |
| 22 | + throw err; |
| 23 | +@@ -148,5 +148,5 @@ function createNitroApp() { |
| 24 | + } |
| 25 | + return app; |
| 26 | + } |
| 27 | +-export const nitroApp = createNitroApp(); |
| 28 | ++export const nitroApp = await createNitroApp(); |
| 29 | + export const useNitroApp = () => nitroApp; |
| 30 | +diff --git a/dist/runtime/plugin.d.ts b/dist/runtime/plugin.d.ts |
| 31 | +index a83e51dc732331862e8eac011e97ae784ee525b8..7907875fe883e837e9305acccdd4cd55a1bf3353 100644 |
| 32 | +--- a/dist/runtime/plugin.d.ts |
| 33 | ++++ b/dist/runtime/plugin.d.ts |
| 34 | +@@ -1,6 +1,6 @@ |
| 35 | + import type { NitroApp } from "./app"; |
| 36 | + export interface NitroAppPlugin { |
| 37 | +- (nitro: NitroApp): void; |
| 38 | ++ (nitro: NitroApp): Promise<void> | void; |
| 39 | + } |
| 40 | + export declare function defineNitroPlugin(def: NitroAppPlugin): NitroAppPlugin; |
| 41 | + export declare const nitroPlugin: typeof defineNitroPlugin; |
0 commit comments