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

Commit

Permalink
fix(inline-templates): check for existence of content (#557)
Browse files Browse the repository at this point in the history
* Fixes error with templateUpdate and multiple js files on same path

* fix(inline-templates): check for existence of content
  • Loading branch information
gust42 authored and danbucholtz committed Dec 16, 2016
1 parent f632298 commit b68e125
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit b68e125

Please sign in to comment.