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

Fixes error with templateUpdate and multiple js files on same path #557

Merged
merged 2 commits into from
Dec 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function updateCorrespondingJsFile(context: BuildContext, newTemplateContent: st
const javascriptFiles = context.fileCache.getAll().filter((file: File) => dirname(file.path) === dirname(existingHtmlTemplatePath) && extname(file.path) === '.js');
for (const javascriptFile of javascriptFiles) {
const newContent = replaceExistingJsTemplate(javascriptFile.content, newTemplateContent, existingHtmlTemplatePath);
if (newContent !== javascriptFile.content) {
if (newContent && newContent !== javascriptFile.content) {
javascriptFile.content = newContent;
// set the file again to generate a new timestamp
// do the same for the typescript file just to invalidate any caches, etc.
Expand Down