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

fix: ignore single-import from exports map #1063

Merged
merged 2 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions src/check-project/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ export function sortExportsMap (obj) {

for (const key of Object.keys(sorted)) {
const entry = sorted[key]

// ignore case where obj has string props, e.g. `"exports": { "import": "./src/index.js" }`
// as we have already merged `"exports": { ".": { "import": "./src/index.js" } }`
if (typeof entry === 'string') {
continue
}

let types = entry.types

if (!types) {
Expand Down
4 changes: 4 additions & 0 deletions src/cmds/check-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ export default {
*/
async handler (argv) {
await checkProjectCmd.run(argv)
.catch(err => {
console.error(err) // eslint-disable-line no-console
process.exit(1)
})
}
}