@hono/vite-ssg 0.1.2 → 0.2.1
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 +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/ssg.d.ts +7 -0
- package/dist/ssg.js +4 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -60,6 +60,12 @@ The options are below.
|
|
|
60
60
|
```ts
|
|
61
61
|
type SSGOptions = {
|
|
62
62
|
entry?: string
|
|
63
|
+
/**
|
|
64
|
+
* Hono SSG plugins to use.
|
|
65
|
+
* These are not Vite plugins, but plugins for Hono's static site generation.
|
|
66
|
+
* @see https://hono.dev/docs/helpers/ssg#plugins
|
|
67
|
+
*/
|
|
68
|
+
plugins?: SSGPlugin[]
|
|
63
69
|
}
|
|
64
70
|
```
|
|
65
71
|
|
|
@@ -68,6 +74,7 @@ Default values:
|
|
|
68
74
|
```ts
|
|
69
75
|
const defaultOptions = {
|
|
70
76
|
entry: './src/index.tsx',
|
|
77
|
+
plugins: [],
|
|
71
78
|
}
|
|
72
79
|
```
|
|
73
80
|
|
package/dist/index.d.ts
CHANGED
package/dist/ssg.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import { SSGPlugin } from 'hono/ssg';
|
|
1
2
|
import { Plugin } from 'vite';
|
|
2
3
|
|
|
3
4
|
type SSGOptions = {
|
|
4
5
|
entry?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Hono SSG plugins to use.
|
|
8
|
+
* These are not Vite plugins, but plugins for Hono's static site generation.
|
|
9
|
+
* @see https://hono.dev/docs/helpers/ssg#plugins
|
|
10
|
+
*/
|
|
11
|
+
plugins?: SSGPlugin[];
|
|
5
12
|
};
|
|
6
13
|
declare const defaultOptions: Required<SSGOptions>;
|
|
7
14
|
declare const ssgBuild: (options?: SSGOptions) => Plugin;
|
package/dist/ssg.js
CHANGED
|
@@ -2,7 +2,8 @@ import { toSSG } from "hono/ssg";
|
|
|
2
2
|
import { createServer } from "vite";
|
|
3
3
|
import { relative } from "node:path";
|
|
4
4
|
const defaultOptions = {
|
|
5
|
-
entry: "./src/index.tsx"
|
|
5
|
+
entry: "./src/index.tsx",
|
|
6
|
+
plugins: []
|
|
6
7
|
};
|
|
7
8
|
const ssgBuild = (options) => {
|
|
8
9
|
const virtualId = "virtual:ssg-void-entry";
|
|
@@ -12,6 +13,7 @@ const ssgBuild = (options) => {
|
|
|
12
13
|
return {
|
|
13
14
|
name: "@hono/vite-ssg",
|
|
14
15
|
apply: "build",
|
|
16
|
+
enforce: "post",
|
|
15
17
|
async config() {
|
|
16
18
|
return {
|
|
17
19
|
build: {
|
|
@@ -65,7 +67,7 @@ const ssgBuild = (options) => {
|
|
|
65
67
|
return;
|
|
66
68
|
}
|
|
67
69
|
},
|
|
68
|
-
{ dir: outDir }
|
|
70
|
+
{ dir: outDir, plugins: options?.plugins ?? defaultOptions.plugins }
|
|
69
71
|
);
|
|
70
72
|
server.close();
|
|
71
73
|
if (!result.success) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hono/vite-ssg",
|
|
3
3
|
"description": "Vite plugin to generate a static site from your Hono application",
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"homepage": "https://github.com/honojs/vite-plugins",
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"glob": "^10.3.10",
|
|
44
|
-
"hono": "^4.
|
|
44
|
+
"hono": "^4.9.0",
|
|
45
45
|
"publint": "^0.1.12",
|
|
46
46
|
"rimraf": "^5.0.1",
|
|
47
47
|
"tsup": "^7.2.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"vitest": "^1.2.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"hono": ">=4.
|
|
52
|
+
"hono": ">=4.8.0"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=18.14.1"
|