@@ -8,6 +8,7 @@ import type {
8
8
Logger ,
9
9
PluginOption ,
10
10
ResolvedConfig ,
11
+ Rollup ,
11
12
UserConfig ,
12
13
ViteDevServer ,
13
14
} from 'vite'
@@ -19,7 +20,6 @@ import {
19
20
preview ,
20
21
} from 'vite'
21
22
import type { Browser , Page } from 'playwright-chromium'
22
- import type { RollupError , RollupWatcher , RollupWatcherEvent } from 'rollup'
23
23
import type { File } from 'vitest'
24
24
import { beforeAll } from 'vitest'
25
25
@@ -72,7 +72,7 @@ export let resolvedConfig: ResolvedConfig = undefined!
72
72
export let page : Page = undefined !
73
73
export let browser : Browser = undefined !
74
74
export let viteTestUrl : string = ''
75
- export let watcher : RollupWatcher | undefined = undefined
75
+ export let watcher : Rollup . RollupWatcher | undefined = undefined
76
76
77
77
declare module 'vite' {
78
78
interface InlineConfig {
@@ -269,7 +269,7 @@ export async function startDefaultServe(): Promise<void> {
269
269
const isWatch = ! ! resolvedConfig ! . build . watch
270
270
// in build watch,call startStaticServer after the build is complete
271
271
if ( isWatch ) {
272
- watcher = rollupOutput as RollupWatcher
272
+ watcher = rollupOutput as Rollup . RollupWatcher
273
273
await notifyRebuildComplete ( watcher )
274
274
}
275
275
// @ts -ignore
@@ -290,10 +290,10 @@ export async function startDefaultServe(): Promise<void> {
290
290
* Send the rebuild complete message in build watch
291
291
*/
292
292
export async function notifyRebuildComplete (
293
- watcher : RollupWatcher ,
294
- ) : Promise < RollupWatcher > {
293
+ watcher : Rollup . RollupWatcher ,
294
+ ) : Promise < Rollup . RollupWatcher > {
295
295
let resolveFn : undefined | ( ( ) => void )
296
- const callback = ( event : RollupWatcherEvent ) : void => {
296
+ const callback = ( event : Rollup . RollupWatcherEvent ) : void => {
297
297
if ( event . code === 'END' ) {
298
298
resolveFn ?.( )
299
299
}
@@ -306,7 +306,7 @@ export async function notifyRebuildComplete(
306
306
}
307
307
308
308
function createInMemoryLogger ( logs : string [ ] ) : Logger {
309
- const loggedErrors = new WeakSet < Error | RollupError > ( )
309
+ const loggedErrors = new WeakSet < Error | Rollup . RollupError > ( )
310
310
const warnedMessages = new Set < string > ( )
311
311
312
312
const logger : Logger = {
0 commit comments