tanstack-start-sitemap 0.0.1 → 0.0.2
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 +54 -12
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,17 +1,59 @@
|
|
1
|
-
#
|
1
|
+
# Tanstack start Sitemap Plugin
|
2
2
|
|
3
|
-
A
|
3
|
+
A Tanstack start plugin that generates a `sitemap.xml` file during the build process by reading a route tree file and extracting the routes. This plugin makes it easy to maintain your website’s sitemap based on your application's routing configuration.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Features
|
6
6
|
|
7
|
-
- **
|
8
|
-
- **
|
9
|
-
- **ShadCN**: Accessible and customizable component primitives.
|
10
|
-
- **Playwright**: End-to-end testing for reliable and maintainable tests.
|
11
|
-
- **Dark Mode Toggle**: Easily switch between light and dark themes for testing.
|
12
|
-
- **ESM & CJS Support**: Generates both ES Modules and CommonJS for maximum compatibility.
|
13
|
-
- **Typescript Support**: Generates properly .d.ts.
|
14
|
-
- **Structured Folder Layout**: Organized directory structure for scalability and maintainability.
|
15
|
-
- **Example Folder**: Contains example usage of components with a simple setup.
|
7
|
+
- **Automatic Sitemap Generation:** Automatically creates a `sitemap.xml` during the build process.
|
8
|
+
- **Customizable Options:** Configure per-route settings such as `changefreq`, `priority`, and `lastmod`.
|
16
9
|
|
10
|
+
## Installation
|
17
11
|
|
12
|
+
### Using pnpm
|
13
|
+
|
14
|
+
```bash
|
15
|
+
pnpm add -D tanstack-start-sitemap
|
16
|
+
```
|
17
|
+
|
18
|
+
## Usage
|
19
|
+
|
20
|
+
Add the plugin to your tanstack start configuration `app.config.ts`:
|
21
|
+
|
22
|
+
```ts
|
23
|
+
// app.config.ts
|
24
|
+
import { defineConfig } from 'vite';
|
25
|
+
import { sitemapPlugin } from './plugins/vite-sitemap-plugin';
|
26
|
+
|
27
|
+
export default defineConfig({
|
28
|
+
vite: {
|
29
|
+
plugins: [
|
30
|
+
tsConfigPaths({
|
31
|
+
projects: ["./tsconfig.json"],
|
32
|
+
}),
|
33
|
+
sitemapPlugin({
|
34
|
+
hostname: 'https://example.com'
|
35
|
+
}),
|
36
|
+
],
|
37
|
+
},
|
38
|
+
|
39
|
+
});
|
40
|
+
```
|
41
|
+
|
42
|
+
## Plugin Options
|
43
|
+
|
44
|
+
| Option | Type | Default | Description |
|
45
|
+
| -------------------- | --------------------------------------------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------- |
|
46
|
+
| `hostname` | `string` | **Required** | The base URL of your site (e.g., `https://example.com`). |
|
47
|
+
| `routeTreePath` | `string` | `'app/routeTree.gen.ts'` | The path to your route tree file. The plugin will search several possible paths to locate it. |
|
48
|
+
| `routes` | `{ [key: string]: { changefreq?: string; priority?: number; lastmod?: string } }` | `{}` | Per-route configuration that allows overriding default settings for specific routes. |
|
49
|
+
| `defaultChangefreq` | `'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never'` | `'weekly'` | The default change frequency applied to routes that don't have an override. |
|
50
|
+
| `defaultPriority` | `number` | `0.5` | The default priority applied to routes that don't have an override. |
|
51
|
+
|
52
|
+
## Troubleshooting
|
53
|
+
|
54
|
+
- **Route Tree File Not Found:**
|
55
|
+
Ensure that the path provided in `routeTreePath` is correct or that your file exists in one of the expected locations.
|
56
|
+
|
57
|
+
## License
|
58
|
+
|
59
|
+
This project is licensed under the [MIT License](LICENSE).
|