@@ -3,7 +3,7 @@ import { AddressInfo } from 'net'
33import path from 'path'
44import colors from 'picocolors'
55import { Plugin , loadEnv , UserConfig , ConfigEnv , Manifest , ResolvedConfig , SSROptions , normalizePath , PluginOption } from 'vite'
6- import fullReload from 'vite-plugin-full-reload'
6+ import fullReload , { Config as FullReloadConfig } from 'vite-plugin-full-reload'
77
88interface PluginConfig {
99 /**
@@ -43,40 +43,12 @@ interface PluginConfig {
4343 * {@link https://github.com/ElMassimo/vite-plugin-full-reload}
4444 * @default false
4545 */
46- refresh ?: boolean | string | string [ ] | FullReloadConfig | FullReloadConfig [ ]
46+ refresh ?: boolean | string | string [ ] | RefreshConfig | RefreshConfig [ ]
4747}
4848
49- interface FullReloadConfig {
49+ interface RefreshConfig {
5050 paths : string [ ] ,
51- config ?: {
52- /**
53- * Whether full reload should happen regardless of the file path.
54- *
55- * @default true
56- */
57- always ?: boolean
58-
59- /**
60- * How many milliseconds to wait before reloading the page after a file change.
61- *
62- * @default 0
63- */
64- delay ?: number
65-
66- /**
67- * Whether to log when a file change triggers a full reload.
68- *
69- * @default true
70- */
71- log ?: boolean
72-
73- /**
74- * Files will be resolved against this path.
75- *
76- * @default process.cwd()
77- */
78- root ?: string
79- }
51+ config ?: FullReloadConfig ,
8052}
8153
8254interface LaravelPlugin extends Plugin {
@@ -383,10 +355,10 @@ function resolveFullReloadConfig({ refresh: config }: Required<PluginConfig>): P
383355 }
384356
385357 if ( config . some ( c => typeof c === 'string' ) ) {
386- config = [ { paths : config } ] as FullReloadConfig [ ]
358+ config = [ { paths : config } ] as RefreshConfig [ ]
387359 }
388360
389- return ( config as FullReloadConfig [ ] ) . flatMap ( c => {
361+ return ( config as RefreshConfig [ ] ) . flatMap ( c => {
390362 const plugin = fullReload ( c . paths , c . config )
391363
392364 /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
0 commit comments