From 8333ae6fe23fe2e2cdee0ba8ec9e3a8acee2ba8a Mon Sep 17 00:00:00 2001 From: Gusten Andersson Date: Thu, 15 Dec 2016 15:17:27 +0100 Subject: [PATCH 1/2] Fixes error with templateUpdate and multiple js files on same path --- src/template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/template.ts b/src/template.ts index 466695e3..81c2161d 100644 --- a/src/template.ts +++ b/src/template.ts @@ -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 !== null && 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. From cc7b475643717484ff6b6d10685eca0770c2fd3c Mon Sep 17 00:00:00 2001 From: Dan Bucholtz Date: Fri, 16 Dec 2016 11:19:44 -0600 Subject: [PATCH 2/2] fix(inline-templates): check for existence of content --- src/template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/template.ts b/src/template.ts index 81c2161d..51f66416 100644 --- a/src/template.ts +++ b/src/template.ts @@ -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 !== null && 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.