Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/core/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Context {
this.options = resolveOptions(rawOptions, this.root)
this.sourcemap = rawOptions.sourcemap ?? true
this.generateDeclaration = throttle(500, this._generateDeclaration.bind(this), { noLeading: false })
this._removeUnused = this.options.syncMode === 'overwrite'
this._removeUnused = this.options.syncMode !== 'append'

if (this.options.dumpComponentsInfo) {
const dumpComponentsInfo = this.options.dumpComponentsInfo === true
Expand Down Expand Up @@ -80,13 +80,13 @@ export class Context {
return

this._server = server
this._removeUnused = this.options.syncMode !== 'append'
this._removeUnused = this.options.syncMode === 'overwrite'
this.setupWatcher(server.watcher)
}

setupWatcher(watcher: fs.FSWatcher) {
const { globs } = this.options

this._removeUnused = this.options.syncMode === 'overwrite'
watcher
.on('unlink', (path) => {
if (!matchGlobs(path, globs))
Expand All @@ -112,7 +112,7 @@ export class Context {
*/
setupWatcherWebpack(watcher: fs.FSWatcher, emitUpdate: (path: string, type: 'unlink' | 'add') => void) {
const { globs } = this.options

this._removeUnused = this.options.syncMode === 'overwrite'
watcher
.on('unlink', (path) => {
if (!matchGlobs(path, globs))
Expand Down