scripts/build/build.mjs/createBundle
async function createBundle(bundleConfig, options) {
  try {
    for await (const {
      name,
      started,
      skipped,
      relativePath,
      absolutePath,
    } of bundler(bundleConfig, options)) {
      const displayName = name.startsWith("esm/") ? `  ${name}` : name;

      if (started) {
        process.stdout.write(fitTerminal(displayName));
        continue;
      }

      if (skipped) {
        if (!options.files) {
          process.stdout.write(fitTerminal(displayName));
          console.log(status.SKIPPED);
        }

        continue;
      }

      const sizeMessages = [];

      if (options.printSize) {
        const { size } = await fs.stat(absolutePath);
        sizeMessages.push(prettyBytes(size));
      }

      if (options.compareSize) {
        // TODO: Use `import.meta.resolve` when Node.js support
        const stablePrettierDirectory = path.dirname(
          require.resolve("prettier")
        );
        const stableVersionFile = path.join(
          stablePrettierDirectory,
          relativePath
        );
        let stableSize;
        try {
          ({ size: stableSize } = await fs.stat(stableVersionFile));
        } catch {
          // No op
        }

        if (stableSize) {
          const { size } = await fs.stat(absolutePath);
          const sizeDiff = size - stableSize;
          const message = chalk[sizeDiff > 0 ? "yellow" : "green"](
            prettyBytes(sizeDiff)
          );

          sizeMessages.push(`${message}`);
        } else {
          sizeMessages.push(chalk.blue("[NEW FILE]"));
        }
      }

      if (sizeMessages.length > 0) {
        // Clear previous line
        clear();
        process.stdout.write(
          fitTerminal(displayName, `${sizeMessages.join(", ")} `)
        );
      }

      console.log(status.DONE);
    }
  } catch (error) {
    console.log(status.FAIL + "\n");
    console.error(error);
    throw error;
  }
}