Below is an unordered list of rules used by
If there are no entrypoints specified, e.g.
exports, it's assumed that the root
index.js is loaded by default. If the file has an invalid
format, the error is reported.
If the file has an invalid format through explicit entrypoints, the error is reported.
If the file has an invalid format through explicit entrypoints, and the
file has an explicit extension too, e.g.
.cjs, the error is reported.
The specified file does not exist.
module entry should be ESM only.
If the package has a
module entry without a
exports entry, suggest using
main entrypoint is an ES module, you can likely
remove it as environments that supports so also supports
exports, which should be used instead, and the
main can then be removed alongside too.
exports entry contains glob paths, but it doesn't
match any files, suggest the issue.
exports entry should not have globs defined with
trailing slashes. It is
and should use
types condition to be the first.
default condition to be the last.