File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ export class Context {
43
43
this . options = resolveOptions ( rawOptions , this . root )
44
44
this . sourcemap = rawOptions . sourcemap ?? true
45
45
this . generateDeclaration = throttle ( 500 , this . _generateDeclaration . bind ( this ) , { noLeading : false } )
46
- this . _removeUnused = this . options . syncMode === 'overwrite'
46
+
47
+ // syncMode - `default`: use `append` strategy when using dev server, `overwrite` strategy when using build.
48
+ const syncMode = this . options . syncMode === 'default' ? ( process . env . NODE_ENV === 'development' ? 'append' : 'overwrite' ) : this . options . syncMode
49
+ this . _removeUnused = syncMode === 'overwrite'
47
50
48
51
if ( this . options . dumpComponentsInfo ) {
49
52
const dumpComponentsInfo = this . options . dumpComponentsInfo === true
@@ -80,7 +83,6 @@ export class Context {
80
83
return
81
84
82
85
this . _server = server
83
- this . _removeUnused = this . options . syncMode !== 'append'
84
86
this . setupWatcher ( server . watcher )
85
87
}
86
88
You can’t perform that action at this time.
0 commit comments