@@ -176,17 +176,6 @@ export interface UserConfig {
176
176
* @default 'VITE_'
177
177
*/
178
178
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 [ ]
190
179
/**
191
180
* Worker bundle options
192
181
*/
@@ -235,10 +224,7 @@ export interface InlineConfig extends UserConfig {
235
224
}
236
225
237
226
export type ResolvedConfig = Readonly <
238
- Omit <
239
- UserConfig ,
240
- 'plugins' | 'alias' | 'dedupe' | 'assetsInclude' | 'optimizeDeps' | 'worker'
241
- > & {
227
+ Omit < UserConfig , 'plugins' | 'assetsInclude' | 'optimizeDeps' | 'worker' > & {
242
228
configFile : string | undefined
243
229
configFileDependencies : string [ ]
244
230
inlineConfig : InlineConfig
@@ -261,7 +247,7 @@ export type ResolvedConfig = Readonly<
261
247
assetsInclude : ( file : string ) => boolean
262
248
logger : Logger
263
249
createResolver : ( options ?: Partial < InternalResolveOptions > ) => ResolveFn
264
- optimizeDeps : Omit < DepOptimizationOptions , 'keepNames' >
250
+ optimizeDeps : DepOptimizationOptions
265
251
/** @internal */
266
252
packageCache : PackageCache
267
253
worker : ResolveWorkerOptions
@@ -370,12 +356,11 @@ export async function resolveConfig(
370
356
// @ts -ignore because @rollup/plugin-alias' type doesn't allow function
371
357
// replacement, but its implementation does work with function values.
372
358
clientAlias ,
373
- config . resolve ?. alias || config . alias || [ ]
359
+ config . resolve ?. alias || [ ]
374
360
)
375
361
)
376
362
377
363
const resolveOptions : ResolvedConfig [ 'resolve' ] = {
378
- dedupe : config . dedupe ,
379
364
...config . resolve ,
380
365
alias : resolvedAlias
381
366
}
@@ -501,7 +486,6 @@ export async function resolveConfig(
501
486
optimizeDeps : {
502
487
...optimizeDeps ,
503
488
esbuildOptions : {
504
- keepNames : optimizeDeps . keepNames ,
505
489
preserveSymlinks : config . resolve ?. preserveSymlinks ,
506
490
...optimizeDeps . esbuildOptions
507
491
}
@@ -540,117 +524,6 @@ export async function resolveConfig(
540
524
} )
541
525
}
542
526
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
-
654
527
if ( config . build ?. terserOptions && config . build . minify !== 'terser' ) {
655
528
logger . warn (
656
529
colors . yellow (
0 commit comments