Skip to main content
Module

x/ts_serve/mod.ts>transpile

Transpile TypeScript on the fly and deliver it from your server as ES Modules.
Latest
function transpile
Re-export
import { transpile } from "https://deno.land/x/ts_serve@v1.4.4/mod.ts";

Transpile the given TypeScript code into JavaScript code.

Parameters

content: string

TypeScript code

targetUrl: URL

The URL that will be used for the source map.

mediaType: MediaType

Indicates whether the source code is TypeScript, JSX or TSX. If this argument is not passed, the file type is guessed using the extension of the URL passed as the second argument.