Skip to content

Commit

Permalink
processFile(): await on minify
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentpayot committed Sep 2, 2021
1 parent 267579e commit 75e3ff7
Show file tree
Hide file tree
Showing 2 changed files with 4,608 additions and 34 deletions.
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ function mkdir(outputDir, callback) {
}

function processFile(inputFile, outputFile) {
fs.readFile(inputFile, { encoding: 'utf8' }, function(err, data) {
fs.readFile(inputFile, { encoding: 'utf8' }, async function(err, data) {
if (err) {
fatal('Cannot read ' + inputFile + '\n' + err.message);
}
var minified;
try {
minified = minify(data, createOptions());
minified = await minify(data, createOptions());
}
catch (e) {
fatal('Minification error on ' + inputFile + '\n' + e.message);
Expand Down
Loading

0 comments on commit 75e3ff7

Please sign in to comment.