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)
This commit is contained in:
Randy Aldrich
2016-06-08 12:49:37 -04:00
committed by Jeremy Elbourn
parent 4bee1783b2
commit e808452ed6
+1 -1
View File
@@ -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