mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
[ci] format
This commit is contained in:
parent
b92de22d28
commit
3dd57f69e3
1 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,7 @@ import type { Options as VueJsxOptions } from '@vitejs/plugin-vue-jsx';
|
||||||
import { MagicString } from '@vue/compiler-sfc';
|
import { MagicString } from '@vue/compiler-sfc';
|
||||||
import type { AstroIntegration, AstroRenderer, HookParameters } from 'astro';
|
import type { AstroIntegration, AstroRenderer, HookParameters } from 'astro';
|
||||||
import type { Plugin, UserConfig } from 'vite';
|
import type { Plugin, UserConfig } from 'vite';
|
||||||
import type {VitePluginVueDevToolsOptions} from "vite-plugin-vue-devtools";
|
import type { VitePluginVueDevToolsOptions } from 'vite-plugin-vue-devtools';
|
||||||
|
|
||||||
const VIRTUAL_MODULE_ID = 'virtual:@astrojs/vue/app';
|
const VIRTUAL_MODULE_ID = 'virtual:@astrojs/vue/app';
|
||||||
const RESOLVED_VIRTUAL_MODULE_ID = `\0${VIRTUAL_MODULE_ID}`;
|
const RESOLVED_VIRTUAL_MODULE_ID = `\0${VIRTUAL_MODULE_ID}`;
|
||||||
|
@ -13,7 +13,7 @@ const RESOLVED_VIRTUAL_MODULE_ID = `\0${VIRTUAL_MODULE_ID}`;
|
||||||
interface Options extends VueOptions {
|
interface Options extends VueOptions {
|
||||||
jsx?: boolean | VueJsxOptions;
|
jsx?: boolean | VueJsxOptions;
|
||||||
appEntrypoint?: string;
|
appEntrypoint?: string;
|
||||||
devtools?: boolean | Omit<VitePluginVueDevToolsOptions, "appendTo">;
|
devtools?: boolean | Omit<VitePluginVueDevToolsOptions, 'appendTo'>;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRenderer(): AstroRenderer {
|
function getRenderer(): AstroRenderer {
|
||||||
|
@ -126,11 +126,11 @@ async function getViteConfiguration(
|
||||||
|
|
||||||
if (command === 'dev' && options?.devtools) {
|
if (command === 'dev' && options?.devtools) {
|
||||||
const vueDevTools = (await import('vite-plugin-vue-devtools')).default;
|
const vueDevTools = (await import('vite-plugin-vue-devtools')).default;
|
||||||
const devToolsOptions = typeof options.devtools === 'object' ? options.devtools : {}
|
const devToolsOptions = typeof options.devtools === 'object' ? options.devtools : {};
|
||||||
config.plugins?.push(
|
config.plugins?.push(
|
||||||
vueDevTools({
|
vueDevTools({
|
||||||
...devToolsOptions,
|
...devToolsOptions,
|
||||||
appendTo: VIRTUAL_MODULE_ID
|
appendTo: VIRTUAL_MODULE_ID,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue