Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 8870a17

Browse files
intodevelopmentliamdebeasi
authored andcommitted
fix(livereload): find all bundles to update
HTML template of components is not updated by ionic serve after saving the file. When a module is shared among multiple modules, e.g., a components module, the component template is present in multiple bundle files, so the template should be replaced in all bundle files.
1 parent aeef5ee commit 8870a17

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/template.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ export function templateUpdate(changedFiles: ChangedFile[], context: BuildContex
2222
if (!updateCorrespondingJsFile(context, file.content, changedTemplateFile.filePath)) {
2323
throw new Error(`Failed to inline template ${changedTemplateFile.filePath}`);
2424
}
25-
// find the corresponding bundle
25+
// find the corresponding bundles
2626
for (const bundleFile of bundleFiles) {
2727
const newContent = replaceExistingJsTemplate(bundleFile.content, file.content, changedTemplateFile.filePath);
2828
if (newContent && newContent !== bundleFile.content) {
2929
context.fileCache.set(bundleFile.path, { path: bundleFile.path, content: newContent});
3030
writeFileSync(bundleFile.path, newContent);
31-
break;
3231
}
3332
}
3433
}

0 commit comments

Comments
 (0)