1 | import { Plugin } from 'rollup';
|
2 |
|
3 | type Replacement = string | ((id: string) => string);
|
4 |
|
5 | interface RollupReplaceOptions {
|
6 | /**
|
7 | * A minimatch pattern, or array of patterns, of files that should be
|
8 | * processed by this plugin (if omitted, all files are included by default)
|
9 | */
|
10 | include?: string | RegExp | ReadonlyArray<string | RegExp> | null;
|
11 | /**
|
12 | * Files that should be excluded, if `include` is otherwise too permissive.
|
13 | */
|
14 | exclude?: string | RegExp | ReadonlyArray<string | RegExp> | null;
|
15 | /**
|
16 | * To replace every occurrence of `<@foo@>` instead of every occurrence
|
17 | * of `foo`, supply delimiters
|
18 | */
|
19 | delimiters?: [string, string];
|
20 | /**
|
21 | * You can separate values to replace from other options.
|
22 | */
|
23 | values?: { [str: string]: Replacement };
|
24 |
|
25 | /**
|
26 | * All other options are treated as `string: replacement` replacers,
|
27 | * or `string: (id) => replacement` functions.
|
28 | */
|
29 | [str: string]: Replacement | RollupReplaceOptions['include'] | RollupReplaceOptions['values'];
|
30 | }
|
31 |
|
32 | /**
|
33 | * Replace strings in files while bundling them.
|
34 | */
|
35 | export default function replace(options?: RollupReplaceOptions): Plugin;
|
36 |
|
\ | No newline at end of file |