Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deno transpile subcommand #28069

Open
bartlomieju opened this issue Feb 11, 2025 · 1 comment
Open

Add deno transpile subcommand #28069

bartlomieju opened this issue Feb 11, 2025 · 1 comment

Comments

@bartlomieju
Copy link
Member

Add deno transpile subcommand to transpile TypeScript to JavaScript and (maybe) generate type declaration files.

It should NOT translate Deno APIs to Node.js APIs, essentially a dumb transpilation thing.

deno transpile --out=dist/ --declaration ./webpage

Some thoughts about what should be supported:

  • Take a bunch of .ts files (a directory, or a glob) and spit out a directory of .js files + .d.ts files
  • Rewrite .ts extensions in import statements into .js extensions, because TSC refuses to transpile/generate declaration files if there are .ts extensions. NOTE: this is something TSC explicitly doesn’t do (ie. rewrite file extensions)
  • Add a flag to set transpilation target (ECMA version) or respect compilerOptions.target from deno.json
  • Add a flag to specify an output directory (—out), if not passed use out/ maybe?
  • Add a flag to generate declarations (—declarations)
  • Add a flag to generate source maps (—sourcemap),
  • Blindly rewrite .ts , .jsx and .tsx imports to .js, but don’t rewrite .d.ts imports (???)
@BlackAsLight
Copy link

This seems like a weaker version of what deno bundle did

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants