Skip to content
Merged
Changes from 2 commits
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
8 changes: 7 additions & 1 deletion lib/ExportsFieldPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,15 @@
}

if (paths.length === 0) {
let conditions;
if (this.conditionNames.length == 1) {

Check failure on line 118 in lib/ExportsFieldPlugin.js

View workflow job for this annotation

GitHub Actions / lint

Expected '===' and instead saw '=='

Check failure on line 118 in lib/ExportsFieldPlugin.js

View workflow job for this annotation

GitHub Actions / lint

This `if` statement can be replaced by a ternary expression
conditions = `the condition "${this.conditionNames[0]}"`;
} else {
conditions = `the conditions ${JSON.stringify(this.conditionNames)}`;
}
return callback(
new Error(
`Package path ${remainingRequest} is not exported from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})`,
`"${remainingRequest}" is not exported under ${conditions} from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})`,
),
);
}
Expand Down
Loading