Skip to content

Commit

Permalink
fix: pass matched paths to chokidar watcher (watchAssets)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jan 21, 2025
1 parent 6932655 commit bd96064
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/compiler/assets-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import * as chokidar from 'chokidar';
import { copyFileSync, mkdirSync, rmSync, statSync } from 'fs';
import { sync } from 'glob';
import { dirname, join, sep } from 'path';
import { ActionOnFile, Asset, AssetEntry, Configuration } from '../configuration';
import {
ActionOnFile,
Asset,
AssetEntry,
Configuration,
} from '../configuration';
import { copyPathResolve } from './helpers/copy-path-resolve';
import { getValueOrDefault } from './helpers/get-value-or-default';

Expand Down Expand Up @@ -91,7 +96,10 @@ export class AssetsManager {
if (isWatchEnabled || item.watchAssets) {
// prettier-ignore
const watcher = chokidar
.watch(item.glob, { ignored: item.exclude })
.watch(sync(item.glob, {
ignore: item.exclude,
dot: true,
}))
.on('add', (path: string) => this.actionOnFile({ ...option, path, action: 'change' }))
.on('change', (path: string) => this.actionOnFile({ ...option, path, action: 'change' }))
.on('unlink', (path: string) => this.actionOnFile({ ...option, path, action: 'unlink' }));
Expand Down

0 comments on commit bd96064

Please sign in to comment.