use-macro
Version:
ESBuild plugin that allows you to execute functions at compile time and inline the output
14 lines (13 loc) • 398 B
TypeScript
import * as t from '@babel/types';
import { OnLoadResult } from 'esbuild';
interface MacroFunction {
ast: t.FunctionDeclaration | t.FunctionExpression;
path: string;
args: t.Node[];
}
export declare class MacroTransformer {
cache: Map<string, string>;
functions: Map<string, MacroFunction>;
transform(contents: string, filePath: string): Promise<OnLoadResult>;
}
export {};