deno_emit icon indicating copy to clipboard operation
deno_emit copied to clipboard

feature request: output typescript

Open scarf005 opened this issue 2 years ago • 0 comments

Summary

I think it would be useful to

  • allow emit to output typescript file with its import map resolved
  • allow bundle to merge multiple typescript files into single typescript file

Use cases

Resolving import maps

{
  "imports": {
    "$std/": "https://deno.land/[email protected]/"
  }
}

it's not possible to use import map in library as it cannot use import map. using deps.ts as a walkaround is possible but requires many manual work to manage properly. it would be very convenient to be able to transform

import "$std/collections/mod.ts"

into

import "https://deno.land/[email protected]/collections/mod.ts"

using import map, then the transpiled output could be released into registry without issues.

External Tool Limitations

bundle() strips away all type information, which makes it not possible to run tools relying on typescript AST. This could be problematic due to same reason as above (import map), and tsc cannot resolving deno's HTTP based imports.

scarf005 avatar Nov 15 '23 07:11 scarf005