@@ -176,17 +176,6 @@ export interface UserConfig {
176176 * @default 'VITE_'
177177 */
178178 envPrefix ?: string | string [ ]
179- /**
180- * Import aliases
181- * @deprecated use `resolve.alias` instead
182- */
183- alias ?: AliasOptions
184- /**
185- * Force Vite to always resolve listed dependencies to the same copy (from
186- * project root).
187- * @deprecated use `resolve.dedupe` instead
188- */
189- dedupe ?: string [ ]
190179 /**
191180 * Worker bundle options
192181 */
@@ -235,10 +224,7 @@ export interface InlineConfig extends UserConfig {
235224}
236225
237226export type ResolvedConfig = Readonly <
238- Omit <
239- UserConfig ,
240- 'plugins' | 'alias' | 'dedupe' | 'assetsInclude' | 'optimizeDeps' | 'worker'
241- > & {
227+ Omit < UserConfig , 'plugins' | 'assetsInclude' | 'optimizeDeps' | 'worker' > & {
242228 configFile : string | undefined
243229 configFileDependencies : string [ ]
244230 inlineConfig : InlineConfig
@@ -261,7 +247,7 @@ export type ResolvedConfig = Readonly<
261247 assetsInclude : ( file : string ) => boolean
262248 logger : Logger
263249 createResolver : ( options ?: Partial < InternalResolveOptions > ) => ResolveFn
264- optimizeDeps : Omit < DepOptimizationOptions , 'keepNames' >
250+ optimizeDeps : DepOptimizationOptions
265251 /** @internal */
266252 packageCache : PackageCache
267253 worker : ResolveWorkerOptions
@@ -370,12 +356,11 @@ export async function resolveConfig(
370356 // @ts -ignore because @rollup/plugin-alias' type doesn't allow function
371357 // replacement, but its implementation does work with function values.
372358 clientAlias ,
373- config . resolve ?. alias || config . alias || [ ]
359+ config . resolve ?. alias || [ ]
374360 )
375361 )
376362
377363 const resolveOptions : ResolvedConfig [ 'resolve' ] = {
378- dedupe : config . dedupe ,
379364 ...config . resolve ,
380365 alias : resolvedAlias
381366 }
@@ -501,7 +486,6 @@ export async function resolveConfig(
501486 optimizeDeps : {
502487 ...optimizeDeps ,
503488 esbuildOptions : {
504- keepNames : optimizeDeps . keepNames ,
505489 preserveSymlinks : config . resolve ?. preserveSymlinks ,
506490 ...optimizeDeps . esbuildOptions
507491 }
@@ -540,117 +524,6 @@ export async function resolveConfig(
540524 } )
541525 }
542526
543- // TODO Deprecation warnings - remove when out of beta
544-
545- const logDeprecationWarning = (
546- deprecatedOption : string ,
547- hint : string ,
548- error ?: Error
549- ) => {
550- logger . warn (
551- colors . yellow (
552- colors . bold (
553- `(!) "${ deprecatedOption } " option is deprecated. ${ hint } ${
554- error ? `\n${ error . stack } ` : ''
555- } `
556- )
557- )
558- )
559- }
560-
561- if ( config . build ?. base ) {
562- logDeprecationWarning (
563- 'build.base' ,
564- '"base" is now a root-level config option.'
565- )
566- config . base = config . build . base
567- }
568- Object . defineProperty ( resolvedBuildOptions , 'base' , {
569- enumerable : false ,
570- get ( ) {
571- logDeprecationWarning (
572- 'build.base' ,
573- '"base" is now a root-level config option.' ,
574- new Error ( )
575- )
576- return resolved . base
577- }
578- } )
579-
580- if ( config . alias ) {
581- logDeprecationWarning ( 'alias' , 'Use "resolve.alias" instead.' )
582- }
583- Object . defineProperty ( resolved , 'alias' , {
584- enumerable : false ,
585- get ( ) {
586- logDeprecationWarning (
587- 'alias' ,
588- 'Use "resolve.alias" instead.' ,
589- new Error ( )
590- )
591- return resolved . resolve . alias
592- }
593- } )
594-
595- if ( config . dedupe ) {
596- logDeprecationWarning ( 'dedupe' , 'Use "resolve.dedupe" instead.' )
597- }
598- Object . defineProperty ( resolved , 'dedupe' , {
599- enumerable : false ,
600- get ( ) {
601- logDeprecationWarning (
602- 'dedupe' ,
603- 'Use "resolve.dedupe" instead.' ,
604- new Error ( )
605- )
606- return resolved . resolve . dedupe
607- }
608- } )
609-
610- if ( optimizeDeps . keepNames ) {
611- logDeprecationWarning (
612- 'optimizeDeps.keepNames' ,
613- 'Use "optimizeDeps.esbuildOptions.keepNames" instead.'
614- )
615- }
616- Object . defineProperty ( resolved . optimizeDeps , 'keepNames' , {
617- enumerable : false ,
618- get ( ) {
619- logDeprecationWarning (
620- 'optimizeDeps.keepNames' ,
621- 'Use "optimizeDeps.esbuildOptions.keepNames" instead.' ,
622- new Error ( )
623- )
624- return resolved . optimizeDeps . esbuildOptions ?. keepNames
625- }
626- } )
627-
628- if ( config . build ?. polyfillDynamicImport ) {
629- logDeprecationWarning (
630- 'build.polyfillDynamicImport' ,
631- '"polyfillDynamicImport" has been removed. Please use @vitejs/plugin-legacy if your target browsers do not support dynamic imports.'
632- )
633- }
634-
635- Object . defineProperty ( resolvedBuildOptions , 'polyfillDynamicImport' , {
636- enumerable : false ,
637- get ( ) {
638- logDeprecationWarning (
639- 'build.polyfillDynamicImport' ,
640- '"polyfillDynamicImport" has been removed. Please use @vitejs/plugin-legacy if your target browsers do not support dynamic imports.' ,
641- new Error ( )
642- )
643- return false
644- }
645- } )
646-
647- if ( config . build ?. cleanCssOptions ) {
648- logDeprecationWarning (
649- 'build.cleanCssOptions' ,
650- 'Vite now uses esbuild for CSS minification.'
651- )
652- }
653-
654527 if ( config . build ?. terserOptions && config . build . minify !== 'terser' ) {
655528 logger . warn (
656529 colors . yellow (
0 commit comments