vite-plugin-sitemap 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +23 -0
  2. package/package.json +2 -3
package/README.md CHANGED
@@ -78,6 +78,29 @@ export default {
78
78
 
79
79
  You can find a working example in example folder.
80
80
 
81
+ For Vue Router v5+ (or [unplugin-vue-router](https://uvr.esm.is/)) with file-based routing, use the `getRoutesFromTypedRouter` helper re-exported by `sitemap-ts` to auto-discover static routes from the generated `typed-router.d.ts`:
82
+
83
+ ```js
84
+ import { fileURLToPath } from 'node:url'
85
+ import { getRoutesFromTypedRouter } from 'sitemap-ts'
86
+ import Sitemap from 'vite-plugin-sitemap'
87
+
88
+ const typedRouterFile = fileURLToPath(new URL('./typed-router.d.ts', import.meta.url))
89
+
90
+ export default {
91
+ plugins: [
92
+ Sitemap({
93
+ dynamicRoutes: [
94
+ ...getRoutesFromTypedRouter(typedRouterFile),
95
+ ...names.map(name => `/names/${name}`),
96
+ ],
97
+ }),
98
+ ],
99
+ }
100
+ ```
101
+
102
+ Dynamic routes (`/:param`, `*`) are filtered out by default — expand them to concrete values yourself. Pass `{ includeDynamic: true }` to keep them as patterns.
103
+
81
104
  ### exclude
82
105
 
83
106
  - **Type:** `string[]`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-sitemap",
3
3
  "type": "module",
4
- "version": "0.10.0",
4
+ "version": "0.11.0",
5
5
  "packageManager": "pnpm@12.21.0",
6
6
  "description": "Sitemap generator plugin for Vite",
7
7
  "license": "MIT",
@@ -36,11 +36,10 @@
36
36
  "eslint-plugin-format": "^2.0.1",
37
37
  "pkgroll": "^2.29.1",
38
38
  "pnpm": "^12.21.0",
39
- "sitemap-ts": "^2.3.1",
39
+ "sitemap-ts": "^2.4.0",
40
40
  "taze": "^21.3.0",
41
41
  "typescript": "^6.0.3",
42
42
  "vite": "^8.3.8",
43
- "vite-plugin-pages": "^0.33.3",
44
43
  "vue-tsc": "^3.3.14"
45
44
  }
46
45
  }