@hono/vite-ssg 0.2.1 → 0.3.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/CHANGELOG.md +49 -0
- package/dist/ssg.d.ts +1 -0
- package/dist/ssg.js +9 -3
- package/package.json +3 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @hono/vite-ssg
|
|
2
|
+
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#318](https://github.com/honojs/vite-plugins/pull/318) [`9bc8f280de0922aa461e715d3751294425313c80`](https://github.com/honojs/vite-plugins/commit/9bc8f280de0922aa461e715d3751294425313c80) Thanks [@3w36zj6](https://github.com/3w36zj6)! - respect resolve options when creating server
|
|
8
|
+
|
|
9
|
+
## 0.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#304](https://github.com/honojs/vite-plugins/pull/304) [`1a6b277b6ecc58450113b63f6b3bf2e2e4fce35a`](https://github.com/honojs/vite-plugins/commit/1a6b277b6ecc58450113b63f6b3bf2e2e4fce35a) Thanks [@epelz](https://github.com/epelz)! - add ssg build option to specify extensionMap
|
|
14
|
+
|
|
15
|
+
## 0.2.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#299](https://github.com/honojs/vite-plugins/pull/299) [`5ff83b02ab87903af8e3d656df7a37dc4a43384b`](https://github.com/honojs/vite-plugins/commit/5ff83b02ab87903af8e3d656df7a37dc4a43384b) Thanks [@yusukebe](https://github.com/yusukebe)! - fix: set `enforce` as `post`
|
|
20
|
+
|
|
21
|
+
## 0.2.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [#283](https://github.com/honojs/vite-plugins/pull/283) [`4c28821fbf889deba5e10c7fd7f81f50530431c7`](https://github.com/honojs/vite-plugins/commit/4c28821fbf889deba5e10c7fd7f81f50530431c7) Thanks [@3w36zj6](https://github.com/3w36zj6)! - feat: add support for ssg plugins
|
|
26
|
+
|
|
27
|
+
## 0.1.2
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [#239](https://github.com/honojs/vite-plugins/pull/239) [`b27fca203320e55f74184541d35b4720e9b456c8`](https://github.com/honojs/vite-plugins/commit/b27fca203320e55f74184541d35b4720e9b456c8) Thanks [@ssssota](https://github.com/ssssota)! - Load .env.{mode} to bundle environment variable
|
|
32
|
+
|
|
33
|
+
## 0.1.1
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- [#209](https://github.com/honojs/vite-plugins/pull/209) [`9a39a51d34e0e6c34212fed15f49aa9248a8b4bc`](https://github.com/honojs/vite-plugins/commit/9a39a51d34e0e6c34212fed15f49aa9248a8b4bc) Thanks [@berlysia](https://github.com/berlysia)! - Preserve the SSR server instance during page rendering
|
|
38
|
+
|
|
39
|
+
## 0.1.0
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- [#80](https://github.com/honojs/vite-plugins/pull/80) [`b577d9c6bffa3b543a8f0bf94539a61fc139264d`](https://github.com/honojs/vite-plugins/commit/b577d9c6bffa3b543a8f0bf94539a61fc139264d) Thanks [@berlysia](https://github.com/berlysia)! - Simplify the build flow. Just run `toSSG`. Respect Vite's config.
|
|
44
|
+
|
|
45
|
+
## 0.0.1
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- [#59](https://github.com/honojs/vite-plugins/pull/59) [`92f1e721d4a1e1846c3fdfa121d63fafdaf8f4b3`](https://github.com/honojs/vite-plugins/commit/92f1e721d4a1e1846c3fdfa121d63fafdaf8f4b3) Thanks [@yusukebe](https://github.com/yusukebe)! - Initial release
|
package/dist/ssg.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ type SSGOptions = {
|
|
|
9
9
|
* @see https://hono.dev/docs/helpers/ssg#plugins
|
|
10
10
|
*/
|
|
11
11
|
plugins?: SSGPlugin[];
|
|
12
|
+
extensionMap?: Record<string, string>;
|
|
12
13
|
};
|
|
13
14
|
declare const defaultOptions: Required<SSGOptions>;
|
|
14
15
|
declare const ssgBuild: (options?: SSGOptions) => Plugin;
|
package/dist/ssg.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { toSSG } from "hono/ssg";
|
|
1
|
+
import { toSSG, defaultExtensionMap } from "hono/ssg";
|
|
2
2
|
import { createServer } from "vite";
|
|
3
3
|
import { relative } from "node:path";
|
|
4
4
|
const defaultOptions = {
|
|
5
5
|
entry: "./src/index.tsx",
|
|
6
|
-
plugins: []
|
|
6
|
+
plugins: [],
|
|
7
|
+
extensionMap: defaultExtensionMap
|
|
7
8
|
};
|
|
8
9
|
const ssgBuild = (options) => {
|
|
9
10
|
const virtualId = "virtual:ssg-void-entry";
|
|
@@ -43,6 +44,7 @@ const ssgBuild = (options) => {
|
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
const server = await createServer({
|
|
47
|
+
resolve: config.resolve,
|
|
46
48
|
plugins: [],
|
|
47
49
|
build: { ssr: true },
|
|
48
50
|
mode: config.mode
|
|
@@ -67,7 +69,11 @@ const ssgBuild = (options) => {
|
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
71
|
},
|
|
70
|
-
{
|
|
72
|
+
{
|
|
73
|
+
dir: outDir,
|
|
74
|
+
plugins: options?.plugins ?? defaultOptions.plugins,
|
|
75
|
+
extensionMap: options?.extensionMap ?? defaultOptions.extensionMap
|
|
76
|
+
}
|
|
71
77
|
);
|
|
72
78
|
server.close();
|
|
73
79
|
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.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/honojs/vite-plugins",
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"@types/node": "^24.10.0",
|
|
43
44
|
"glob": "^10.3.10",
|
|
44
45
|
"hono": "^4.9.0",
|
|
45
46
|
"publint": "^0.1.12",
|
|
@@ -54,4 +55,4 @@
|
|
|
54
55
|
"engines": {
|
|
55
56
|
"node": ">=18.14.1"
|
|
56
57
|
}
|
|
57
|
-
}
|
|
58
|
+
}
|