File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import process from 'node:process'
22import Vue from '@vitejs/plugin-vue'
33import { defineConfig } from 'vite'
4+ // eslint-disable-next-line ts/ban-ts-comment
5+ // @ts -ignore ignore the type error
6+ import { DevToolsViteUI } from '../../vite/src/node'
47import { DevTools } from '../src'
58import { buildCSS } from '../src/client/webcomponents/scripts/build-css'
69
@@ -22,7 +25,10 @@ export default defineConfig({
2225 } ,
2326
2427 // For local playground only. As a user you don't install this plugin directly.
25- DevTools ( ) ,
28+ DevTools ( {
29+ builtinDevTools : false ,
30+ } ) ,
31+ DevToolsViteUI ( ) ,
2632 {
2733 name : 'local' ,
2834 devtools : {
Original file line number Diff line number Diff line change 11import type { Plugin } from 'vite'
2- // eslint-disable-next-line ts/ban-ts-comment
3- // @ts -ignore ignore the type error
4- import { DevToolsViteUI } from '@vitejs/devtools-vite'
52import { DevToolsInjection } from './injection'
63import { DevToolsServer } from './server'
74
@@ -14,7 +11,7 @@ export interface DevToolsOptions {
1411 builtinDevTools ?: boolean
1512}
1613
17- export function DevTools ( options : DevToolsOptions = { } ) : Plugin [ ] {
14+ export async function DevTools ( options : DevToolsOptions = { } ) : Promise < Plugin [ ] > {
1815 const {
1916 builtinDevTools = true ,
2017 } = options
@@ -25,7 +22,9 @@ export function DevTools(options: DevToolsOptions = {}): Plugin[] {
2522 ]
2623
2724 if ( builtinDevTools ) {
28- plugins . push ( DevToolsViteUI ( ) )
25+ // eslint-disable-next-line ts/ban-ts-comment
26+ // @ts -ignore ignore the type error
27+ plugins . push ( await import ( '@vitejs/devtools-vite' ) . then ( m => m . DevToolsViteUI ( ) ) )
2928 }
3029
3130 return plugins
@@ -34,5 +33,4 @@ export function DevTools(options: DevToolsOptions = {}): Plugin[] {
3433export {
3534 DevToolsInjection ,
3635 DevToolsServer ,
37- DevToolsViteUI ,
3836}
You can’t perform that action at this time.
0 commit comments