search
LoginSignup
1

More than 1 year has passed since last update.

posted at

updated at

【Nuxt.js】faviconを設定する(nuxt.config.jsでmetaタグ情報を設定)

  • メモ
    • metaタグの情報は、nuxt.config.jsで設定する
    • favicon画像はstaticフォルダへ配置する
    • href: "/favicon.ico"とした場合、static/favicon.icoのファイルが呼び出される
nuxt.config.js
export default {

  省略

  head: {
    title: process.env.npm_package_name || "",
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      {
        hid: "description",
        name: "description",
        content: process.env.npm_package_description || ""
      }
    ],
    link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
  },

  省略

}

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
1