unjs / unbuild

📦 A unified JavaScript build system
MIT License
2.29k stars 89 forks source link

how to relative tsconfig when import a module that belongs to `exports` #421

Open buquan opened 1 month ago

buquan commented 1 month ago

Environment

node 20 ts5+

Reproduction

https://stackblitz.com/edit/vitejs-vite-zbxug8?file=src%2Findex.ts,package.json,src%2Fadd.ts,src%2Fsub.ts,build.config.ts,tsconfig.json

Describe the bug

ts error add is not a module when import * as addObj from './add';

Additional context

No response

Logs

No response

prisis commented 1 month ago

Sorry, this has nothing to do with unbuild, please check https://stackoverflow.com/questions/32805559/typescript-es6-import-module-file-is-not-a-module-error