@@ -548,6 +548,7 @@ export interface InlineConfig extends UserConfig {
548
548
/** @experimental */
549
549
configLoader ?: 'bundle' | 'runner'
550
550
envFile ?: false
551
+ forceOptimizeDeps ?: boolean
551
552
}
552
553
553
554
export interface ResolvedConfig
@@ -775,6 +776,7 @@ function resolveEnvironmentOptions(
775
776
options : EnvironmentOptions ,
776
777
alias : Alias [ ] ,
777
778
preserveSymlinks : boolean ,
779
+ forceOptimizeDeps : boolean | undefined ,
778
780
logger : Logger ,
779
781
environmentName : string ,
780
782
// Backward compatibility
@@ -804,6 +806,7 @@ function resolveEnvironmentOptions(
804
806
optimizeDeps : resolveDepOptimizationOptions (
805
807
options . optimizeDeps ,
806
808
resolve . preserveSymlinks ,
809
+ forceOptimizeDeps ,
807
810
consumer ,
808
811
) ,
809
812
dev : resolveDevEnvironmentOptions (
@@ -980,6 +983,7 @@ function resolveResolveOptions(
980
983
function resolveDepOptimizationOptions (
981
984
optimizeDeps : DepOptimizationOptions | undefined ,
982
985
preserveSymlinks : boolean ,
986
+ forceOptimizeDeps : boolean | undefined ,
983
987
consumer : 'client' | 'server' | undefined ,
984
988
) : DepOptimizationOptions {
985
989
return mergeWithDefaults (
@@ -990,6 +994,7 @@ function resolveDepOptimizationOptions(
990
994
esbuildOptions : {
991
995
preserveSymlinks,
992
996
} ,
997
+ force : forceOptimizeDeps ?? configDefaults . optimizeDeps . force ,
993
998
} ,
994
999
optimizeDeps ?? { } ,
995
1000
)
@@ -1202,6 +1207,7 @@ export async function resolveConfig(
1202
1207
config . environments [ environmentName ] ,
1203
1208
resolvedDefaultResolve . alias ,
1204
1209
resolvedDefaultResolve . preserveSymlinks ,
1210
+ inlineConfig . forceOptimizeDeps ,
1205
1211
logger ,
1206
1212
environmentName ,
1207
1213
config . experimental ?. skipSsrTransform ,
0 commit comments