@hono/vite-ssg 0.1.0 → 0.1.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/dist/ssg.js +4 -3
- package/package.json +3 -3
package/dist/ssg.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { relative } from "node:path";
|
|
2
1
|
import { toSSG } from "hono/ssg";
|
|
3
2
|
import { createServer } from "vite";
|
|
3
|
+
import { relative } from "node:path";
|
|
4
4
|
const defaultOptions = {
|
|
5
5
|
entry: "./src/index.tsx"
|
|
6
6
|
};
|
|
@@ -42,10 +42,10 @@ const ssgBuild = (options) => {
|
|
|
42
42
|
}
|
|
43
43
|
const server = await createServer({
|
|
44
44
|
plugins: [],
|
|
45
|
-
build: { ssr: true }
|
|
45
|
+
build: { ssr: true },
|
|
46
|
+
mode: config.mode
|
|
46
47
|
});
|
|
47
48
|
const module = await server.ssrLoadModule(entry);
|
|
48
|
-
server.close();
|
|
49
49
|
const app = module["default"];
|
|
50
50
|
if (!app) {
|
|
51
51
|
throw new Error(`Failed to find a named export "default" from ${entry}`);
|
|
@@ -67,6 +67,7 @@ const ssgBuild = (options) => {
|
|
|
67
67
|
},
|
|
68
68
|
{ dir: outDir }
|
|
69
69
|
);
|
|
70
|
+
server.close();
|
|
70
71
|
if (!result.success) {
|
|
71
72
|
throw result.error;
|
|
72
73
|
}
|
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.1.2",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"homepage": "https://github.com/honojs/vite-plugins",
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"glob": "^10.3.10",
|
|
44
|
-
"hono": "^4.
|
|
44
|
+
"hono": "^4.2.7",
|
|
45
45
|
"publint": "^0.1.12",
|
|
46
46
|
"rimraf": "^5.0.1",
|
|
47
47
|
"tsup": "^7.2.0",
|
|
48
|
-
"vite": "^
|
|
48
|
+
"vite": "^6.1.1",
|
|
49
49
|
"vitest": "^1.2.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|