Skip to content

Commit

Permalink
chore: Reload the template when it is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
spring-raining committed Sep 7, 2024
1 parent 287f974 commit 86c3d8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/input/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export interface ManuscriptEntry {
title?: string;
themes: ParsedTheme[];
source: string;
template?: undefined;
target: string;
rel?: string | string[];
}
Expand Down
6 changes: 4 additions & 2 deletions src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ export async function preview(cliFlags: PreviewCliFlags) {
if (
config.entries.length &&
/\.(md|markdown|html?|xhtml|xht)$/i.test(path) &&
config.entries.every(
(entry) => !entry.source || !pathEquals(path, entry.source),
!config.entries.some(
(entry) =>
(entry.source && pathEquals(path, entry.source)) ||
(entry.template && pathEquals(path, entry.template.source)),
)
) {
return true; // ignore md or html files not in entries source
Expand Down

0 comments on commit 86c3d8d

Please sign in to comment.