Skip to content

Commit e6aaf17

Browse files
authored
feat: add future: 'warn' (vitejs#20473)
1 parent 10d48bb commit e6aaf17

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

packages/vite/src/node/config.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ export interface UserConfig extends DefaultEnvironmentOptions {
391391
/**
392392
* Options to opt-in to future behavior
393393
*/
394-
future?: FutureOptions
394+
future?: FutureOptions | 'warn'
395395
/**
396396
* Legacy options
397397
*
@@ -559,6 +559,7 @@ export interface ResolvedConfig
559559
| 'dev'
560560
| 'environments'
561561
| 'experimental'
562+
| 'future'
562563
| 'server'
563564
| 'preview'
564565
> & {
@@ -617,6 +618,7 @@ export interface ResolvedConfig
617618
worker: ResolvedWorkerOptions
618619
appType: AppType
619620
experimental: RequiredExceptFor<ExperimentalOptions, 'renderBuiltUrl'>
621+
future: FutureOptions | undefined
620622
environments: Record<string, ResolvedEnvironmentOptions>
621623
/**
622624
* The token to connect to the WebSocket server from browsers.
@@ -1534,7 +1536,20 @@ export async function resolveConfig(
15341536
configDefaults.experimental,
15351537
config.experimental ?? {},
15361538
),
1537-
future: config.future,
1539+
future:
1540+
config.future === 'warn'
1541+
? ({
1542+
removePluginHookHandleHotUpdate: 'warn',
1543+
removePluginHookSsrArgument: 'warn',
1544+
removeServerModuleGraph: 'warn',
1545+
removeServerReloadModule: 'warn',
1546+
removeServerPluginContainer: 'warn',
1547+
removeServerHot: 'warn',
1548+
removeServerTransformRequest: 'warn',
1549+
removeServerWarmupRequest: 'warn',
1550+
removeSsrLoadModule: 'warn',
1551+
} satisfies Required<FutureOptions>)
1552+
: config.future,
15381553

15391554
ssr,
15401555

0 commit comments

Comments
 (0)