requireOptionalPeer
Loads an optional peer dependency from the project’s own node_modules synchronously, for a bundler whose plugins are applied synchronously (webpack). Loads an ES module too, through require.
Import:
import { requireOptionalPeer } from '@mnaoumov/obsidian-dev-toolkit/bundlers/obsidian-plugin-features';Signature:
function requireOptionalPeer(params: ImportOptionalPeerParams): unknownParameters:
| Parameter | Type | Description |
|---|---|---|
params |
ImportOptionalPeerParams | The RequireOptionalPeerParams. |
Returns: unknown — The module, for the caller to type.
Links to this page: