Open ihmpavel opened 2 years ago
tsup won't bundle import(realPath)
cause realPath
is unknown at build time, you should manually read the file and JSON.parse
it.
In v5 import()
is compiled to require()
, (the default target is node12
) so require('xxx.json')
worked, but now the target is node14
, so import()
is left as is, import('xxx.json')
in Node.js runtime is not a thing.
Hi, thank you for the library.
I came into an issue while updating to version 6.
Code (
index.ts
)Working fine
5.x
(latest 5.12.9)tsup src/index.ts --format esm,cjs --dts
With version
6.x
after reading release notes I though, that I need to add--shims
(not mentioned in docs, only on release page) to build command (because we are using__dirname
). Unfortunately that is not the case.Does not work fine
6.x
(any version)tsup src/index.ts --shims --format esm,cjs --dts
Issue on version
6.x
Is there any way of fixing this?
Upvote & Fund