Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module: unflag resolve self #31002

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
retain exports flag
guybedford committed Jan 2, 2020
commit 8ea9b1be0cadf57548f74ac6fa5e009517c36413
3 changes: 3 additions & 0 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
@@ -431,6 +431,9 @@ function resolveBasePath(basePath, exts, isMain, trailingSlash, request) {
}

function trySelf(parentPath, isMain, request) {
if (!experimentalConditionalExports) {
return false;
}
const { data: pkg, path: basePath } = readPackageScope(parentPath) || {};
if (!pkg || 'exports' in pkg === false) return false;
if (typeof pkg.name !== 'string') return false;