Skip to content

Favicons larger than 48x48 wanted #459

@evil-shrike

Description

@evil-shrike

Hi,
why can't I generate favicons larger than 48x48

I tried:

    favicons: [
      'favicon-16x16.png',
      'favicon-32x32.png',
      'favicon-96x96.png',
      'favicon-128x128.png',
      'favicon.ico',
    ],

but only there were created:
created favicon-16x16.png
created favicon-32x32.png
created favicon.ico

const configuration = {
  logging: false,
  icons: {
    favicons: [
      'favicon-16x16.png',
      'favicon-32x32.png',
      'favicon-96x96.png',
      'favicon-128x128.png',
      'favicon.ico',
    ],
    android: false,
    appleIcon: true,
    appleStartup: false,
    windows: false,
    yandex: false,
  },
};
async function run() {
  const iconsPath = path.join(OUTPUT, 'icons');
  if (!fs.existsSync(iconsPath)) {
    fs.mkdirSync(iconsPath, { recursive: true });
  }

  const response = await favicons(SOURCE, configuration);

  await Promise.all(
    response.images.map(async (image) => {
      let outputPath;
      if (image.name === 'favicon.ico') {
        outputPath = path.join(OUTPUT, image.name);
      } else {
        outputPath = path.join(OUTPUT, 'icons', image.name);
      }
      await fs.promises.writeFile(outputPath, image.contents);
      console.log('created ' + image.name);
    }),
  );
  console.log('Favicon generation completed!');
}
run().catch(console.error);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions