From d3ed28bad784ac293b6652e0e0bc92d761c687d1 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhus Date: Tue, 9 May 2017 22:43:41 +0200 Subject: [PATCH] Remove async/await not supported on current appveyor node version --- scripts/build.js | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 6e04cead587d..f4ddd635943d 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -76,27 +76,25 @@ function buildNodePackage(p) { process.stdout.write(`[ ${chalk.green('OK')} ]\n`); } -async function buildBrowserPackages(packages) { - for (const p of packages) { - const srcDir = path.resolve(p, SRC_DIR); - const pkgJsonPath = path.resolve(p, 'package.json'); - - const {browser} = require(pkgJsonPath); - if (browser) { - if (browser.indexOf(BUILD_ES5_DIR) !== 0) { - throw new Error( - `browser field for ${pkgJsonPath} should start with "${BUILD_ES5_DIR}"` - ); - } - process.stdout.write(fixedWidth(`${path.basename(p)}\n`)); - await browserBuild( - path.resolve(srcDir, 'index.js'), - path.resolve(p, browser) +function buildBrowserPackage(p) { + const srcDir = path.resolve(p, SRC_DIR); + const pkgJsonPath = path.resolve(p, 'package.json'); + + const {browser} = require(pkgJsonPath); + if (browser) { + if (browser.indexOf(BUILD_ES5_DIR) !== 0) { + throw new Error( + `browser field for ${pkgJsonPath} should start with "${BUILD_ES5_DIR}"` ); - process.stdout.write(`[ ${chalk.green('OK')} ]\n`); } + browserBuild( + path.resolve(srcDir, 'index.js'), + path.resolve(p, browser) + ).then(() => { + process.stdout.write(fixedWidth(`${path.basename(p)}\n`)); + process.stdout.write(`[ ${chalk.green('OK')} ]\n`); + }); } - process.stdout.write('\n'); } function buildFile(file, silent) { @@ -146,5 +144,5 @@ if (files.length) { process.stdout.write('\n'); process.stdout.write(chalk.bold.inverse('Building browser packages\n')); - buildBrowserPackages(packages); + packages.forEach(buildBrowserPackage); }