Closed JounQin closed 2 years ago
unplugin-auto-import
has a broken export map. Their export map defines all their entrypoints as cjs only - they need a nested types
entry for both the require
and import
conditions that points a different files with the correct module format. This is exactly the format confusion issue that arises when you use an incomplete export map.
Instead of
"./vite": {
"types": "./dist/vite.d.ts",
"require": "./dist/vite.js",
"import": "./dist/vite.mjs"
},
it should be
"./vite": {
"require": { "types": "./dist/vite.d.ts", "default": "./dist/vite.js" },
"import": { "types": "./dist/vite.d.mts", "default": "./dist/vite.mjs" }
},
and, naturally, vite.d.mts
needs to exist (it can just reexport stuff from vite.d.ts
, though!).
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
reproduction https://github.com/un-ts/lib-boilerplate/blob/main/vitest.config.ts#L8
💻 Code
🙁 Actual behavior
🙂 Expected behavior
No error