Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5794591

Browse files
authored
fix: syncMode -default: useappend strategy when using dev server,overwrite strategy when using build. (#887)
1 parentd02b88f commit5794591

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/core/context.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ 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+
this._removeUnused=this.options.syncMode!=='append'
4747

4848
if(this.options.dumpComponentsInfo){
4949
constdumpComponentsInfo=this.options.dumpComponentsInfo===true
@@ -80,13 +80,13 @@ export class Context {
8080
return
8181

8282
this._server=server
83-
this._removeUnused=this.options.syncMode!=='append'
83+
this._removeUnused=this.options.syncMode==='overwrite'
8484
this.setupWatcher(server.watcher)
8585
}
8686

8787
setupWatcher(watcher:fs.FSWatcher){
8888
const{ globs}=this.options
89-
89+
this._removeUnused=this.options.syncMode==='overwrite'
9090
watcher
9191
.on('unlink',(path)=>{
9292
if(!matchGlobs(path,globs))
@@ -112,7 +112,7 @@ export class Context {
112112
*/
113113
setupWatcherWebpack(watcher:fs.FSWatcher,emitUpdate:(path:string,type:'unlink'|'add')=>void){
114114
const{ globs}=this.options
115-
115+
this._removeUnused=this.options.syncMode==='overwrite'
116116
watcher
117117
.on('unlink',(path)=>{
118118
if(!matchGlobs(path,globs))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp