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 {
4343 this . options = resolveOptions ( rawOptions , this . root )
4444 this . sourcemap = rawOptions . sourcemap ?? true
4545 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'
4750
4851 if ( this . options . dumpComponentsInfo ) {
4952 const dumpComponentsInfo = this . options . dumpComponentsInfo === true
@@ -80,7 +83,6 @@ export class Context {
8083 return
8184
8285 this . _server = server
83- this . _removeUnused = this . options . syncMode !== 'append'
8486 this . setupWatcher ( server . watcher )
8587 }
8688
You can’t perform that action at this time.
0 commit comments