absolute-module-mapper-plugin
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -0,1 +1,5 @@ | ||
## [1.3.1](https://github.com/imcuttle/absolute-module-mapper-plugin/compare/v1.3.0...v1.3.1) (2020-02-18) | ||
# [1.3.0](https://github.com/imcuttle/absolute-module-mapper-plugin/compare/v1.2.4...v1.3.0) (2020-02-16) | ||
@@ -2,0 +6,0 @@ |
12
index.js
@@ -100,2 +100,6 @@ /** | ||
get name() { | ||
return this.constructor.displayName || this.constructor.name | ||
} | ||
apply(resolver) { | ||
@@ -105,3 +109,3 @@ const { mapper, requestMapper, include, exclude, root, silent } = this.options | ||
if (requestMapper) { | ||
resolver.getHook('parsedResolve').tapAsync('AbsoluteModuleMapperPlugin', (request, resolveContext, callback) => { | ||
resolver.getHook('resolve').tapAsync(this.name, (request, resolveContext, callback) => { | ||
const from = request.context.issuer | ||
@@ -117,3 +121,3 @@ if (from && isMatch(include, from) && !isMatch(exclude, from)) { | ||
old !== request.request && | ||
console.log(this.constructor.name + ' resolveRequest: in %s\n %s => %s', from, old, request.request) | ||
console.log(this.name + ' resolveRequest: in %s\n %s => %s', from, old, request.request) | ||
@@ -131,3 +135,3 @@ callback() | ||
if (mapper) { | ||
resolver.getHook('existingFile').tapAsync('AbsoluteModuleMapperPlugin', (request, resolveContext, callback) => { | ||
resolver.getHook('existingFile').tapAsync(this.name, (request, resolveContext, callback) => { | ||
const from = request.context.issuer | ||
@@ -143,3 +147,3 @@ if (from && isMatch(include, from) && !isMatch(exclude, from)) { | ||
old !== request.path && | ||
console.log(this.constructor.name + ' path: in %s\n %s => %s', from, old, request.path) | ||
console.log(this.name + ' path: in %s\n %s => %s', from, old, request.path) | ||
callback() | ||
@@ -146,0 +150,0 @@ } |
{ | ||
"name": "absolute-module-mapper-plugin", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "description": "The plugin on enhanced-resolver to map module path", |
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
17866
334