unjs / unbuild

📦 A unified JavaScript build system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`main` property definition is missing in `package.json`

deleonio opened this issue · comments

Environment

node

Reproduction

use knip

Describe the bug

pnpm unused

> power-flow@0.0.0 unused /project
> knip

Analyzing workspace ....
Error loading /project/build.config.ts
Reason: No "exports" main defined in /project/node_modules/unbuild/package.json
 ELIFECYCLE  Command failed with exit code 2.

Additional context

No response

Logs

In the `package.json` is missing, the `main` property definition.

Thanks for the issue. But at least for Node.js, this field is optional. So while it is something we can do to just fix knip, unless there is no reason to, I guess it is probably best that this tool fixes this to properly support exports as only field. (https://nodejs.org/api/packages.html#main-entry-point-export)