chore: reintroduce sitemap generation (#2874)
This commit is contained in:
3
packages/hoppscotch-web/.gitignore
vendored
3
packages/hoppscotch-web/.gitignore
vendored
@@ -22,3 +22,6 @@ dist-ssr
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
# Sitemap Generation Artifacts (see vite.config.ts)
|
||||
.sitemap-gen
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
"vite-plugin-pages": "^0.26.0",
|
||||
"vite-plugin-pages-sitemap": "^1.4.0",
|
||||
"vite-plugin-pwa": "^0.13.1",
|
||||
"vite-plugin-static-copy": "^0.12.0",
|
||||
"vite-plugin-vue-layouts": "^0.7.0",
|
||||
"vite-plugin-windicss": "^1.8.8",
|
||||
"vue-tsc": "^1.0.9",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { defineConfig, loadEnv } from "vite"
|
||||
import { defineConfig, loadEnv, normalizePath } from "vite"
|
||||
import { APP_INFO, META_TAGS } from "./meta"
|
||||
// import generateSitemap from "vite-plugin-pages-sitemap"
|
||||
import { viteStaticCopy as StaticCopy } from "vite-plugin-static-copy"
|
||||
import generateSitemap from "vite-plugin-pages-sitemap"
|
||||
import HtmlConfig from "vite-plugin-html-config"
|
||||
import Vue from "@vitejs/plugin-vue"
|
||||
import VueI18n from "@intlify/vite-plugin-vue-i18n"
|
||||
@@ -73,16 +74,25 @@ export default defineConfig({
|
||||
routeStyle: "nuxt",
|
||||
dirs: "../hoppscotch-common/src/pages",
|
||||
importMode: "async",
|
||||
onRoutesGenerated() {
|
||||
// TODO: Figure this out ?
|
||||
// return generateSitemap({
|
||||
// routes,
|
||||
// nuxtStyle: true,
|
||||
// allowRobots: true,
|
||||
// hostname: ENV.VITE_BASE_URL,
|
||||
// })
|
||||
onRoutesGenerated(routes) {
|
||||
// HACK: See: https://github.com/jbaubree/vite-plugin-pages-sitemap/issues/173
|
||||
return ((generateSitemap as any).default as typeof generateSitemap)({
|
||||
routes,
|
||||
nuxtStyle: true,
|
||||
allowRobots: true,
|
||||
dest: ".sitemap-gen",
|
||||
hostname: ENV.VITE_BASE_URL,
|
||||
})
|
||||
},
|
||||
}),
|
||||
StaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: normalizePath(path.resolve(__dirname, "./.sitemap-gen/*")),
|
||||
dest: normalizePath(path.resolve(__dirname, "./dist")),
|
||||
},
|
||||
],
|
||||
}),
|
||||
Layouts({
|
||||
layoutsDirs: "../hoppscotch-common/src/layouts",
|
||||
defaultLayout: "default",
|
||||
|
||||
Reference in New Issue
Block a user