Skip to content

getViteBuildMode

Decides the build mode of a vite build from the consumer’s config: development for a watch build or for --mode development, production otherwise.

Import:

import { getViteBuildMode } from '@mnaoumov/obsidian-dev-toolkit/bundlers/vite';

Signature:

function getViteBuildMode(userConfig: UserConfig, env: Pick<ConfigEnv, "mode">): BuildMode

Parameters:

Parameter Type Description
userConfig UserConfig The consumer’s vite config.
env Pick<ConfigEnv, “mode”> The vite config environment.

Returns: BuildMode — The build mode.