mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 20:19:13 +00:00
prevent infinite loop in build watcher
This commit is contained in:
@@ -386,10 +386,14 @@ export async function build(options = {}) {
|
||||
},
|
||||
);
|
||||
|
||||
const watchEvents = ['change', 'unlink', 'add'];
|
||||
const watchEvents = [
|
||||
'change',
|
||||
'unlink',
|
||||
'add'
|
||||
];
|
||||
// Rebuild and reload when source files change
|
||||
options.watchedSrcDirectories.forEach(dir => {
|
||||
const watcher = bs.watch(join(dir, '**', '!(*.test).*'));
|
||||
const watcher = bs.watch(join(dir, '**', '!(*.test).*'), { ignoreInitial: true });
|
||||
|
||||
watchEvents.forEach(evt => {
|
||||
watcher.on(evt, handleWatchEvent(evt));
|
||||
@@ -456,7 +460,7 @@ export async function build(options = {}) {
|
||||
|
||||
// Rebuild the docs and reload when the docs change
|
||||
options.watchedDocsDirectories.forEach(dir => {
|
||||
const watcher = bs.watch(join(dir, '**', '*.*'));
|
||||
const watcher = bs.watch(join(dir, '**', '*.*'), { ignoreInitial: true });
|
||||
|
||||
watchEvents.forEach(evt => {
|
||||
watcher.on(evt, handleWatchEvent(evt));
|
||||
|
||||
Reference in New Issue
Block a user