Skip to content

lit-ui-router-ssr / vite / ServerRouterPlugin

Interface: ServerRouterPlugin ​

Defined in: packages/ui-router-server/dist/vite.d.ts:119

A structural subset of Vite's Plugin — assignable into plugins: [...].

Properties ​

PropertyTypeDescriptionDefined in
closeBundle{ handler(this, error?): Promise<void>; order: "post"; sequential: true; }Runs the prerender entry once the client build has written its output.packages/ui-router-server/dist/vite.d.ts:135
closeBundle.handler(this, error?) => Promise<void>The build step; a no-op without prerender.packages/ui-router-server/dist/vite.d.ts:141
closeBundle.order"post"After every other plugin's closeBundle.packages/ui-router-server/dist/vite.d.ts:137
closeBundle.sequentialtrueNot alongside them.packages/ui-router-server/dist/vite.d.ts:139
namestringThe plugin name Vite reports in errors and logs.packages/ui-router-server/dist/vite.d.ts:121

Methods ​

config() ​

ts
config(config): ViteUserConfig | undefined;

Defined in: packages/ui-router-server/dist/vite.d.ts:123

Sets Vite's base from the router's when the config leaves it unset; throws when the two differ.

Parameters ​

ParameterType
configViteUserConfig

Returns ​

ViteUserConfig | undefined


configResolved() ​

ts
configResolved(config): Promise<void>;

Defined in: packages/ui-router-server/dist/vite.d.ts:129

Reads the root, the base, the output directory and the logger. Under a base the router doesn't declare, resolves it and throws when a mount already carries it.

Parameters ​

ParameterType
configViteResolvedConfig

Returns ​

Promise<void>


configurePreviewServer() ​

ts
configurePreviewServer(server): void;

Defined in: packages/ui-router-server/dist/vite.d.ts:133

Installs the same middleware into vite preview, serving the prerendered pages when there are any.

Parameters ​

ParameterType
serverViteMiddlewareServer

Returns ​

void


configureServer() ​

ts
configureServer(server): void;

Defined in: packages/ui-router-server/dist/vite.d.ts:131

Installs the middleware into vite dev, synchronously so it lands in the PRE position.

Parameters ​

ParameterType
serverViteMiddlewareServer

Returns ​

void