-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.d.ts
37 lines (32 loc) · 1.04 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import type { Plugin } from "rollup";
export type VariableName = string;
/**
* globals is a moduleId/variableName map
* or provide a function that takes the moduleId and returns the variableName
*/
export type ModuleNameMap =
| Record<string, string>
| ((id: string) => VariableName);
export type ExternalGlobalsOptions = {
/**
* [include] is an array of glob patterns. If defined, only matched files would be transformed.
*/
include?: Array<string>;
/**
* [exclude] is an array of glob patterns. Matched files would not be transformed.
*/
exclude?: Array<string>;
/**
* [dynamicWrapper] is used to specify dynamic imports. It accepts a variable name and returns an expression
*/
dynamicWrapper?: (variableName: VariableName) => string;
/**
* [constBindings] is used to decide whether to use `const` to declare variables. Default is `false`
*/
constBindings?: boolean;
};
export declare function externalGlobals(
globals: ModuleNameMap,
options?: ExternalGlobalsOptions
): Plugin;
export = externalGlobals;