Skip to content

getFrameworkDefines

Builds the compile-time constants a framework’s runtime reads, which Obsidian’s renderer does not define.

process.env.NODE_ENV picks a runtime’s production build (React, Preact’s devtools, Vue, Solid), and without it a production plugin would bundle and run the development one. Vue also reads its three feature flags.

Import:

import { getFrameworkDefines } from '@mnaoumov/obsidian-dev-toolkit/bundlers/obsidian-plugin-features';

Signature:

function getFrameworkDefines(params: GetFrameworkDefinesParams): Record<string, string>

Parameters:

Parameter Type Description
params GetFrameworkDefinesParams The GetFrameworkDefinesParams.

Returns: Record<string, string> — The constants, by expression, each value a JavaScript literal. Empty when there is no framework.


Links to this page: