Skip to main content

precompile

@webda/react-email


Function: precompile()

precompile(options): Promise<PrecompileResult>

Defined in: packages/react-email/src/precompile.ts:134

Precompile react-email templates into mustache templates

Each string or number PreviewProps key is replaced by a {{{key}}} placeholder before rendering. Templates with other kinds of props are skipped: they need the runtime react-email engine. A locale variant (<name>/<locale>/email.tsx or <name>.<locale>.tsx) also gets its locale prop, as at runtime.

Parameters​

options​

PrecompileOptions

precompile options

Returns​

Promise<PrecompileResult>

the generated, skipped and failed template paths