Skip to content

Instantly share code, notes, and snippets.

@plskz
Last active February 24, 2024 12:50
Show Gist options
  • Save plskz/60e30b2fb09c0a7f1093f4f8e8f3cfdc to your computer and use it in GitHub Desktop.
Save plskz/60e30b2fb09c0a7f1093f4f8e8f3cfdc to your computer and use it in GitHub Desktop.
different favicons in development and production (next.js app router)

root layout.tsx

export const metadata: Metadata = {
  // ...
  icons: [{
    rel: 'icon',
    url: process.env.NODE_ENV === 'production' ? '/favicon.ico' : '/favicon-dev.ico',
  }]
}

// ...

note: put favicon.ico and favicon-dev.ico in /public

@plskz
Copy link
Author

plskz commented Feb 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment