@rollup/plugin-node-resolve
Advanced tools
Comparing version 15.1.0 to 15.2.0
@@ -15,3 +15,3 @@ 'use strict'; | ||
var version = "15.1.0"; | ||
var version = "15.2.0"; | ||
var peerDependencies = { | ||
@@ -1249,3 +1249,3 @@ rollup: "^2.78.0||^3.0.0" | ||
...resolveOptions, | ||
custom: { ...custom, 'node-resolve': { ...custom['node-resolve'], resolved } } | ||
custom: { ...custom, 'node-resolve': { ...custom['node-resolve'], resolved, importee } } | ||
}); | ||
@@ -1252,0 +1252,0 @@ if (resolvedResolved) { |
@@ -11,3 +11,3 @@ import path, { dirname, resolve, extname, normalize, sep } from 'path'; | ||
var version = "15.1.0"; | ||
var version = "15.2.0"; | ||
var peerDependencies = { | ||
@@ -1245,3 +1245,3 @@ rollup: "^2.78.0||^3.0.0" | ||
...resolveOptions, | ||
custom: { ...custom, 'node-resolve': { ...custom['node-resolve'], resolved } } | ||
custom: { ...custom, 'node-resolve': { ...custom['node-resolve'], resolved, importee } } | ||
}); | ||
@@ -1248,0 +1248,0 @@ if (resolvedResolved) { |
{ | ||
"name": "@rollup/plugin-node-resolve", | ||
"version": "15.1.0", | ||
"version": "15.2.0", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -237,2 +237,21 @@ [npm]: https://img.shields.io/npm/v/@rollup/plugin-node-resolve | ||
## Resolve Options | ||
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: | ||
```js | ||
this.resolve(resolved.id, importer, { | ||
custom: { | ||
'node-resolve': { | ||
resolved, // the object with information from node.js resolve | ||
importee // the original import id | ||
} | ||
} | ||
}); | ||
``` | ||
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`. | ||
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`. | ||
## Meta | ||
@@ -239,0 +258,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90267
261