Use less memory to build translation files (#6070)

* Change languages build to use less memory

Add graceful-fs so no ned to worry about fs limits

* Specify encoding for fs.readFile

Use eachLimit since graceful-fs handles that now
This commit is contained in:
Peter Jaszkowiak
2017-11-16 15:43:52 -07:00
committed by Barış Soner Uşaklı
parent f5385e38bf
commit c47c47f7e3
17 changed files with 142 additions and 158 deletions

View File

@@ -218,11 +218,11 @@ middleware.templatesOnDemand = function (req, res, next) {
return next();
}
fs.readFile(filePath.replace(/\.js$/, '.tpl'), cb);
fs.readFile(filePath.replace(/\.js$/, '.tpl'), 'utf8', cb);
},
function (source, cb) {
Benchpress.precompile({
source: source.toString(),
source: source,
minify: global.env !== 'development',
}, cb);
},