async function buildAsset()

in src/index.js [13:32]


async function buildAsset(compilation, options) {
  const { filter, allow, ignore, override, emitError, outputFilename, outputWriter } = options;

  let licenseInformation = getLicenseInformationForCompilation(compilation, filter);
  licenseInformation = ignoreLicenses(licenseInformation, ignore);
  licenseInformation = overrideLicenses(licenseInformation, override);

  const licenseViolations = getLicenseViolations(licenseInformation, allow);
  if (emitError) {
    compilation.errors.push(...licenseViolations);
  } else {
    compilation.warnings.push(...licenseViolations);
  }

  const sortedLicenseInformation = getSortedLicenseInformation(licenseInformation);
  return [
    outputFilename,
    new RawSource(await writeLicenseInformation(outputWriter, sortedLicenseInformation))
  ];
}