function replaceTemplateUrl(lines) {
    const regEx = /(^\s*templateUrl:\s*)['"](.*)['"](,*)$/;
    const lineNumbers = lines.reduce((result, line, i) => (/templateUrl/.test(line) ? result.concat(i) : result), []);

    if (!lineNumbers.length) {
        return lines;
    }

    const templateRequires = lineNumbers.map((lineNumber, i) => {
        const [, , templateUrl] = regEx.exec(lines[lineNumber]);
        const lineReplacement = lines[lineNumber].replace(regEx, `$1template${i + 1}$3`);

        return {
            templateUrl,
            lineNumber,
            lineReplacement
        };
    });

    const updatedLines = lines;

    templateRequires.forEach((x) => {
        updatedLines[x.lineNumber] = x.lineReplacement;
    });

    return [
        ...templateRequires.map((x, i) => `const template${i + 1} = require('${x.templateUrl}');`),
        ``,
        ...updatedLines
    ];
}

module.exports = {
    replaceTemplateUrl
};

@@ -21,16 +21,30 @@
 lateUrl(
+variableName, 
 lines) %7B
@@ -483,24 +483,31 @@
 gEx, %60$1
-template
+$%7BvariableName%7D
 $%7Bi + 1%7D
@@ -825,24 +825,31 @@
  %60const 
-template
+$%7BvariableName%7D
 $%7Bi + 1%7D

add the variable name to the function