Skip to content
Pitlane

@pitlane/dev/runtime

Server- and client-safe runtime helpers for the ?assets= import convention. Import from @pitlane/dev/runtime in application code.

Interfaces

ImportedAssets

The result shape of a ?assets= import: the resolved entry URL (client environment only), plus the JS and CSS assets reachable from the imported module in that environment.

During dev, js is always empty (no chunk graph exists yet) and ?assets=client carries no CSS — Vite injects dev styles itself; the server-environment results carry data-vite-dev-id stylesheet links.

Properties

css
ts
css: object[];
data-vite-dev-id?
ts
optional data-vite-dev-id?: string;
href
ts
href: string;
entry?
ts
optional entry?: string;
js
ts
js: object[];
href
ts
href: string;

Methods

merge()
ts
merge(...results): ImportedAssets;
Parameters
results

...ImportedAssets[]

Returns

ImportedAssets

Variables

mergeAssets

ts
const mergeAssets: (...results) => ImportedAssets = mergeAssetsImpl;

Merges multiple ?assets= results, deduplicating js and css entries by href. Typical use: combining the client entry's assets with the SSR module's CSS inside a <Document> component.

The annotation re-types the delegated implementation against Pitlane-owned shapes so the dependency never appears in this package's public types.

Parameters

results

...ImportedAssets[]

Returns

ImportedAssets