How to use the pkg-fetch/lib-es5/upload.js.dontBuild function in pkg-fetch

To help you get started, we’ve selected a few pkg-fetch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeit / pkg / test / test-42-fetch-all / main.js View on Github external
for (const platform of knownPlatforms) {
  const nodeRanges = [ 'node8', 'node10', 'node12' ];
  if (platform === 'linux' || platform === 'alpine') nodeRanges.unshift('node6');
  if (platform === 'linux') nodeRanges.unshift('node4');
  for (const nodeRange of nodeRanges) {
    const nodeVersion = nodeRangeToNodeVersion(nodeRange);
    const archs = [ 'x64' ];
    if (platform === 'win') archs.unshift('x86');
    if (platform === 'linux') archs.push('armv7');
    // linux-armv7 is needed in multi-arch tests,
    // so keeping it here as obligatory. but let's
    // leave compiling for freebsd to end users
    if (platform === 'freebsd') continue;
    for (const arch of archs) {
      if (dontBuild(nodeVersion, platform, arch)) continue;
      items.push({ nodeRange, platform, arch });
    }
  }
}

let p = Promise.resolve();
items.forEach((item) => {
  p = p.then(() => fetch.need(item));
});

p.catch((error) => {
  if (!error.wasReported) console.log(`> ${error}`);
  process.exit(2);
});

pkg-fetch

Compiles and stores base binaries for pkg

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis