Skip to content

Commit 1aebd1b

Browse files
authored
Merge pull request #733 from ember-cli/rwjblue-patch-1
Avoid repeated encoding in getTemplateCompiler
2 parents c69c8fb + 6f86813 commit 1aebd1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ function getTemplateCompiler(templateCompilerPath, EmberENV = {}) {
133133
let cacheData = TemplateCompilerCache.get(templateCompilerFullPath);
134134

135135
if (cacheData === undefined) {
136-
let templateCompilerContents = fs.readFileSync(templateCompilerFullPath, { encoding: 'utf-8' });
136+
let templateCompilerContents = fs.readFileSync(templateCompilerFullPath);
137137
let templateCompilerCacheKey = crypto
138138
.createHash('md5')
139139
.update(templateCompilerContents)
140140
.digest('hex');
141141

142142
cacheData = {
143-
script: new vm.Script(templateCompilerContents, {
143+
script: new vm.Script(templateCompilerContents.toString(), {
144144
filename: templateCompilerPath,
145145
}),
146146

0 commit comments

Comments
 (0)