From 0d712850d502af15ad09643971cdd3622c82e59c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 26 Apr 2024 17:10:28 +0100 Subject: [PATCH] fix: set global provides before running vue plugins --- src/createInstance.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/createInstance.ts b/src/createInstance.ts index 1afe8e95e..fe04fcf2a 100644 --- a/src/createInstance.ts +++ b/src/createInstance.ts @@ -266,6 +266,14 @@ export function createInstance( } } + // provide any values passed via provides mounting option + if (global.provide) { + for (const key of Reflect.ownKeys(global.provide)) { + // @ts-ignore: https://github.com/microsoft/TypeScript/issues/1863 + app.provide(key, global.provide[key]) + } + } + // use and plugins from mounting options if (global.plugins) { for (const plugin of global.plugins) { @@ -296,14 +304,6 @@ export function createInstance( app.directive(key, global.directives[key]) } - // provide any values passed via provides mounting option - if (global.provide) { - for (const key of Reflect.ownKeys(global.provide)) { - // @ts-ignore: https://github.com/microsoft/TypeScript/issues/1863 - app.provide(key, global.provide[key]) - } - } - // stubs // even if we are using `mount`, we will still // stub out Transition and Transition Group by default.