From 70c45d102fd6c071da9021764d079f05b36a34d6 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Wortmann Date: Thu, 16 May 2024 09:30:11 -0500 Subject: [PATCH] chore(pr): implement changes requested in pr --- .changeset/sweet-needles-juggle.md | 5 +++++ packages/integrations/vue/src/index.ts | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/sweet-needles-juggle.md diff --git a/.changeset/sweet-needles-juggle.md b/.changeset/sweet-needles-juggle.md new file mode 100644 index 000000000000..354dc4a80ff7 --- /dev/null +++ b/.changeset/sweet-needles-juggle.md @@ -0,0 +1,5 @@ +--- +"@astrojs/vue": minor +--- + +expose VueDevToolsOptions to allow non-default launchEditor diff --git a/packages/integrations/vue/src/index.ts b/packages/integrations/vue/src/index.ts index be39296fead4..182eaad3d2ce 100644 --- a/packages/integrations/vue/src/index.ts +++ b/packages/integrations/vue/src/index.ts @@ -13,7 +13,7 @@ const RESOLVED_VIRTUAL_MODULE_ID = `\0${VIRTUAL_MODULE_ID}`; interface Options extends VueOptions { jsx?: boolean | VueJsxOptions; appEntrypoint?: string; - devtools?: boolean | {launchEditor: VitePluginVueDevToolsOptions['launchEditor'];}; + devtools?: boolean | Omit; } function getRenderer(): AstroRenderer { @@ -126,11 +126,11 @@ async function getViteConfiguration( if (command === 'dev' && options?.devtools) { const vueDevTools = (await import('vite-plugin-vue-devtools')).default; - const launchEditor = typeof options.devtools === 'object' ? options.devtools.launchEditor : "code" + const pluginOptions = typeof options.devtools === 'object' ? options.devtools : {} config.plugins?.push( vueDevTools({ - appendTo: VIRTUAL_MODULE_ID, - launchEditor + ...pluginOptions, + appendTo: VIRTUAL_MODULE_ID }) ); }