Skip to main content

resolveModulePath

@webda/react-email


Function: resolveModulePath()

resolveModulePath(path, sourceMap?): string

Defined in: packages/react-email/src/loader.ts:80

Resolve the module to import, preferring a compiled one when a source map matches

Parameters​

path​

string

path of the email source, relative to process.cwd() (or absolute)

sourceMap?​

Record<string, string>

source prefix to compiled prefix map, relative to process.cwd() (./emails and emails/ are the same prefix); the first matching prefix is replaced and .tsx/.jsx becomes .js

Returns​

string

the mapped absolute path if that file exists, else path unchanged