main and module fields

Older package.json fields: main names the CommonJS entry file and module (a bundler convention) names an ECMAScript module version.

In more detail

They cannot hide internal files or give separate type files per format. Packages still include them for old tools, but the exports field takes precedence where supported.

Related terms

Taught in

References