chore(angular1_router): tighten up the build regex replacement

This commit is contained in:
Peter Bacon Darwin 2016-03-21 11:04:54 +00:00 committed by Pete Bacon Darwin
parent 72e24663ad
commit 980491b08f
1 changed files with 4 additions and 2 deletions

View File

@ -40,8 +40,10 @@ function main(modulesDirectory) {
return prev + transform(fs.readFileSync(dir + file, 'utf8'));
}, '');
var out = moduleTemplate.replace('//{{FACADES}}', facades)
.replace('//{{SHARED_CODE}}', sharedCode);
// we have to use a function callback for replace to prevent it from interpreting `$`
// as a replacement command character
var out = moduleTemplate.replace('//{{FACADES}}', function() { return facades; })
.replace('//{{SHARED_CODE}}', function() { return sharedCode; });
return PRELUDE + transform(directives) + out + POSTLUDE;
}