diff options
Diffstat (limited to 'core/scripts/js/jqueryui-check.js')
-rw-r--r-- | core/scripts/js/jqueryui-check.js | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/core/scripts/js/jqueryui-check.js b/core/scripts/js/jqueryui-check.js index b1600ae46ac6..3b7c97cc5518 100644 --- a/core/scripts/js/jqueryui-check.js +++ b/core/scripts/js/jqueryui-check.js @@ -7,17 +7,18 @@ module.exports = filePath => { log(`'${filePath}' is being checked.`); // Transform the file. const file = fs.readFileSync(filePath, 'utf-8'); - const result = Terser.minify(file); - const fileName = filePath.slice(0, -3); - fs.readFile(`${fileName}-min.js`, function read(err, data) { - if (err) { - log(chalk.red(err)); - process.exitCode = 1; - return; - } - if (result.code !== data.toString()) { - log(chalk.red(`'${filePath}' is not updated.`)); - process.exitCode = 1; - } + Terser.minify(file).then((result) => { + const fileName = filePath.slice(0, -3); + fs.readFile(`${fileName}-min.js`, function read(err, data) { + if (err) { + log(chalk.red(err)); + process.exitCode = 1; + return; + } + if (result.code !== data.toString()) { + log(chalk.red(`'${filePath}' is not updated.`)); + process.exitCode = 1; + } + }); }); }; |