File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ export interface Plugin extends RollupPlugin {
5555 /**
5656 * Apply the plugin only for serve or build, or on certain conditions.
5757 */
58- apply ?: 'serve' | 'build' | ( ( config : UserConfig , env : ConfigEnv ) => boolean )
58+ apply ?:
59+ | 'serve'
60+ | 'build'
61+ | ( ( this : void , config : UserConfig , env : ConfigEnv ) => boolean )
5962 /**
6063 * Modify vite config before it's resolved. The hook can either mutate the
6164 * passed-in config directly, or return a partial config object that will be
@@ -66,14 +69,17 @@ export interface Plugin extends RollupPlugin {
6669 */
6770 config ?: ObjectHook <
6871 (
72+ this : void ,
6973 config : UserConfig ,
7074 env : ConfigEnv
7175 ) => UserConfig | null | void | Promise < UserConfig | null | void >
7276 >
7377 /**
7478 * Use this hook to read and store the final resolved vite config.
7579 */
76- configResolved ?: ObjectHook < ( config : ResolvedConfig ) => void | Promise < void > >
80+ configResolved ?: ObjectHook <
81+ ( this : void , config : ResolvedConfig ) => void | Promise < void >
82+ >
7783 /**
7884 * Configure the vite server. The hook receives the {@link ViteDevServer}
7985 * instance. This can also be used to store a reference to the server
@@ -126,6 +132,7 @@ export interface Plugin extends RollupPlugin {
126132 */
127133 handleHotUpdate ?: ObjectHook <
128134 (
135+ this : void ,
129136 ctx : HmrContext
130137 ) => Array < ModuleNode > | void | Promise < Array < ModuleNode > | void >
131138 >
Original file line number Diff line number Diff line change @@ -846,6 +846,7 @@ export interface IndexHtmlTransformContext {
846846}
847847
848848export type IndexHtmlTransformHook = (
849+ this : void ,
849850 html : string ,
850851 ctx : IndexHtmlTransformContext
851852) => IndexHtmlTransformResult | void | Promise < IndexHtmlTransformResult | void >
Original file line number Diff line number Diff line change @@ -62,10 +62,13 @@ export interface PreviewServer {
6262 printUrls ( ) : void
6363}
6464
65- export type PreviewServerHook = ( server : {
66- middlewares : Connect . Server
67- httpServer : http . Server
68- } ) => ( ( ) => void ) | void | Promise < ( ( ) => void ) | void >
65+ export type PreviewServerHook = (
66+ this : void ,
67+ server : {
68+ middlewares : Connect . Server
69+ httpServer : http . Server
70+ }
71+ ) => ( ( ) => void ) | void | Promise < ( ( ) => void ) | void >
6972
7073/**
7174 * Starts the Vite server in preview mode, to simulate a production deployment
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ export interface FileSystemServeOptions {
151151}
152152
153153export type ServerHook = (
154+ this : void ,
154155 server : ViteDevServer
155156) => ( ( ) => void ) | void | Promise < ( ( ) => void ) | void >
156157
You can’t perform that action at this time.
0 commit comments