dev-server.ts

Source

10 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

Reference

fncreateDevServerCache(): DevServerCacheCreate a dev server cache instance.

Create a dev server cache instance.

View source

Returns

DevServerCache
fncreateDevServerMiddleware(options: ResolvedOptions, root: string, cache: DevServerCache): Connect.NextHandleFunctionCreate the dev server middleware for SSG page serving.

Create the dev server middleware for SSG page serving.

View source

Parameters

  • options ResolvedOptions
  • root string
  • cache DevServerCache

Returns

Connect.NextHandleFunction
interfaceDevServerCacheDev server state for caching.

Dev server state for caching.

View source

fninjectViteHmrClient(html: string): stringInject Vite HMR client script into the HTML.

Inject Vite HMR client script into the HTML.

View source

Parameters

  • html string

Returns

string
fninvalidateNavCache(cache: DevServerCache): voidInvalidate navigation cache (called on file add/unlink).

Invalidate navigation cache (called on file add/unlink).

View source

Parameters

  • cache DevServerCache

Returns

void
fninvalidatePageCache(cache: DevServerCache, filePath: string): voidInvalidate page cache for a specific file (called on file change).

Invalidate page cache for a specific file (called on file change).

View source

Parameters

  • cache DevServerCache
  • filePath string

Returns

void
fnrenderPage(filePath: string, options: ResolvedOptions, navGroups: NavGroup[], siteName: string, base: string, root: string): Promise<string>Render a single markdown page to full HTML.

Render a single markdown page to full HTML.

View source

Parameters

  • filePath string
  • options ResolvedOptions
  • navGroups NavGroup[]
  • siteName string
  • base string
  • root string

Returns

Promise
fnresolveMarkdownFile(url: string, srcDir: string): Promise<string | null>Resolve a request URL to a markdown file path. Returns null if no matching file…

Resolve a request URL to a markdown file path. Returns null if no matching file exists.

View source

Parameters

  • url string
  • srcDir string

Returns

Promise
fnresolveSiteName(options: ResolvedOptions, root: string): Promise<string>Resolve site name from options or package.json.

Resolve site name from options or package.json.

View source

Parameters

  • options ResolvedOptions
  • root string

Returns

Promise
fnshouldSkip(url: string): booleanCheck if a request URL should be skipped by the dev server middleware.

Check if a request URL should be skipped by the dev server middleware.

View source

Parameters

  • url string

Returns

boolean