vite-react-ssg 0.7.1 → 0.7.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 +10 -7
- package/bin/vite-react-ssg.js +0 -0
- package/dist/node.cjs +1 -1
- package/dist/node.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,11 +4,12 @@ Static-site generation for React on Vite.
|
|
|
4
4
|
|
|
5
5
|
See demo(also document): [docs](https://vite-react-ssg.netlify.app/)
|
|
6
6
|
|
|
7
|
-
**🎈 Support for [`@tanstack/router`](https://tanstack.com/router/latest/docs/framework/react/overview)
|
|
7
|
+
**🎈 Support for [`@tanstack/router`](https://tanstack.com/router/latest/docs/framework/react/overview)
|
|
8
|
+
and [`wouter`](https://github.com/molefrog/wouter) is in progress!**
|
|
8
9
|
|
|
9
10
|
[](https://www.npmjs.com/package/vite-react-ssg)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
## Table of contents
|
|
12
13
|
|
|
13
14
|
- [Usage](#usage)
|
|
14
15
|
- [Use CSR during development](#use-csr-during-development)
|
|
@@ -25,7 +26,6 @@ See demo(also document): [docs](https://vite-react-ssg.netlify.app/)
|
|
|
25
26
|
- [Critical CSS](#critical-css)
|
|
26
27
|
- [Configuration](#configuration)
|
|
27
28
|
- [Custom Routes to Render](#custom-routes-to-render)
|
|
28
|
-
- [Https](#https)
|
|
29
29
|
- [Roadmap](#roadmap)
|
|
30
30
|
- [Credits](#credits)
|
|
31
31
|
|
|
@@ -103,7 +103,8 @@ export const routes: RouteRecord[] = [
|
|
|
103
103
|
|
|
104
104
|
### Use CSR during development
|
|
105
105
|
|
|
106
|
-
Vite React SSG provide SSR (Server-Side Rendering) during development to ensure consistency
|
|
106
|
+
Vite React SSG provide SSR (Server-Side Rendering) during development to ensure consistency
|
|
107
|
+
between development and production as much as possible.
|
|
107
108
|
|
|
108
109
|
But if you want to use CSR during development, just:
|
|
109
110
|
|
|
@@ -120,7 +121,8 @@ But if you want to use CSR during development, just:
|
|
|
120
121
|
|
|
121
122
|
### Single Page SSG
|
|
122
123
|
|
|
123
|
-
For SSG of an index page only (i.e. without `react-router-dom`);
|
|
124
|
+
For SSG of an index page only (i.e. without `react-router-dom`);
|
|
125
|
+
import `vite-react-ssg/single-page` instead.
|
|
124
126
|
|
|
125
127
|
```tsx
|
|
126
128
|
// src/main.tsx
|
|
@@ -180,7 +182,7 @@ export function getStaticPaths() {
|
|
|
180
182
|
const routes = [
|
|
181
183
|
{
|
|
182
184
|
path: '/:page',
|
|
183
|
-
lazy: () => import('./pages/[page]')
|
|
185
|
+
lazy: () => import('./pages/[page]'),
|
|
184
186
|
}
|
|
185
187
|
]
|
|
186
188
|
```
|
|
@@ -393,7 +395,8 @@ npm i -D critters
|
|
|
393
395
|
|
|
394
396
|
Critical CSS generation will automatically be enabled for you.
|
|
395
397
|
|
|
396
|
-
To configure `critters`, pass [its options](https://github.com/GoogleChromeLabs/critters#usage)
|
|
398
|
+
To configure `critters`, pass [its options](https://github.com/GoogleChromeLabs/critters#usage)
|
|
399
|
+
into `ssgOptions.crittersOptions` in `vite.config.ts`:
|
|
397
400
|
|
|
398
401
|
```ts
|
|
399
402
|
// vite.config.ts
|
package/bin/vite-react-ssg.js
CHANGED
|
File without changes
|
package/dist/node.cjs
CHANGED
|
@@ -1416,7 +1416,7 @@ async function formatHtml(html, formatting) {
|
|
|
1416
1416
|
function invariant(value, message) {
|
|
1417
1417
|
if (value === false || value === null || typeof value === "undefined") {
|
|
1418
1418
|
console.error(
|
|
1419
|
-
"The following error is a bug in
|
|
1419
|
+
"The following error is a bug in Vite-react-ssg; please open an issue! https://github.com/Daydreamer-riri/vite-react-ssg/issues/new"
|
|
1420
1420
|
);
|
|
1421
1421
|
throw new Error(message);
|
|
1422
1422
|
}
|
package/dist/node.mjs
CHANGED
|
@@ -1409,7 +1409,7 @@ async function formatHtml(html, formatting) {
|
|
|
1409
1409
|
function invariant(value, message) {
|
|
1410
1410
|
if (value === false || value === null || typeof value === "undefined") {
|
|
1411
1411
|
console.error(
|
|
1412
|
-
"The following error is a bug in
|
|
1412
|
+
"The following error is a bug in Vite-react-ssg; please open an issue! https://github.com/Daydreamer-riri/vite-react-ssg/issues/new"
|
|
1413
1413
|
);
|
|
1414
1414
|
throw new Error(message);
|
|
1415
1415
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-react-ssg",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.2",
|
|
5
5
|
"packageManager": "pnpm@9.4.0",
|
|
6
|
-
"description": "",
|
|
6
|
+
"description": "Static-site generation for React on Vite.",
|
|
7
7
|
"author": "Riri <Daydreamerriri@outlook.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"homepage": "https://github.com/Daydreamer-riri/vite-react-ssg#readme",
|