enhanced-resolve
Advanced tools
Comparing version 4.3.0 to 4.4.0
@@ -85,2 +85,5 @@ /* | ||
// Ignore errors happening when resolving roots | ||
const ignoreRootsErrors = options.ignoreRootsErrors || false; | ||
const restrictions = options.restrictions || []; | ||
@@ -226,3 +229,10 @@ | ||
roots.forEach(root => { | ||
plugins.push(new RootPlugin("after-described-resolve", root, "relative")); | ||
plugins.push( | ||
new RootPlugin( | ||
"after-described-resolve", | ||
root, | ||
"relative", | ||
ignoreRootsErrors | ||
) | ||
); | ||
}); | ||
@@ -229,0 +239,0 @@ plugins.push(new JoinRequestPlugin("after-described-resolve", "relative")); |
@@ -16,7 +16,9 @@ /* | ||
* @param {string | ResolveStepHook} target target hook | ||
* @param {boolean=} ignoreErrors ignore error during resolving of root paths | ||
*/ | ||
constructor(source, root, target) { | ||
constructor(source, root, target, ignoreErrors) { | ||
this.root = root; | ||
this.source = source; | ||
this.target = target; | ||
this._ignoreErrors = ignoreErrors; | ||
} | ||
@@ -48,3 +50,16 @@ | ||
resolveContext, | ||
callback | ||
this._ignoreErrors | ||
? (err, result) => { | ||
if (err) { | ||
if (resolveContext.log) { | ||
resolveContext.log( | ||
`Ignored fatal error while resolving root path:\n${err}` | ||
); | ||
} | ||
return callback(); | ||
} | ||
if (result) return callback(null, result); | ||
callback(); | ||
} | ||
: callback | ||
); | ||
@@ -51,0 +66,0 @@ }); |
{ | ||
"name": "enhanced-resolve", | ||
"version": "4.3.0", | ||
"version": "4.4.0", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "Offers a async require.resolve function. It's highly configurable.", |
@@ -62,2 +62,4 @@ # enhanced-resolve | ||
| modules | ["node_modules"] | A list of directories to resolve modules from, can be absolute path or folder name | | ||
| roots | [] | A list of directories to resolve request starting with `/` from | | ||
| ignoreRootsErrors | false | Ignore fatal errors happening during handling of `roots` (allows to add `roots` without a breaking change) | | ||
| unsafeCache | false | Use this cache object to unsafely cache the successful requests | | ||
@@ -64,0 +66,0 @@ | plugins | [] | A list of additional resolve plugins which should be applied | |
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
92719
3069
125