Skip to content

Commit

Permalink
add default ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 2, 2023
1 parent a9caff2 commit 0ba79bc
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,28 @@ export async function listenAndWatch(
);

Check warning on line 74 in src/watch.ts

View check run for this annotation

Codecov / codecov/patch

src/watch.ts#L70-L74

Added lines #L70 - L74 were not covered by tests

const entryDir = dirname(importer.entry);
watcher = await subscribe(entryDir, (_error, events) => {
if (events.length === 0) {
return;
}
resolveHandle().then(() => {
const eventsString = events
.map((e) => `${importer.formateRelative(e.path)} ${e.type}d`)
.join(", ");
logger.log(`${eventsString}. Reloading server...`);
if (error) {
logger.error(error);
} else {
logger.log(`πŸ”ƒ Server Reloaded in ${loadTime}ms.`);
watcher = await subscribe(
entryDir,
(_error, events) => {
if (events.length === 0) {
return;
}
});
});
resolveHandle().then(() => {
const eventsString = events
.map((e) => `${importer.formateRelative(e.path)} ${e.type}d`)
.join(", ");
logger.log(`${eventsString}. Reloading server...`);
if (error) {
logger.error(error);
} else {
logger.log(`πŸ”ƒ Server Reloaded in ${loadTime}ms.`);
}
});
},
{
ignore: ["**/.git/**", "**/node_modules/**", "**/dist/**"],
},
);

Check warning on line 98 in src/watch.ts

View check run for this annotation

Codecov / codecov/patch

src/watch.ts#L76-L98

Added lines #L76 - L98 were not covered by tests

logger.log(`πŸ‘€ Watching ${importer.formateRelative(entryDir)} for changes.`);

Check warning on line 100 in src/watch.ts

View check run for this annotation

Codecov / codecov/patch

src/watch.ts#L100

Added line #L100 was not covered by tests

Expand Down

0 comments on commit 0ba79bc

Please sign in to comment.