module-alias
Advanced tools
Comparing version 2.2.0 to 2.2.1
13
index.js
@@ -30,3 +30,3 @@ 'use strict' | ||
var oldResolveFilename = Module._resolveFilename | ||
Module._resolveFilename = function (request, parentModule, isMain) { | ||
Module._resolveFilename = function (request, parentModule, isMain, options) { | ||
for (var i = moduleAliasNames.length; i-- > 0;) { | ||
@@ -50,3 +50,3 @@ var alias = moduleAliasNames[i] | ||
return oldResolveFilename.call(this, request, parentModule, isMain) | ||
return oldResolveFilename.call(this, request, parentModule, isMain, options) | ||
} | ||
@@ -121,2 +121,11 @@ | ||
removePathHelper(path, require.main.paths) | ||
// Delete from require.cache if the module has been required before. | ||
// This is required for node >= 11 | ||
Object.getOwnPropertyNames(require.cache).forEach(function (name) { | ||
if (name.indexOf(path) !== -1) { | ||
delete require.cache[name] | ||
} | ||
}) | ||
var parent = module.parent | ||
@@ -123,0 +132,0 @@ while (parent && parent !== require.main) { |
{ | ||
"name": "module-alias", | ||
"description": "Create aliases of directories and register custom module paths", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"author": { | ||
@@ -13,3 +13,4 @@ "name": "Nick Gavrilov", | ||
"testonly-watch": "NODE_ENV=test mocha -w test/specs.js", | ||
"lint": "standard" | ||
"lint": "standard", | ||
"lint-test": "npm run lint && npm run test" | ||
}, | ||
@@ -42,5 +43,12 @@ "bugs": { | ||
"hello-world-classic": "ilearnio/hello-world-classic", | ||
"husky": "^3.0.2", | ||
"mocha": "^2.4.5", | ||
"semver": "^6.1.1", | ||
"standard": "^12.0.1" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-push": "npm run lint-test" | ||
} | ||
} | ||
} |
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
13112
177
6