We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee08e7c commit 65d88f3Copy full SHA for 65d88f3
lib/resolve-exports.js
@@ -58,7 +58,7 @@ if (typeof String.prototype.startsWith === 'function') {
58
function resolveExportsTarget(packagePath, parent, key, target, subpath, env) {
59
if (typeof target === 'string') {
60
var resolvedTarget = path.resolve(packagePath, target);
61
- if (!(/^\.\//).test(target) || resolvedTarget.indexOf('/node_modules/', packagePath.length - 1) !== -1 || !startsWith(resolvedTarget, packagePath)) {
+ if (!(/^\.\//).test(target) || resolvedTarget.indexOf(path.sep + 'node_modules' + path.sep, packagePath.length - 1) !== -1 || !startsWith(resolvedTarget, packagePath)) {
62
throw makeError('ERR_INVALID_PACKAGE_TARGET', 'Invalid "exports" target ' + JSON.stringify(target)
63
+ ' defined for ' + key + ' in ' + packagePath + path.sep + 'package.json imported from ' + parent + '.');
64
}
0 commit comments