mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
Jeremy Elbourn
parent
4bee1783b2
commit
e808452ed6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user