@rollup/plugin-node-resolve 15.1.0 → 15.2.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/README.md +19 -0
- package/dist/cjs/index.js +2 -2
- package/dist/es/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
@@ -234,6 +234,25 @@ this.resolve(importee, importer, {
|
|
234
234
|
});
|
235
235
|
```
|
236
236
|
|
237
|
+
## Resolve Options
|
238
|
+
|
239
|
+
After this plugin resolved an import id to its target file in `node_modules`, it will invoke `this.resolve` again with the resolved id. It will pass the following information in the resolve options:
|
240
|
+
|
241
|
+
```js
|
242
|
+
this.resolve(resolved.id, importer, {
|
243
|
+
custom: {
|
244
|
+
'node-resolve': {
|
245
|
+
resolved, // the object with information from node.js resolve
|
246
|
+
importee // the original import id
|
247
|
+
}
|
248
|
+
}
|
249
|
+
});
|
250
|
+
```
|
251
|
+
|
252
|
+
Your plugin can use the `importee` information to map an original import to its resolved file in `node_modules`, in a plugin hook such as `resolveId`.
|
253
|
+
|
254
|
+
The `resolved` object contains the resolved id, which is passed as the first parameter. It also has a property `moduleSideEffects`, which may contain the value from the npm `package.json` field `sideEffects` or `null`.
|
255
|
+
|
237
256
|
## Meta
|
238
257
|
|
239
258
|
[CONTRIBUTING](/.github/CONTRIBUTING.md)
|
package/dist/cjs/index.js
CHANGED
@@ -12,7 +12,7 @@ var url = require('url');
|
|
12
12
|
var resolve = require('resolve');
|
13
13
|
var pluginutils = require('@rollup/pluginutils');
|
14
14
|
|
15
|
-
var version = "15.
|
15
|
+
var version = "15.2.0";
|
16
16
|
var peerDependencies = {
|
17
17
|
rollup: "^2.78.0||^3.0.0"
|
18
18
|
};
|
@@ -1245,7 +1245,7 @@ function nodeResolve(opts = {}) {
|
|
1245
1245
|
// `moduleSideEffects` information.
|
1246
1246
|
const resolvedResolved = await this.resolve(resolved.id, importer, {
|
1247
1247
|
...resolveOptions,
|
1248
|
-
custom: { ...custom, 'node-resolve': { ...custom['node-resolve'], resolved } }
|
1248
|
+
custom: { ...custom, 'node-resolve': { ...custom['node-resolve'], resolved, importee } }
|
1249
1249
|
});
|
1250
1250
|
if (resolvedResolved) {
|
1251
1251
|
// Handle plugins that manually make the result external
|
package/dist/es/index.js
CHANGED
@@ -8,7 +8,7 @@ import { pathToFileURL, fileURLToPath } from 'url';
|
|
8
8
|
import resolve$1 from 'resolve';
|
9
9
|
import { createFilter } from '@rollup/pluginutils';
|
10
10
|
|
11
|
-
var version = "15.
|
11
|
+
var version = "15.2.0";
|
12
12
|
var peerDependencies = {
|
13
13
|
rollup: "^2.78.0||^3.0.0"
|
14
14
|
};
|
@@ -1241,7 +1241,7 @@ function nodeResolve(opts = {}) {
|
|
1241
1241
|
// `moduleSideEffects` information.
|
1242
1242
|
const resolvedResolved = await this.resolve(resolved.id, importer, {
|
1243
1243
|
...resolveOptions,
|
1244
|
-
custom: { ...custom, 'node-resolve': { ...custom['node-resolve'], resolved } }
|
1244
|
+
custom: { ...custom, 'node-resolve': { ...custom['node-resolve'], resolved, importee } }
|
1245
1245
|
});
|
1246
1246
|
if (resolvedResolved) {
|
1247
1247
|
// Handle plugins that manually make the result external
|