Commit c94f564 1 parent 7257fd8 commit c94f564 Copy full SHA for c94f564
File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -648,6 +648,19 @@ export async function resolveConfig(
648
648
)
649
649
}
650
650
651
+ if (
652
+ config . server ?. force &&
653
+ ! isBuild &&
654
+ config . optimizeDeps ?. force === undefined
655
+ ) {
656
+ resolved . optimizeDeps . force = true
657
+ logger . warn (
658
+ colors . yellow (
659
+ `server.force is deprecated, use optimizeDeps.force instead`
660
+ )
661
+ )
662
+ }
663
+
651
664
if ( resolved . legacy ?. buildRollupPluginCommonjs ) {
652
665
const optimizerDisabled = resolved . optimizeDeps . disabled
653
666
if ( ! optimizerDisabled ) {
Original file line number Diff line number Diff line change @@ -96,6 +96,13 @@ export interface ServerOptions extends CommonServerOptions {
96
96
* @default true
97
97
*/
98
98
preTransformRequests ?: boolean
99
+ /**
100
+ * Force dep pre-optimization regardless of whether deps have changed.
101
+ *
102
+ * @deprecated Use optimizeDeps.force instead, this option may be removed
103
+ * in a future minor version without following semver
104
+ */
105
+ force ?: boolean
99
106
}
100
107
101
108
export interface ResolvedServerOptions extends ServerOptions {
@@ -697,7 +704,7 @@ async function restartServer(server: ViteDevServer) {
697
704
let inlineConfig = server . config . inlineConfig
698
705
if ( server . _forceOptimizeOnRestart ) {
699
706
inlineConfig = mergeConfig ( inlineConfig , {
700
- server : {
707
+ optimizeDeps : {
701
708
force : true
702
709
}
703
710
} )
You can’t perform that action at this time.
0 commit comments