From e808452ed6796643f1f0bc6f5ed597a5c36036a5 Mon Sep 17 00:00:00 2001 From: Randy Aldrich Date: Wed, 8 Jun 2016 12:49:37 -0400 Subject: [PATCH] fix(release): make resource-inlining regex non-greedy (#653) Change the template regex to support minified js files. This partially addresses inlining resources for an angular-cli prod build. (cherry picked from commit ba47c8d) --- scripts/release/inline-resources.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release/inline-resources.js b/scripts/release/inline-resources.js index 133ec2e6627a..697612ffb47a 100644 --- a/scripts/release/inline-resources.js +++ b/scripts/release/inline-resources.js @@ -62,7 +62,7 @@ for (let arg of process.argv.slice(2)) { * @return {string} The content with all templates inlined. */ function inlineTemplate(filePath, content) { - return content.replace(/templateUrl:\s*'([^']+\.html)'/g, function(m, templateUrl) { + return content.replace(/templateUrl:\s*'([^']+?\.html)'/g, function(m, templateUrl) { const templateFile = path.join(path.dirname(filePath), templateUrl); const templateContent = fs.readFileSync(templateFile, 'utf-8'); const shortenedTemplate = templateContent