A custom transformer that can be used with ttypescript to transform ts imports to browser style imports
Home > config > DynamicImportPathRewriteCustom
Rewrite dynamic import with a custom function
Signature:
export interface DynamicImportPathRewriteCustom
The function in the function
should have the signature of:
(path: string, defaultImpl: (path: string) => Promise<unknown>) => Promise<unknown>
where the defaultImpl
is the transformer’s default runtime helper.
The function must be an ArrowFunctionExpression on the syntax level.
{
type: 'custom',
function: "(path, defaultImpl) => defaultImpl('std:' + path)"
}
Property | Type | Description |
---|---|---|
function | string | The function string. It must be an ArrowFunctionExpression. |
type | ‘custom’ |