@baleada/rollup-plugin-source-transform
Version:
Rollup plugin that allows you to transform files' content during your build step.
24 lines (21 loc) • 681 B
TypeScript
import pluginUtils, { FilterPattern } from '@rollup/pluginutils';
import { TransformResult, TransformPluginContext, Plugin } from 'rollup';
declare type Options = {
transform?: ((api: Api) => TransformResult) | ((api: Api) => Promise<TransformResult>);
include?: FilterPattern;
exclude?: FilterPattern;
test?: Test;
};
declare type Test = (api: TestApi) => boolean;
declare type TestApi = {
id?: string;
source?: string;
};
declare type Api = {
source: string;
id: string;
context: TransformPluginContext;
utils: typeof pluginUtils;
};
declare function sourceTransform(options?: Options): Plugin;
export { Api, Options, sourceTransform };