@rollup/plugin-node-resolve 6.0.0 → 7.1.1
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 +42 -2
- package/README.md +63 -54
- package/dist/index.es.js +436 -325
- package/dist/index.js +436 -325
- package/package.json +12 -14
- package/types/index.d.ts +40 -56
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rollup/plugin-node-resolve",
|
3
|
-
"version": "
|
3
|
+
"version": "7.1.1",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"license": "MIT",
|
9
9
|
"repository": "rollup/plugins",
|
10
10
|
"author": "Rich Harris <richard.a.harris@gmail.com>",
|
11
|
-
"homepage": "https://github.com/rollup/plugins/packages/node-resolve/#readme",
|
11
|
+
"homepage": "https://github.com/rollup/plugins/tree/master/packages/node-resolve/#readme",
|
12
12
|
"bugs": "https://github.com/rollup/plugins/issues",
|
13
13
|
"main": "dist/index.js",
|
14
14
|
"engines": {
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"scripts": {
|
18
18
|
"build": "rollup -c",
|
19
19
|
"ci:coverage": "nyc pnpm run test && nyc report --reporter=text-lcov > coverage.lcov",
|
20
|
-
"ci:lint": "pnpm run build && pnpm run lint
|
20
|
+
"ci:lint": "pnpm run build && pnpm run lint",
|
21
21
|
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
|
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",
|
@@ -28,7 +28,6 @@
|
|
28
28
|
"prepare": "pnpm run build",
|
29
29
|
"prepublishOnly": "pnpm run lint && pnpm run test && pnpm run test:ts",
|
30
30
|
"pretest": "pnpm run build",
|
31
|
-
"security": "echo 'pnpm needs `npm audit` support'",
|
32
31
|
"test": "ava",
|
33
32
|
"test:ts": "tsc types/index.d.ts test/types.ts --noEmit"
|
34
33
|
},
|
@@ -49,20 +48,20 @@
|
|
49
48
|
"rollup": "^1.20.0"
|
50
49
|
},
|
51
50
|
"dependencies": {
|
52
|
-
"@rollup/pluginutils": "^3.0.
|
51
|
+
"@rollup/pluginutils": "^3.0.6",
|
53
52
|
"@types/resolve": "0.0.8",
|
54
53
|
"builtin-modules": "^3.1.0",
|
55
54
|
"is-module": "^1.0.0",
|
56
|
-
"resolve": "^1.
|
55
|
+
"resolve": "^1.14.2"
|
57
56
|
},
|
58
57
|
"devDependencies": {
|
59
|
-
"@babel/core": "^7.
|
60
|
-
"@babel/preset-env": "^7.
|
61
|
-
"@rollup/plugin-json": "^4.0.
|
62
|
-
"es5-ext": "^0.10.
|
63
|
-
"rollup": "^1.
|
64
|
-
"rollup-plugin-babel": "^4.3.
|
65
|
-
"rollup-plugin-commonjs": "^10.
|
58
|
+
"@babel/core": "^7.8.3",
|
59
|
+
"@babel/preset-env": "^7.8.3",
|
60
|
+
"@rollup/plugin-json": "^4.0.1",
|
61
|
+
"es5-ext": "^0.10.53",
|
62
|
+
"rollup": "^1.29.0",
|
63
|
+
"rollup-plugin-babel": "^4.3.3",
|
64
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
66
65
|
"source-map": "^0.7.3",
|
67
66
|
"string-capitalize": "^1.0.1"
|
68
67
|
},
|
@@ -74,7 +73,6 @@
|
|
74
73
|
"!**/types.ts"
|
75
74
|
]
|
76
75
|
},
|
77
|
-
"jsnext:main": "dist/index.es.js",
|
78
76
|
"module": "dist/index.es.js",
|
79
77
|
"types": "types/index.d.ts"
|
80
78
|
}
|
package/types/index.d.ts
CHANGED
@@ -3,95 +3,79 @@ 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
31
|
extensions?: ReadonlyArray<string>;
|
53
32
|
|
54
33
|
/**
|
55
|
-
*
|
56
|
-
*
|
57
|
-
* @default
|
34
|
+
* Locks the module search within specified path (e.g. chroot). Modules defined
|
35
|
+
* outside this path will be marked as external.
|
36
|
+
* @default '/'
|
58
37
|
*/
|
59
|
-
|
38
|
+
jail?: string;
|
60
39
|
|
61
40
|
/**
|
62
|
-
*
|
63
|
-
*
|
64
|
-
* @default '
|
41
|
+
* Specifies the properties to scan within a `package.json`, used to determine the
|
42
|
+
* bundle entry point.
|
43
|
+
* @default ['module', 'main']
|
65
44
|
*/
|
66
|
-
|
45
|
+
mainFields?: ReadonlyArray<string>;
|
67
46
|
|
68
47
|
/**
|
69
|
-
*
|
70
|
-
*
|
71
|
-
|
48
|
+
* If `true`, inspect resolved files to assert that they are ES2015 modules.
|
49
|
+
* @default false
|
50
|
+
*/
|
51
|
+
modulesOnly?: boolean;
|
52
|
+
|
53
|
+
/**
|
54
|
+
* @deprecated use "resolveOnly" instead
|
72
55
|
* @default null
|
73
56
|
*/
|
74
57
|
only?: ReadonlyArray<string | RegExp> | null;
|
75
58
|
|
76
59
|
/**
|
77
|
-
* If true
|
78
|
-
*
|
79
|
-
* @default
|
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
|
80
63
|
*/
|
81
|
-
|
64
|
+
preferBuiltins?: boolean;
|
82
65
|
|
83
66
|
/**
|
84
|
-
*
|
85
|
-
*
|
86
|
-
*
|
67
|
+
* An `Array` which instructs the plugin to limit module resolution to those whose
|
68
|
+
* names match patterns in the array.
|
69
|
+
* @default []
|
87
70
|
*/
|
88
|
-
|
71
|
+
resolveOnly?: ReadonlyArray<string | RegExp> | null;
|
89
72
|
|
90
73
|
/**
|
91
|
-
*
|
92
|
-
*
|
74
|
+
* Specifies the root directory from which to resolve modules. Typically used when
|
75
|
+
* resolving entry-point imports, and when resolving deduplicated modules.
|
76
|
+
* @default process.cwd()
|
93
77
|
*/
|
94
|
-
|
78
|
+
rootDir?: string;
|
95
79
|
}
|
96
80
|
|
97
81
|
/**
|