docs: function build(previousFileSizes) {
    console.log('Creating an optimized production build...');
    webpack(config).run((err, stats) => {
      if (err) {
        printErrors('Failed to compile.', [err]);
        process.exit(1);
      }
  
      if (stats.compilation.errors.length) {
        printErrors('Failed to compile.', stats.compilation.errors);
        process.exit(1);
      }
  
      if (process.env.CI && stats.compilation.warnings.length) {
        printErrors(
          'Failed to compile. When process.env.CI = true, warnings are treated as failures. Most CI servers set this automatically.',
          stats.compilation.warnings,
        );
        process.exit(1);
      }
  
      console.log(chalk.green('Compiled successfully.'));
      console.log();
  
      console.log('File sizes after gzip:');
      console.log();
      printFileSizesAfterBuild(stats, previousFileSizes);
      console.log();
  
      const appPackage = require(paths.appPackageJson);
      const publicUrl = paths.publicUrl;
      const publicPath = config.output.publicPath;
      const publicPathname = url.parse(publicPath).pathname;
      if (publicUrl && publicUrl.indexOf('.github.io/') !== -1) {
        // "homepage": "http://user.github.io/project"
        console.log(`The docs were built assuming they are hosted at ${chalk.green(publicUrl)}.`);
      } else if (publicPath !== '/') {
        // "homepage": "http://mywebsite.com/project"
        console.log(`The project was built assuming it is hosted at ${chalk.green(publicPath)}.`);
        console.log(
          `You can control this with the ${chalk.green('homepage')} field in your ${chalk.cyan(
            'package.json',
          )}.`,
        );
        console.log();
        console.log(`The ${chalk.cyan('build')} folder is ready to be deployed.`);
        console.log();
      } else {
        if (publicUrl) {
          // "homepage": "http://mywebsite.com"
          console.log(`The project was built assuming it is hosted at ${chalk.green(publicUrl)}.`);
          console.log(
            `You can control this with the ${chalk.green('homepage')} field in your ${chalk.cyan(
              'package.json',
            )}.`,
          );
          console.log();
        } else {
          // no homepage
          console.log('The project was built assuming it is hosted at the server root.');
          console.log(
            `To override this, specify the ${chalk.green('homepage')} in your ${chalk.cyan(
              'package.json',
            )}.`,
          );
          console.log('For example, add this to build it for GitHub Pages:');
          console.log();
          console.log(
            `  ${chalk.green('"homepage"')}${chalk.cyan(': ')}${chalk.green(
              '"http://myname.github.io/myapp"',
            )}${chalk.cyan(',')}`,
          );
          console.log();
        }
        const build = path.relative(process.cwd(), paths.appBuild);
        console.log(`The ${chalk.cyan(build)} folder is ready to be deployed.`);
        console.log('You may serve it with a static server:');
        console.log();
        if (useYarn) {
          console.log(`  ${chalk.cyan('yarn')} global add serve`);
        } else {
          console.log(`  ${chalk.cyan('npm')} install -g serve`);
        }
        console.log(`  ${chalk.cyan('serve')} -s build`);
        console.log();
      }
    });
  }