Open kasbah opened 1 year ago
Does this allow the package to be used from a CommonJS project (that is, with require()
under the hood)? That is a requirement for now.
I believe only if you use dynamic import
. I read your answer on #5 as you dropping support for Commonjs but I guess it's still supported but only with a .default
?
const AwaitLock = require('await-lock').default
The main use case I care about for this package right now is that it works in a CommonJS environment running JS that has been compiled from TS (or another compiler like esbuild) with esModuleInterop enabled. So, require()
needs to work without dynamic import()
.
Fair enough, I just can't figure out how to actually use it from TS. If I set target
to ES5 it complains about the #private
identifiers (more details). Do you just ignore those compilation errors?
Thanks for this lib and all your responses by the way!
I use a preset like @tsconfig/node18/tsconfig.json
in the project's tsconfig.json, including the preset's settings for module resolution.
That also doesn't work for me unfortunately but I won't drag you further into the module resolution tarpit. I'll likely just vendor your lib or create a fork.
fixes #32