@rollup/plugin-node-resolve 7.0.0 → 7.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +54 -66
- package/dist/index.es.js +441 -338
- package/dist/index.js +441 -338
- package/package.json +12 -12
- package/types/index.d.ts +37 -61
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rollup/plugin-node-resolve",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.1.3",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"ci:test": "pnpm run test -- --verbose && pnpm run test:ts",
|
23
23
|
"lint": "pnpm run lint:js && pnpm run lint:docs && pnpm run lint:package",
|
24
24
|
"lint:docs": "prettier --single-quote --write README.md",
|
25
|
-
"lint:js": "eslint --fix --cache src test",
|
25
|
+
"lint:js": "eslint --fix --cache src test types --ext .js,.ts",
|
26
26
|
"lint:package": "prettier --write package.json --plugin=prettier-plugin-package",
|
27
27
|
"prebuild": "del-cli dist",
|
28
28
|
"prepare": "pnpm run build",
|
@@ -45,23 +45,23 @@
|
|
45
45
|
"modules"
|
46
46
|
],
|
47
47
|
"peerDependencies": {
|
48
|
-
"rollup": "^1.20.0"
|
48
|
+
"rollup": "^1.20.0||^2.0.0"
|
49
49
|
},
|
50
50
|
"dependencies": {
|
51
|
-
"@rollup/pluginutils": "^3.0.
|
51
|
+
"@rollup/pluginutils": "^3.0.8",
|
52
52
|
"@types/resolve": "0.0.8",
|
53
53
|
"builtin-modules": "^3.1.0",
|
54
54
|
"is-module": "^1.0.0",
|
55
|
-
"resolve": "^1.
|
55
|
+
"resolve": "^1.14.2"
|
56
56
|
},
|
57
57
|
"devDependencies": {
|
58
|
-
"@babel/core": "^7.
|
59
|
-
"@babel/preset-env": "^7.
|
60
|
-
"@rollup/plugin-json": "^4.0.
|
61
|
-
"es5-ext": "^0.10.
|
62
|
-
"rollup": "^
|
63
|
-
"rollup-plugin-babel": "^4.3.
|
64
|
-
"rollup-plugin-commonjs": "^10.
|
58
|
+
"@babel/core": "^7.9.0",
|
59
|
+
"@babel/preset-env": "^7.9.0",
|
60
|
+
"@rollup/plugin-json": "^4.0.1",
|
61
|
+
"es5-ext": "^0.10.53",
|
62
|
+
"rollup": "^2.0.0",
|
63
|
+
"rollup-plugin-babel": "^4.3.3",
|
64
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
65
65
|
"source-map": "^0.7.3",
|
66
66
|
"string-capitalize": "^1.0.1"
|
67
67
|
},
|
package/types/index.d.ts
CHANGED
@@ -3,100 +3,76 @@ import { AsyncOpts } from 'resolve';
|
|
3
3
|
|
4
4
|
export interface Options {
|
5
5
|
/**
|
6
|
-
* the
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
|
11
|
-
mainFields?: ReadonlyArray<string>;
|
12
|
-
|
13
|
-
/**
|
14
|
-
* @deprecated use "mainFields" instead
|
15
|
-
* use "module" field for ES6 module if possible
|
16
|
-
* @default true
|
17
|
-
*/
|
18
|
-
module?: boolean;
|
19
|
-
|
20
|
-
/**
|
21
|
-
* @deprecated use "mainFields" instead
|
22
|
-
* use "jsnext:main" if possible
|
23
|
-
* legacy field pointing to ES6 module in third-party libraries,
|
24
|
-
* deprecated in favor of "pkg.module":
|
25
|
-
* - see: https://github.com/rollup/rollup/wiki/pkg.module
|
6
|
+
* If `true`, instructs the plugin to use the `"browser"` property in `package.json`
|
7
|
+
* files to specify alternative files to load for bundling. This is useful when
|
8
|
+
* bundling for a browser environment. Alternatively, a value of `'browser'` can be
|
9
|
+
* added to the `mainFields` option. If `false`, any `"browser"` properties in
|
10
|
+
* package files will be ignored. This option takes precedence over `mainFields`.
|
26
11
|
* @default false
|
27
12
|
*/
|
28
|
-
|
13
|
+
browser?: boolean;
|
29
14
|
|
30
15
|
/**
|
31
|
-
*
|
32
|
-
* use "main" field or index.js, even if it's not an ES6 module
|
33
|
-
* (needs to be converted from CommonJS to ES6)
|
34
|
-
* – see https://github.com/rollup/rollup-plugin-commonjs
|
35
|
-
* @default true
|
16
|
+
* An `Object` that specifies additional options that should be passed through to `node-resolve`.
|
36
17
|
*/
|
37
|
-
|
18
|
+
customResolveOptions?: AsyncOpts;
|
38
19
|
|
39
20
|
/**
|
40
|
-
*
|
41
|
-
*
|
42
|
-
*
|
43
|
-
* "mainfields" option, otherwise pkg.browser will be ignored
|
44
|
-
* @default false
|
21
|
+
* An `Array` of modules names, which instructs the plugin to force resolving for the
|
22
|
+
* specified modules to the root `node_modules`. Helps to prevent bundling the same
|
23
|
+
* package multiple times if package is imported from dependencies.
|
45
24
|
*/
|
46
|
-
|
25
|
+
dedupe?: string[] | ((importee: string) => boolean);
|
47
26
|
|
48
27
|
/**
|
49
|
-
*
|
28
|
+
* Specifies the extensions of files that the plugin will operate on.
|
50
29
|
* @default [ '.mjs', '.js', '.json', '.node' ]
|
51
30
|
*/
|
52
|
-
extensions?:
|
31
|
+
extensions?: readonly string[];
|
53
32
|
|
54
33
|
/**
|
55
|
-
*
|
56
|
-
*
|
57
|
-
* @default true
|
58
|
-
*/
|
59
|
-
preferBuiltins?: boolean;
|
60
|
-
|
61
|
-
/**
|
62
|
-
* Lock the module search in this path (like a chroot). Module defined
|
63
|
-
* outside this path will be marked as external
|
34
|
+
* Locks the module search within specified path (e.g. chroot). Modules defined
|
35
|
+
* outside this path will be marked as external.
|
64
36
|
* @default '/'
|
65
37
|
*/
|
66
38
|
jail?: string;
|
67
39
|
|
68
40
|
/**
|
69
|
-
*
|
70
|
-
*
|
71
|
-
*
|
72
|
-
* @default null
|
41
|
+
* Specifies the properties to scan within a `package.json`, used to determine the
|
42
|
+
* bundle entry point.
|
43
|
+
* @default ['module', 'main']
|
73
44
|
*/
|
74
|
-
|
45
|
+
mainFields?: readonly string[];
|
75
46
|
|
76
47
|
/**
|
77
|
-
* If true
|
78
|
-
* ES2015 modules
|
48
|
+
* If `true`, inspect resolved files to assert that they are ES2015 modules.
|
79
49
|
* @default false
|
80
50
|
*/
|
81
51
|
modulesOnly?: boolean;
|
82
52
|
|
83
53
|
/**
|
84
|
-
*
|
85
|
-
*
|
86
|
-
* imported from dependencies.
|
54
|
+
* @deprecated use "resolveOnly" instead
|
55
|
+
* @default null
|
87
56
|
*/
|
88
|
-
|
57
|
+
only?: ReadonlyArray<string | RegExp> | null;
|
89
58
|
|
90
59
|
/**
|
91
|
-
*
|
92
|
-
*
|
60
|
+
* If `true`, the plugin will prefer built-in modules (e.g. `fs`, `path`). If `false`,
|
61
|
+
* the plugin will look for locally installed modules of the same name.
|
62
|
+
* @default true
|
93
63
|
*/
|
94
|
-
|
64
|
+
preferBuiltins?: boolean;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* An `Array` which instructs the plugin to limit module resolution to those whose
|
68
|
+
* names match patterns in the array.
|
69
|
+
* @default []
|
70
|
+
*/
|
71
|
+
resolveOnly?: ReadonlyArray<string | RegExp> | null;
|
95
72
|
|
96
73
|
/**
|
97
|
-
*
|
98
|
-
* and when resolving deduplicated modules.
|
99
|
-
* of a monorepository.
|
74
|
+
* Specifies the root directory from which to resolve modules. Typically used when
|
75
|
+
* resolving entry-point imports, and when resolving deduplicated modules.
|
100
76
|
* @default process.cwd()
|
101
77
|
*/
|
102
78
|
rootDir?: string;
|