Skip to content

Add main field to package.json#216

Merged
btd merged 1 commit into
btd:masterfrom
romaricpascal:patch-1
Mar 3, 2026
Merged

Add main field to package.json#216
btd merged 1 commit into
btd:masterfrom
romaricpascal:patch-1

Conversation

@romaricpascal
Copy link
Copy Markdown
Contributor

@romaricpascal romaricpascal commented Mar 3, 2026

While Node itself is happy with only an exports field in package.json, it doesn't seem enough for some tooling packages. The lack of main field:

There may also be other tools implementing their own module resolution which won't cope with having only exports. It'd be great if rollup-plugin-visualizer was offering a fallback main field in its package.json, as described in Node's documentation.

The lack of `main` field throws off TypeScript when used with the `node` resolution[^1], as well as eslint-plugin-import's module resolution through the `resolve` package, which does not support ESM yet[^2].

[^1]: https://www.typescriptlang.org/docs/handbook/modules/reference.html#node10-formerly-known-as-node
[^2]: browserify/resolve#222
@btd btd merged commit ba87027 into btd:master Mar 3, 2026
2 checks passed
@btd
Copy link
Copy Markdown
Owner

btd commented Mar 3, 2026

Thank you

@btd
Copy link
Copy Markdown
Owner

btd commented Mar 3, 2026

Released as 7.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants