@voltx/server 0.4.1 → 0.4.3
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/index.cjs +5 -4
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -364,9 +364,8 @@ function registerSSR(app, vite, options = {}) {
|
|
|
364
364
|
try {
|
|
365
365
|
const { createServer: createViteServer } = await import("vite");
|
|
366
366
|
const devServer = await createViteServer({
|
|
367
|
-
server: { middlewareMode: true },
|
|
368
|
-
appType: "custom"
|
|
369
|
-
optimizeDeps: { disabled: true }
|
|
367
|
+
server: { middlewareMode: true, hmr: false },
|
|
368
|
+
appType: "custom"
|
|
370
369
|
});
|
|
371
370
|
const mod = await devServer.ssrLoadModule(entryServer);
|
|
372
371
|
render = mod.render;
|
|
@@ -385,6 +384,8 @@ function registerSSR(app, vite, options = {}) {
|
|
|
385
384
|
const isProd = process.env.NODE_ENV === "production";
|
|
386
385
|
if (!isProd) {
|
|
387
386
|
clientScript = `/${entryClient}`;
|
|
387
|
+
const cssPaths = options.css ? Array.isArray(options.css) ? options.css : [options.css] : ["src/globals.css"];
|
|
388
|
+
cssLinks = cssPaths.map((p) => ` <link rel="stylesheet" href="/${p}" />`).join("\n");
|
|
388
389
|
} else {
|
|
389
390
|
if (!manifest) {
|
|
390
391
|
const manifestPath = (0, import_node_path3.resolve)(process.cwd(), "dist/client/.vite/manifest.json");
|
|
@@ -448,7 +449,7 @@ ${cssLinks}
|
|
|
448
449
|
}
|
|
449
450
|
|
|
450
451
|
// src/index.ts
|
|
451
|
-
var VERSION = "0.4.
|
|
452
|
+
var VERSION = "0.4.3";
|
|
452
453
|
// Annotate the CommonJS export names for ESM import in node:
|
|
453
454
|
0 && (module.exports = {
|
|
454
455
|
Hono,
|
package/dist/index.d.cts
CHANGED
|
@@ -196,6 +196,17 @@ interface SSROptions {
|
|
|
196
196
|
* entry-server module themselves (e.g. in Vite-processed server.ts).
|
|
197
197
|
*/
|
|
198
198
|
render?: (url: string) => Promise<ReadableStream>;
|
|
199
|
+
/**
|
|
200
|
+
* CSS file path(s) to inject in dev mode `<head>`.
|
|
201
|
+
* In dev, Vite serves source CSS and transforms it on the fly, but the
|
|
202
|
+
* SSR HTML shell has no `<link>` tag — CSS only loads after client JS
|
|
203
|
+
* hydrates, causing a flash of unstyled content (FOUC).
|
|
204
|
+
*
|
|
205
|
+
* Pass a string (e.g. `"src/globals.css"`) or an array of paths.
|
|
206
|
+
* Each path is emitted as `<link rel="stylesheet" href="/path">`.
|
|
207
|
+
* Defaults to `["src/globals.css"]`.
|
|
208
|
+
*/
|
|
209
|
+
css?: string | string[];
|
|
199
210
|
}
|
|
200
211
|
/** Vite dev server shape — minimal interface to avoid hard dep on vite */
|
|
201
212
|
interface ViteDevServer {
|
|
@@ -212,6 +223,6 @@ interface ViteDevServer {
|
|
|
212
223
|
*/
|
|
213
224
|
declare function registerSSR(app: Hono, vite: ViteDevServer | null, options?: SSROptions): void;
|
|
214
225
|
|
|
215
|
-
declare const VERSION = "0.4.
|
|
226
|
+
declare const VERSION = "0.4.3";
|
|
216
227
|
|
|
217
228
|
export { type CorsConfig, type HttpMethod, type MiddlewareHandler, type RouteEntry, type RouteHandler, type RouteModule, type SSROptions, type ServerConfig, type ServerInfo, VERSION, type ViteDevOptions, type VoltxServer, createCorsMiddleware, createErrorHandler, createLoggerMiddleware, createServer, createViteDevConfig, filePathToUrlPath, registerSSR, registerStaticFiles, scanAndRegisterRoutes };
|
package/dist/index.d.ts
CHANGED
|
@@ -196,6 +196,17 @@ interface SSROptions {
|
|
|
196
196
|
* entry-server module themselves (e.g. in Vite-processed server.ts).
|
|
197
197
|
*/
|
|
198
198
|
render?: (url: string) => Promise<ReadableStream>;
|
|
199
|
+
/**
|
|
200
|
+
* CSS file path(s) to inject in dev mode `<head>`.
|
|
201
|
+
* In dev, Vite serves source CSS and transforms it on the fly, but the
|
|
202
|
+
* SSR HTML shell has no `<link>` tag — CSS only loads after client JS
|
|
203
|
+
* hydrates, causing a flash of unstyled content (FOUC).
|
|
204
|
+
*
|
|
205
|
+
* Pass a string (e.g. `"src/globals.css"`) or an array of paths.
|
|
206
|
+
* Each path is emitted as `<link rel="stylesheet" href="/path">`.
|
|
207
|
+
* Defaults to `["src/globals.css"]`.
|
|
208
|
+
*/
|
|
209
|
+
css?: string | string[];
|
|
199
210
|
}
|
|
200
211
|
/** Vite dev server shape — minimal interface to avoid hard dep on vite */
|
|
201
212
|
interface ViteDevServer {
|
|
@@ -212,6 +223,6 @@ interface ViteDevServer {
|
|
|
212
223
|
*/
|
|
213
224
|
declare function registerSSR(app: Hono, vite: ViteDevServer | null, options?: SSROptions): void;
|
|
214
225
|
|
|
215
|
-
declare const VERSION = "0.4.
|
|
226
|
+
declare const VERSION = "0.4.3";
|
|
216
227
|
|
|
217
228
|
export { type CorsConfig, type HttpMethod, type MiddlewareHandler, type RouteEntry, type RouteHandler, type RouteModule, type SSROptions, type ServerConfig, type ServerInfo, VERSION, type ViteDevOptions, type VoltxServer, createCorsMiddleware, createErrorHandler, createLoggerMiddleware, createServer, createViteDevConfig, filePathToUrlPath, registerSSR, registerStaticFiles, scanAndRegisterRoutes };
|
package/dist/index.js
CHANGED
|
@@ -318,9 +318,8 @@ function registerSSR(app, vite, options = {}) {
|
|
|
318
318
|
try {
|
|
319
319
|
const { createServer: createViteServer } = await import("vite");
|
|
320
320
|
const devServer = await createViteServer({
|
|
321
|
-
server: { middlewareMode: true },
|
|
322
|
-
appType: "custom"
|
|
323
|
-
optimizeDeps: { disabled: true }
|
|
321
|
+
server: { middlewareMode: true, hmr: false },
|
|
322
|
+
appType: "custom"
|
|
324
323
|
});
|
|
325
324
|
const mod = await devServer.ssrLoadModule(entryServer);
|
|
326
325
|
render = mod.render;
|
|
@@ -339,6 +338,8 @@ function registerSSR(app, vite, options = {}) {
|
|
|
339
338
|
const isProd = process.env.NODE_ENV === "production";
|
|
340
339
|
if (!isProd) {
|
|
341
340
|
clientScript = `/${entryClient}`;
|
|
341
|
+
const cssPaths = options.css ? Array.isArray(options.css) ? options.css : [options.css] : ["src/globals.css"];
|
|
342
|
+
cssLinks = cssPaths.map((p) => ` <link rel="stylesheet" href="/${p}" />`).join("\n");
|
|
342
343
|
} else {
|
|
343
344
|
if (!manifest) {
|
|
344
345
|
const manifestPath = resolve2(process.cwd(), "dist/client/.vite/manifest.json");
|
|
@@ -402,7 +403,7 @@ ${cssLinks}
|
|
|
402
403
|
}
|
|
403
404
|
|
|
404
405
|
// src/index.ts
|
|
405
|
-
var VERSION = "0.4.
|
|
406
|
+
var VERSION = "0.4.3";
|
|
406
407
|
export {
|
|
407
408
|
Hono2 as Hono,
|
|
408
409
|
VERSION,
|
package/package.json
CHANGED