fix(javascript): resolve root package exports arrays (#1046)
Co-authored-by: N0zoM1z0 <1705004398@qq.com>
This commit is contained in:
@@ -25,6 +25,26 @@ const cases: readonly {
|
||||
metadata: { main: "actual.cjs" },
|
||||
index: false,
|
||||
},
|
||||
{
|
||||
name: "top-level exports array",
|
||||
metadata: { exports: ["./actual.cjs"] },
|
||||
index: true,
|
||||
},
|
||||
{
|
||||
name: "root subpath exports array",
|
||||
metadata: { exports: { ".": ["./actual.cjs"] } },
|
||||
index: true,
|
||||
},
|
||||
{
|
||||
name: "exports array skips invalid and unmatched entries",
|
||||
metadata: { exports: [42, { browser: "./browser.js" }, "./actual.cjs"] },
|
||||
index: true,
|
||||
},
|
||||
{
|
||||
name: "nested root exports array",
|
||||
metadata: { exports: { ".": [[null, { require: "./actual.cjs" }]] } },
|
||||
index: true,
|
||||
},
|
||||
{ name: "index fallback", metadata: {}, index: true },
|
||||
{
|
||||
name: "missing legacy main fallback",
|
||||
|
||||
Reference in New Issue
Block a user