Skip to content

Commit

Permalink
Remove async/await not supported on current appveyor node version
Browse files Browse the repository at this point in the history
  • Loading branch information
skovhus committed May 9, 2017
1 parent 4375315 commit d3ed28b
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

0 comments on commit d3ed28b

Please sign in to comment.