Skip to content

@mrmt/vite / docs

docs ​

Type Aliases ​

Options ​

Options = object

Defined in: packages/vite/src/docs/index.ts:9

Properties ​

serve? ​

optional serve?: string | false

Defined in: packages/vite/src/docs/index.ts:11

Path where to serve vitepress dev server when in dev mode (default /docs) use false to disable

workspace? ​

optional workspace?: boolean

Defined in: packages/vite/src/docs/index.ts:22

Monorepo mode: scaffold a site assembling the docs of every workspace package (packages/<pkg>/docs/**) with workspaceDocs() from @mrmt/vitepress-plugin-sidebar/workspace, instead of a single-package site. Use it in the monorepo root's vite.config.ts. Options of workspaceDocs() are edited in the generated docs/.vitepress/config.ts.

The dev server integration works as usual. A root has no bundle entry, so build the site with vitepress build docs rather than vite build.

Default ​
ts
false

Functions ​

Docs() ​

Docs(options?): object

Defined in: packages/vite/src/docs/index.ts:38

Vite plugin that integrates a VitePress documentation site into your project.

  • On configResolved: scaffolds default docs files (docs/index.md, .vitepress/config.ts, etc.) if they do not already exist.
  • On closeBundle (build mode): runs vitepress build after all other plugins have finished their buildEnd work (e.g. TypeDoc markdown generation), so the docs site is always built with up-to-date content.
  • On configureServer (dev mode): mounts a VitePress dev server as middleware, served at options.serve (default /docs/).

Included automatically by @mrmt/vite/lib plugin unless docs: false is passed.

Parameters ​

options? ​

Options = {}

Returns ​

object

name ​

name: string = "marmotte:docs"

apply() ​

apply(this): boolean

Parameters ​
this ​

void

Returns ​

boolean

buildEnd() ​

buildEnd(this, error?): void

Parameters ​
this ​

PluginContext

error? ​

Error

Returns ​

void

closeBundle() ​

closeBundle(this): Promise<void>

Parameters ​
this ​

PluginContext

Returns ​

Promise<void>

configResolved() ​

configResolved(this, resolvedConfig): Promise<void>

Parameters ​
this ​

MinimalPluginContextWithoutEnvironment

resolvedConfig ​

ResolvedConfig

Returns ​

Promise<void>

configureServer() ​

configureServer(this, server): Promise<void>

Parameters ​
this ​

MinimalPluginContextWithoutEnvironment

server ​

ViteDevServer

Returns ​

Promise<void>