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 CHANGED
@@ -44,7 +44,7 @@ export default defineConfig({
44
44
  plugins: [
45
45
  react(),
46
46
  web({
47
- moduleFile: '.ssr/routes.tsx'
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.4",
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": [
@@ -1,7 +1,7 @@
1
1
  import { RootDocument } from "@ssr/root.jsx";
2
2
  import React from "react";
3
3
  import { useRoutes } from "react-router";
4
- import routes from "./routes";
4
+ import routes from "ssr-pages";
5
5
 
6
6
  export const RootRoutes = (props) => {
7
7
  const newRoutes = [