vite-plugin-sitemap 0.5.1 → 0.6.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.
- package/README.md +25 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +157 -124
- package/dist/index.mjs +134 -98
- package/package.json +17 -13
package/README.md
CHANGED
|
@@ -38,11 +38,11 @@ export default {
|
|
|
38
38
|
Now, run `npm build` and this will generate sitemap.xml and robots.txt files on your dist folder.
|
|
39
39
|
|
|
40
40
|
### To generate all pages of your app, you can:
|
|
41
|
+
|
|
41
42
|
- Use dynamicRoutes to send routes paths.
|
|
42
43
|
- Read [`MPA docs`](https://vitejs.dev/guide/build.html#multi-page-app) from Vite documentation.
|
|
43
44
|
- Use MPA with [`vite-plugin-mpa`](https://github.com/IndexXuan/vite-plugin-mpa).
|
|
44
45
|
|
|
45
|
-
|
|
46
46
|
## Configuration options
|
|
47
47
|
|
|
48
48
|
### hostname
|
|
@@ -58,6 +58,7 @@ Base URI.
|
|
|
58
58
|
- **Default:** `[]`
|
|
59
59
|
|
|
60
60
|
Array of strings with manual dynamic routes.
|
|
61
|
+
|
|
61
62
|
```js
|
|
62
63
|
const names = [
|
|
63
64
|
'John',
|
|
@@ -83,6 +84,7 @@ You can find a working example in example folder.
|
|
|
83
84
|
- **Default:** `[]`
|
|
84
85
|
|
|
85
86
|
Array of strings with excluded routes.
|
|
87
|
+
|
|
86
88
|
```js
|
|
87
89
|
export default {
|
|
88
90
|
plugins: [
|
|
@@ -94,6 +96,19 @@ export default {
|
|
|
94
96
|
|
|
95
97
|
You can find a working example in example folder.
|
|
96
98
|
|
|
99
|
+
### externalSitemaps
|
|
100
|
+
|
|
101
|
+
- **Type:** `string[]`
|
|
102
|
+
- **Default:** `[]`
|
|
103
|
+
|
|
104
|
+
Array of strings with other sitemaps paths or urls.
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
generateSitemap({
|
|
108
|
+
externalSitemaps: ['sitemap_1', 'sitemap_2', 'subpath/sitemap_3', 'https://site.com/sitemap.xml']
|
|
109
|
+
})
|
|
110
|
+
```
|
|
111
|
+
|
|
97
112
|
### outDir
|
|
98
113
|
|
|
99
114
|
- **Type:** `string`
|
|
@@ -144,6 +159,14 @@ The (optional) route `'*'` is used as default.
|
|
|
144
159
|
|
|
145
160
|
Converts XML into a human readable format
|
|
146
161
|
|
|
162
|
+
### i18n
|
|
163
|
+
|
|
164
|
+
- **Type:** `{ defaultLanguage?: string, languages: string[] }`
|
|
165
|
+
- **Default:** `undefined`
|
|
166
|
+
|
|
167
|
+
Add i18n support defining alternate links.
|
|
168
|
+
defaultLanguage will use this language with / and languages with /language
|
|
169
|
+
|
|
147
170
|
### generateRobotsTxt
|
|
148
171
|
|
|
149
172
|
- **Type:** `boolean`
|
|
@@ -157,6 +180,7 @@ Enables robots.txt file generation
|
|
|
157
180
|
- **Default:** `[{ userAgent: '*', allow: '/' }]`
|
|
158
181
|
|
|
159
182
|
RobotOption:
|
|
183
|
+
|
|
160
184
|
- **userAgent**: `string`
|
|
161
185
|
- **allow**?: `string | string[]`
|
|
162
186
|
- **disallow**?: `string | string[]`
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,24 @@ interface Options {
|
|
|
49
49
|
* @default []
|
|
50
50
|
*/
|
|
51
51
|
exclude: string[];
|
|
52
|
+
/**
|
|
53
|
+
* Array of i18n languages.
|
|
54
|
+
* Example: {
|
|
55
|
+
* defaultLanguage: 'fr'
|
|
56
|
+
* languages: ['fr', 'en', 'es']
|
|
57
|
+
* }
|
|
58
|
+
* @default undefined
|
|
59
|
+
*/
|
|
60
|
+
i18n?: {
|
|
61
|
+
defaultLanguage?: string;
|
|
62
|
+
languages: string[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Other sitemaps paths
|
|
66
|
+
* Example: ['sitemap_1.xml', 'path/sitemap_2.xml', 'https://site.com/sitemap.xml']
|
|
67
|
+
* @default []
|
|
68
|
+
*/
|
|
69
|
+
externalSitemaps: string[];
|
|
52
70
|
/**
|
|
53
71
|
* String with base path.
|
|
54
72
|
* Example: '/mysubpath'
|