Skip to content

marmotte / vite/lib

vite/lib

Type Aliases

LibConfigPluginOptions

LibConfigPluginOptions = object

Defined in: src/vite/lib.ts:12

Properties

entries?

optional entries?: PathFilter

Defined in: src/vite/lib.ts:20

A filter to automatically add files from UserVitePluginOptions.sourceDir to entries.

If not defined and no entry is manually added by the user in its vite config, <sourceDir>/index.ts will be used

Example
ts
/(?<!\.d)(?<!\.test)(?<!\.test-d)\.ts$/

LibPluginOptions

LibPluginOptions = LibConfigPluginOptions & object

Defined in: src/vite/lib.ts:69

Type Declaration

docs?

optional docs?: Options | false

Options for the Docs plugin, use false to disable

dts?

optional dts?: WithNoDefaults<PluginOptions>

Options for the vite-plugin-dts (will be merged with defaults)

externals?

optional externals?: ExternalsOptions

Options for the rollup-plugin-node-externals

typedoc?

optional typedoc?: Options | false

Options for the TypeDoc plugin, use false to disable (disabled by default if docs: false)

Functions

Lib()

Lib(options?): Plugin<any>[]

Defined in: src/vite/lib.ts:83

Configures vite to build a library (can be node, browser or isomorphic)

Parameters

options?

LibPluginOptions = {}

Returns

Plugin<any>[]


LibConfig()

LibConfig(options): Plugin

Defined in: src/vite/lib.ts:30

Low-level plugin that sets the Vite build options for library mode. Discovers entry points from sourceDir using the LibConfigPluginOptions.entries filter, or falls back to <sourceDir>/index.ts when no entries or manual build.lib.entry are provided.

Used internally by Lib. Prefer Lib() for most use cases.

Parameters

options

LibConfigPluginOptions

Returns

Plugin