examples/programmatic/scripts/build.js
async function build(file) {
  const { code, map, assets } = await ncc(file, options);

  if (Object.keys(assets).length)
    console.error("New unexpected assets are being emitted for", file);

  const name = basename(file, ".js");
  await mkdirp(resolve(DIST_DIR, name));
  write(resolve(DIST_DIR, name, "index.js"), code);
  write(resolve(DIST_DIR, name, "index.map.js"), map);
}
async function build(file) {
  const { code, map, assets } = await ncc(file, options);

  if (Object.keys(assets).length)
    console.error("New unexpected assets are being emitted for", file);

  const name = basename(file, ".js");
  await mkdirp(resolve(DIST_DIR, name));
  write(resolve(DIST_DIR, name, "index.js"), code);
  write(resolve(DIST_DIR, name, "index.map.js"), map);
}
async function build ( file ) { const { code , map , assets } = await ncc ( file , options ) ; if ( Object . keys ( assets ) . length ) console . error ( "New unexpected assets are being emitted for" , file ) ; const name = basename ( file , ".js" ) ; await mkdirp ( resolve ( DIST_DIR , name ) ) ; write ( resolve ( DIST_DIR , name , "index.js" ) , code ) ; write ( resolve ( DIST_DIR , name , "index.map.js" ) , map ) ; }
build file with its dependencies using ncc
build file with its dependencies using ncc