vite-plugin-sitemap 0.4.2 → 0.5.1

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.
package/README.md CHANGED
@@ -111,25 +111,32 @@ Example: ['html', 'md']
111
111
 
112
112
  ### changefreq
113
113
 
114
- - **Type:** `string`
114
+ - **Type:** `string | RoutesOptionMap<string>`
115
115
  - **Default:** `'daily'`
116
116
 
117
117
  Change frequency option for sitemap.
118
118
 
119
119
  ### priority
120
120
 
121
- - **Type:** `number`
121
+ - **Type:** `number | RoutesOptionMap<number>`
122
122
  - **Default:** `1`
123
123
 
124
124
  Priority option for sitemap.
125
125
 
126
126
  ### lastmod
127
127
 
128
- - **Type:** `Date`
128
+ - **Type:** `Date | RoutesOptionMap<Date>`
129
129
  - **Default:** `new Date()`
130
130
 
131
131
  Last modification option for sitemap.
132
132
 
133
+ ### RoutesOptionMap\<Type>
134
+
135
+ - **Type:** `{ [route: string]: Type }`
136
+
137
+ Used for changing `changefreq`, `priority`, or `lastmod` on a by-route level.
138
+ The (optional) route `'*'` is used as default.
139
+
133
140
  ### readable
134
141
 
135
142
  - **Type:** `boolean`
package/dist/index.d.ts CHANGED
@@ -25,6 +25,9 @@ interface RobotOption {
25
25
  */
26
26
  cleanParam?: string;
27
27
  }
28
+ type RoutesOptionMap<T> = T | {
29
+ [key: string]: T;
30
+ };
28
31
  /**
29
32
  * Plugin options.
30
33
  */
@@ -67,17 +70,17 @@ interface Options {
67
70
  * Change frequency option for sitemap
68
71
  * @default 'daily'
69
72
  */
70
- changefreq: string;
73
+ changefreq: string | RoutesOptionMap<string>;
71
74
  /**
72
75
  * Priority option for sitemap
73
76
  * @default 1
74
77
  */
75
- priority: number;
78
+ priority: number | RoutesOptionMap<number>;
76
79
  /**
77
80
  * Last modification option for sitemap
78
81
  * @default new Date()
79
82
  */
80
- lastmod: Date;
83
+ lastmod: Date | RoutesOptionMap<Date>;
81
84
  /**
82
85
  * Converts XML into a human-readable format
83
86
  * @default false