@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rollup/plugin-node-resolve",
3
- "version": "7.0.0",
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.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.11.1"
55
+ "resolve": "^1.14.2"
56
56
  },
57
57
  "devDependencies": {
58
- "@babel/core": "^7.4.5",
59
- "@babel/preset-env": "^7.4.5",
60
- "@rollup/plugin-json": "^4.0.0",
61
- "es5-ext": "^0.10.50",
62
- "rollup": "^1.20.0",
63
- "rollup-plugin-babel": "^4.3.2",
64
- "rollup-plugin-commonjs": "^10.0.0",
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 fields to scan in a package.json to determine the entry point
7
- * if this list contains "browser", overrides specified in "pkg.browser"
8
- * will be used
9
- * @default ['module', 'main']
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
- jsnext?: boolean;
13
+ browser?: boolean;
29
14
 
30
15
  /**
31
- * @deprecated use "mainFields" instead
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
- main?: boolean;
18
+ customResolveOptions?: AsyncOpts;
38
19
 
39
20
  /**
40
- * some package.json files have a "browser" field which specifies
41
- * alternative files to load for people bundling for the browser. If
42
- * that's you, either use this option or add "browser" to the
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
- browser?: boolean;
25
+ dedupe?: string[] | ((importee: string) => boolean);
47
26
 
48
27
  /**
49
- * not all files you want to resolve are .js files
28
+ * Specifies the extensions of files that the plugin will operate on.
50
29
  * @default [ '.mjs', '.js', '.json', '.node' ]
51
30
  */
52
- extensions?: ReadonlyArray<string>;
31
+ extensions?: readonly string[];
53
32
 
54
33
  /**
55
- * whether to prefer built-in modules (e.g. `fs`, `path`) or
56
- * local ones with the same names
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
- * Set to an array of strings and/or regexps to lock the module search
70
- * to modules that match at least one entry. Modules not matching any
71
- * entry will be marked as external
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
- only?: ReadonlyArray<string | RegExp> | null;
45
+ mainFields?: readonly string[];
75
46
 
76
47
  /**
77
- * If true, inspect resolved files to check that they are
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
- * Force resolving for these modules to root's node_modules that helps
85
- * to prevent bundling the same package multiple times if package is
86
- * imported from dependencies.
54
+ * @deprecated use "resolveOnly" instead
55
+ * @default null
87
56
  */
88
- dedupe?: string[] | ((importee: string) => boolean);
57
+ only?: ReadonlyArray<string | RegExp> | null;
89
58
 
90
59
  /**
91
- * Any additional options that should be passed through
92
- * to node-resolve
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
- customResolveOptions?: AsyncOpts;
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
- * Root directory to resolve modules from. Used when resolving entrypoint imports,
98
- * and when resolving deduplicated modules. Useful when executing rollup in a package
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;