forked from eight04/rollup-plugin-external-globals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
25 lines (22 loc) · 851 Bytes
/
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
import type {Plugin} from 'rollup'
type VariableName = string
/**
* globals is a moduleId/variableName map
* or provide a function that takes the moduleId and returns the variableName
*/
type ModuleNameMap = Record<string, string> | ((id: string) => VariableName)
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)
}
export default function externalGlobals(globals: ModuleNameMap, options?: ExternalGlobalsOptions): Plugin