This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
/
index.d.ts
100 lines (87 loc) · 2.67 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import {Plugin} from 'rollup';
import {AsyncOpts} from 'resolve';
export interface Options {
/**
* the fields to scan in a package.json to determine the entry point
* if this list contains "browser", overrides specified in "pkg.browser"
* will be used
* @default ['module', 'main']
*/
mainFields?: ReadonlyArray<string>;
/**
* @deprecated use "mainFields" instead
* use "module" field for ES6 module if possible
* @default true
*/
module?: boolean;
/**
* @deprecated use "mainFields" instead
* use "jsnext:main" if possible
* legacy field pointing to ES6 module in third-party libraries,
* deprecated in favor of "pkg.module":
* - see: https://github.com/rollup/rollup/wiki/pkg.module
* @default false
*/
jsnext?: boolean;
/**
* @deprecated use "mainFields" instead
* use "main" field or index.js, even if it's not an ES6 module
* (needs to be converted from CommonJS to ES6)
* – see https://github.com/rollup/rollup-plugin-commonjs
* @default true
*/
main?: boolean;
/**
* some package.json files have a "browser" field which specifies
* alternative files to load for people bundling for the browser. If
* that's you, either use this option or add "browser" to the
* "mainfields" option, otherwise pkg.browser will be ignored
* @default false
*/
browser?: boolean;
/**
* not all files you want to resolve are .js files
* @default [ '.mjs', '.js', '.json', '.node' ]
*/
extensions?: ReadonlyArray<string>;
/**
* whether to prefer built-in modules (e.g. `fs`, `path`) or
* local ones with the same names
* @default true
*/
preferBuiltins?: boolean;
/**
* Lock the module search in this path (like a chroot). Module defined
* outside this path will be marked as external
* @default '/'
*/
jail?: string;
/**
* Set to an array of strings and/or regexps to lock the module search
* to modules that match at least one entry. Modules not matching any
* entry will be marked as external
* @default null
*/
only?: ReadonlyArray<string | RegExp> | null;
/**
* If true, inspect resolved files to check that they are
* ES2015 modules
* @default false
*/
modulesOnly?: boolean;
/**
* Force resolving for these modules to root's node_modules that helps
* to prevent bundling the same package multiple times if package is
* imported from dependencies.
*/
dedupe?: string[] | ((importee: string) => boolean);
/**
* Any additional options that should be passed through
* to node-resolve
*/
customResolveOptions?: AsyncOpts;
}
/**
* Locate modules using the Node resolution algorithm, for using third party modules in node_modules
*/
export default function nodeResolve(options?: Options): Plugin;