@rollup/plugin-node-resolve 9.0.0 → 11.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rollup/plugin-node-resolve",
3
- "version": "9.0.0",
3
+ "version": "11.1.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,6 +12,11 @@
12
12
  "bugs": "https://github.com/rollup/plugins/issues",
13
13
  "main": "./dist/cjs/index.js",
14
14
  "module": "./dist/es/index.js",
15
+ "type": "commonjs",
16
+ "exports": {
17
+ "require": "./dist/cjs/index.js",
18
+ "import": "./dist/es/index.js"
19
+ },
15
20
  "engines": {
16
21
  "node": ">= 10.0.0"
17
22
  },
@@ -54,13 +59,13 @@
54
59
  "builtin-modules": "^3.1.0",
55
60
  "deepmerge": "^4.2.2",
56
61
  "is-module": "^1.0.0",
57
- "resolve": "^1.17.0"
62
+ "resolve": "^1.19.0"
58
63
  },
59
64
  "devDependencies": {
60
65
  "@babel/core": "^7.10.5",
61
66
  "@babel/plugin-transform-typescript": "^7.10.5",
62
67
  "@rollup/plugin-babel": "^5.1.0",
63
- "@rollup/plugin-commonjs": "^14.0.0",
68
+ "@rollup/plugin-commonjs": "^16.0.0",
64
69
  "@rollup/plugin-json": "^4.1.0",
65
70
  "es5-ext": "^0.10.53",
66
71
  "rollup": "^2.23.0",
@@ -78,10 +83,5 @@
78
83
  "!**/recipes/**",
79
84
  "!**/types.ts"
80
85
  ]
81
- },
82
- "exports": {
83
- "require": "./dist/cjs/index.js",
84
- "import": "./dist/es/index.js"
85
- },
86
- "type": "commonjs"
86
+ }
87
87
  }
package/types/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Plugin } from 'rollup';
2
- import { AsyncOpts } from 'resolve';
3
2
 
4
3
  export const DEFAULTS: {
5
4
  customResolveOptions: {};
@@ -9,6 +8,18 @@ export const DEFAULTS: {
9
8
  };
10
9
 
11
10
  export interface RollupNodeResolveOptions {
11
+ /**
12
+ * Additional conditions of the package.json exports field to match when resolving modules.
13
+ * By default, this plugin looks for the `'default', 'module', 'import']` conditions when resolving imports.
14
+ *
15
+ * When using `@rollup/plugin-commonjs` v16 or higher, this plugin will use the
16
+ * `['default', 'module', 'import']` conditions when resolving require statements.
17
+ *
18
+ * Setting this option will add extra conditions on top of the default conditions.
19
+ * See https://nodejs.org/api/packages.html#packages_conditional_exports for more information.
20
+ */
21
+ exportConditions?: string[];
22
+
12
23
  /**
13
24
  * If `true`, instructs the plugin to use the `"browser"` property in `package.json`
14
25
  * files to specify alternative files to load for bundling. This is useful when
@@ -20,9 +31,10 @@ export interface RollupNodeResolveOptions {
20
31
  browser?: boolean;
21
32
 
22
33
  /**
23
- * An `Object` that specifies additional options that should be passed through to `node-resolve`.
34
+ * One or more directories in which to recursively look for modules.
35
+ * @default ['node_modules']
24
36
  */
25
- customResolveOptions?: AsyncOpts;
37
+ moduleDirectories?: string[];
26
38
 
27
39
  /**
28
40
  * An `Array` of modules names, which instructs the plugin to force resolving for the
@@ -57,12 +69,6 @@ export interface RollupNodeResolveOptions {
57
69
  */
58
70
  modulesOnly?: boolean;
59
71
 
60
- /**
61
- * @deprecated use "resolveOnly" instead
62
- * @default null
63
- */
64
- only?: ReadonlyArray<string | RegExp> | null;
65
-
66
72
  /**
67
73
  * If `true`, the plugin will prefer built-in modules (e.g. `fs`, `path`). If `false`,
68
74
  * the plugin will look for locally installed modules of the same name.