denoland / deno_emit

Transpile and bundle JavaScript and TypeScript under Deno and Deno Deploy
https://jsr.io/@deno/emit
MIT License
223 stars 23 forks source link

feature request: output typescript #147

Open scarf005 opened 1 year ago

scarf005 commented 1 year ago

Summary

I think it would be useful to

Use cases

Resolving import maps

{
  "imports": {
    "$std/": "https://deno.land/std@0.206.0/"
  }
}

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/std@0.206.0/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.