Hacker News new | ask | show | jobs
by deepstack 1558 days ago
thanks for posting this. Much needed. When you said: > The process of reconciliation has been slow and painful, cue ESM modules.

I too have run into the similar issues when trying to use JS isomorphically. Especially in combination with typescript. Just wonder how Deno is addressing this? For example: when es import for module server side, in typescript it is ok to omit the file extension, (in typescript development mode it is expecting .ts files), however that breaks when the same code is run on the client side or production mode when it is tsc. How is Deno dealing with this issue? Does Deno just compile all the code to work in broser, serverside typescript all together?

1 comments

Yes, TS code is compiled to run in browsers. You can compile and bundle using `deno bundle` if your project is developed in Deno. Since I'm using Deno for library development, I use the `dnt`[1] tool to compile them into ESM modules later consumed by esbuild in my Node-based projects/toolchains.

[1] https://github.com/denoland/dnt