vite-plugin-ssr-config 1.0.4 → 1.0.5
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 +27 -1
- package/package.json +1 -1
- package/ssr/rootRoutes.jsx +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ export default defineConfig({
|
|
|
44
44
|
plugins: [
|
|
45
45
|
react(),
|
|
46
46
|
web({
|
|
47
|
-
|
|
47
|
+
moduleId: 'ssr-pages'
|
|
48
48
|
}),
|
|
49
49
|
ssr({
|
|
50
50
|
chacheDir: '.ssr'
|
|
@@ -53,6 +53,32 @@ export default defineConfig({
|
|
|
53
53
|
});
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
### Legacy project
|
|
57
|
+
|
|
58
|
+
If you use the vite-plugin-pages, you need config the moduleId
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { defineConfig } from "vite";
|
|
62
|
+
import react from "@vitejs/plugin-react";
|
|
63
|
+
import pages from "vite-plugin-pages";
|
|
64
|
+
import ssr from "vite-plugin-ssr-config";
|
|
65
|
+
|
|
66
|
+
export default defineConfig({
|
|
67
|
+
plugins: [
|
|
68
|
+
react(),
|
|
69
|
+
pages({
|
|
70
|
+
moduleId: "ssr-pages",
|
|
71
|
+
routeStyle: "remix",
|
|
72
|
+
dirs: "src/pages",
|
|
73
|
+
}),
|
|
74
|
+
ssr({
|
|
75
|
+
chacheDir: '.ssr'
|
|
76
|
+
})
|
|
77
|
+
],
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
|
|
56
82
|
## Default Configuration
|
|
57
83
|
|
|
58
84
|
The following default values are provided for each configurable attribute in the plugin:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-ssr-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A powerful Vite plugin designed to enable Server-Side Rendering (SSR) for React applications. It provides a comprehensive solution for bundling both SSR and CSR, with built-in support for React Router and React Query for efficient API handling and page rendering.",
|
|
6
6
|
"keywords": [
|
package/ssr/rootRoutes.jsx
CHANGED