Skip to content

Commit bd96064

Browse files
committedJan 21, 2025
fix: pass matched paths to chokidar watcher (watchAssets)
1 parent 6932655 commit bd96064

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

Diff for: ‎lib/compiler/assets-manager.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ import * as chokidar from 'chokidar';
22
import { copyFileSync, mkdirSync, rmSync, statSync } from 'fs';
33
import { sync } from 'glob';
44
import { dirname, join, sep } from 'path';
5-
import { ActionOnFile, Asset, AssetEntry, Configuration } from '../configuration';
5+
import {
6+
ActionOnFile,
7+
Asset,
8+
AssetEntry,
9+
Configuration,
10+
} from '../configuration';
611
import { copyPathResolve } from './helpers/copy-path-resolve';
712
import { getValueOrDefault } from './helpers/get-value-or-default';
813

@@ -91,7 +96,10 @@ export class AssetsManager {
9196
if (isWatchEnabled || item.watchAssets) {
9297
// prettier-ignore
9398
const watcher = chokidar
94-
.watch(item.glob, { ignored: item.exclude })
99+
.watch(sync(item.glob, {
100+
ignore: item.exclude,
101+
dot: true,
102+
}))
95103
.on('add', (path: string) => this.actionOnFile({ ...option, path, action: 'change' }))
96104
.on('change', (path: string) => this.actionOnFile({ ...option, path, action: 'change' }))
97105
.on('unlink', (path: string) => this.actionOnFile({ ...option, path, action: 'unlink' }));

0 commit comments

Comments
 (0)