vite-plugin-sitemap 0.2.1 → 0.3.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 (4) hide show
  1. package/dist/index.d.ts +100 -3
  2. package/dist/index.js +10228 -8401
  3. package/dist/index.mjs +10254 -8438
  4. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -1,6 +1,103 @@
1
- import { Plugin } from 'vite';
2
- import { UserOptions } from 'sitemap-ts';
1
+ interface RobotOption {
2
+ /**
3
+ * User-agent value.
4
+ * Example: Googlebot
5
+ */
6
+ userAgent: string;
7
+ /**
8
+ * Allowed routes for corresponding User-agent.
9
+ * Example: '/'
10
+ */
11
+ allow?: string | string[];
12
+ /**
13
+ * Disallowed routes for corresponding User-agent.
14
+ * Example: ['/admin', '/confidential']
15
+ */
16
+ disallow?: string | string[];
17
+ /**
18
+ * Crawl-delay option for robot.
19
+ * Example: 2
20
+ */
21
+ crawlDelay?: number;
22
+ /**
23
+ * Clean-param option for robot.
24
+ * Example: 'ref /articles/'
25
+ */
26
+ cleanParam?: string;
27
+ }
28
+ /**
29
+ * Plugin options.
30
+ */
31
+ interface Options {
32
+ /**
33
+ * Base URI
34
+ * @default 'http://localhost/'
35
+ */
36
+ hostname: string;
37
+ /**
38
+ * Array of strings with dynamic routes.
39
+ * Example: ['/routes1', '/route2/sub-route']
40
+ * @default []
41
+ */
42
+ dynamicRoutes: string[];
43
+ /**
44
+ * Array of strings with excluded routes.
45
+ * Example: ['/routes1', '/route2/sub-route']
46
+ * @default []
47
+ */
48
+ exclude: string[];
49
+ /**
50
+ * Output directory
51
+ * @default 'dist'
52
+ */
53
+ outDir: string;
54
+ /**
55
+ * File extensions that need to be generated.
56
+ * Example: ['html', 'md']
57
+ * @default 'html'
58
+ */
59
+ extensions: string | string[];
60
+ /**
61
+ * Change frequency option for sitemap
62
+ * @default 'daily'
63
+ */
64
+ changefreq: string;
65
+ /**
66
+ * Priority option for sitemap
67
+ * @default 1
68
+ */
69
+ priority: number;
70
+ /**
71
+ * Last modification option for sitemap
72
+ * @default new Date()
73
+ */
74
+ lastmod: Date;
75
+ /**
76
+ * Converts XML into a human readable format
77
+ * @default false
78
+ */
79
+ readable: boolean;
80
+ /**
81
+ * Robots policy
82
+ * @default [{ userAgent: '*', allow: '/' }]
83
+ */
84
+ robots: RobotOption[];
85
+ }
86
+ declare type UserOptions = Partial<Options>;
3
87
 
4
- declare function sitemapPlugin(options?: UserOptions): Plugin;
88
+ declare function sitemapPlugin(options?: UserOptions): {
89
+ name: string;
90
+ closeBundle(): void;
91
+ transformIndexHtml(): {
92
+ tag: string;
93
+ injectTo: "head" | "body" | "head-prepend" | "body-prepend" | undefined;
94
+ attrs: {
95
+ rel: string;
96
+ type: string;
97
+ title: string;
98
+ href: string;
99
+ };
100
+ }[];
101
+ };
5
102
 
6
103
  export { sitemapPlugin as default };