添加 @unhead/vue 和 vite-plugin-sitemap 依赖,更新路由元信息以包含描述标签,配置 sitemap 插件,添加 robots.txt 文件

This commit is contained in:
2025-03-15 22:17:09 +08:00
parent b496fc142f
commit 2494169c61
7 changed files with 123 additions and 14 deletions

View File

@ -1,12 +1,23 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
import sitemap from "vite-plugin-sitemap";
export default defineConfig({
plugins: [vue()],
plugins: [
vue(),
sitemap({
hostname: "https://www.kisechan.space",
routes: [
{ path: "/", name: "主页" },
{ path: "/links", name: "友链" },
{ path: "/tools", name: "工具" },
],
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
}
})
"@": path.resolve(__dirname, "./src"),
},
},
});