Skip to content

Commit

Permalink
chore(pr): implement changes requested in pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Niklas Wortmann committed May 16, 2024
1 parent ca888f0 commit 70c45d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-needles-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/vue": minor
---

expose VueDevToolsOptions to allow non-default launchEditor
8 changes: 4 additions & 4 deletions packages/integrations/vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<VitePluginVueDevToolsOptions, "appendTo">;
}

function getRenderer(): AstroRenderer {
Expand Down Expand Up @@ -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
})
);
}
Expand Down

0 comments on commit 70c45d1

Please sign in to comment.