@hono/vite-ssg 0.1.2 → 0.2.0

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
@@ -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
@@ -1,4 +1,5 @@
1
1
  import { ssgBuild } from './ssg.js';
2
+ import 'hono/ssg';
2
3
  import 'vite';
3
4
 
4
5
 
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";
@@ -65,7 +66,7 @@ const ssgBuild = (options) => {
65
66
  return;
66
67
  }
67
68
  },
68
- { dir: outDir }
69
+ { dir: outDir, plugins: options?.plugins ?? defaultOptions.plugins }
69
70
  );
70
71
  server.close();
71
72
  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.2",
4
+ "version": "0.2.0",
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.2.7",
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.0.0"
52
+ "hono": ">=4.8.0"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=18.14.1"