anolilab/unplugin-favicons

No HTML injection with Astro

Closed this issue · 5 comments

Pre-Checks

Describe the bug

I'm trying to use this inside an Astro project. Unfortunately I never succeeded that the HTML got injected. My astro.config.mjs:

import { defineConfig } from 'astro/config';
import unpluginFavicons from '@anolilab/unplugin-favicons/vite';

// https://astro.build/config
export default defineConfig({
  vite: {
    plugins: [
      unpluginFavicons({
        logo: 'res/brand/icon.png',
        inject: true,
      }),
    ],
  },
});

I've also tried to use the default config and put the logo to assets/logo.png. That didn't work as well.

Minimal reproduction code

https://stackblitz.com/edit/github-9xnszu?file=astro.config.mjs

Additional Context

Kooha-2024-08-21-20-12-23.mp4

Additionally I get this warnings:

20:10:40 [WARN] [vite] plugin '@anolilab/unplugin-favicons' uses deprecated 'enforce' option. Use 'order' option instead.
20:10:40 [WARN] [vite] plugin '@anolilab/unplugin-favicons' uses deprecated 'transform' option. Use 'handler' option instead.

Environment Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm

Which module system do you use?

  • CJS
  • ESM

Used Package Manager

pnpm

It looks like this is your first issue. Welcome! 👋 One of the project maintainers will be with you as soon as possible. We appreciate your patience. To safeguard the health of the project, please take a moment to read our code of conduct.

Hey @openscript could you test 1.0.5-alpha.2, this version should fix the issue

Hallo @prisis
Thank you for the quick reaction. You fixed the issue and the warnings as well!
I've updated https://stackblitz.com/edit/github-9xnszu
🥳

Nice, I updated the example too, will make a new release soon

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.