Replies: 2 comments
-
I've found a solution on antfu's blog but it's still problematic when running tests using jest (ts-jest):
I have tried this in my tsconfig.json: {
"compilerOptions": {
"module": "ES2022", // tried NodeNext too
"moduleResolution": "Node"
},
} But still no success, a similar question has also been asked on SO: |
Beta Was this translation helpful? Give feedback.
-
Whichever you use, they will be properly escaped as long as you add the |
Beta Was this translation helpful? Give feedback.
-
In Node, MJS has
url.fileURLToPath(import.meta.url)
and CJS has__dirname
, so what should I use for TypeScript?I'm sort of using *both* module formats right now, because I'm using tsup to convert to both formats, so there must be something that translates to both of them? Or maybe I should use only one of them, in that case, is there a preference? Thank you in advance 🙏
Beta Was this translation helpful? Give feedback.
All reactions