Skip to content

Commit 323f8d9

Browse files
committed
Watch readme and includes even if not found
1 parent 30a85d1 commit 323f8d9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/lib/converter/plugins/IncludePlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export class IncludePlugin extends ConverterComponent {
6363
}
6464

6565
const file = path.resolve(relative, part.text.trim());
66+
this.application.watchFile(file);
6667
if (included.includes(file) && part.tag === "@include") {
6768
this.logger.error(
6869
this.logger.i18n.include_0_in_1_specified_2_circular_include_3(
@@ -73,7 +74,6 @@ export class IncludePlugin extends ConverterComponent {
7374
),
7475
);
7576
} else if (isFile(file)) {
76-
this.application.watchFile(file);
7777
const text = fs.readFileSync(file, "utf-8");
7878
if (part.tag === "@include") {
7979
const sf = new MinimalSourceFile(text, file);

src/lib/converter/plugins/PackagePlugin.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export class PackagePlugin extends ConverterComponent {
9898

9999
if (this.readme) {
100100
// Readme path provided, read only that file.
101+
this.application.watchFile(this.readme);
101102
try {
102103
this.readmeContents = readFile(this.readme);
103104
this.readmeFile = this.readme;
@@ -119,6 +120,7 @@ export class PackagePlugin extends ConverterComponent {
119120
if (result) {
120121
this.readmeFile = result.file;
121122
this.readmeContents = result.content;
123+
this.application.watchFile(this.readmeFile);
122124
}
123125
}
124126
}
@@ -135,7 +137,6 @@ export class PackagePlugin extends ConverterComponent {
135137
);
136138

137139
project.readme = content;
138-
this.application.watchFile(this.readmeFile);
139140

140141
// This isn't ideal, but seems better than figuring out the readme
141142
// path over in the include plugin...

0 commit comments

Comments
 (0)