5 ms·
This also makes using TypeScript libraries that weren’t authored specifically for Deno nontrivial. One solution is to use an import map on the Deno side to map
by schemescape 5y ago
This also makes using TypeScript libraries that weren’t authored specifically for Deno nontrivial.
One solution is to use an import map on the Deno side to map your extensionless imports to the corresponding files, but this only works when you control the Deno command line arguments (so not for libraries you plan to publish for others to use).
It’s unfortunate because, other than this huge problem, Deno is the best TypeScript runtime I’ve found.
- ignoramous 5y ago> Deno is the best TypeScript runtime I’ve found. I may be nitpicking here, but Deno isn't a typescript runtime, is it? In the usual case, does it not transpile typescript to JavaScript and run the code from there?
- pseudosavant 5y agoYes, but I'd argue that is an implementation detail. You can directly run a TypeScript file like this `deno run helloWorld.ts`. Is Node really a JavaScript runtime? V8 converts the JS to an AST. Would that make Node an `AST runtime`?
- fivea 5y ago> Yes, but I'd argue that is an implementation detail. You can directly run a TypeScript file like this `deno run helloWorld.ts`. Why yes, you can run directly Typescript code in Node (well, at least just as direct as Deno, as it transpiles TS to JS) with the likes of ts-node. https://www.npmjs.com/package/ts-node https://www.npmjs.com/package/ts-node
- nitsky 5y agoThen it would be fair to say ts-node is a typescript runtime, while node is a javascript runtime.
- brundolf 5y agoAnother good workaround is to use something like JSPM, which bundles up the NPM library with all its dependencies into an ES module, ready to be consumed (and even loaded remotely!) by Deno