Skip to main content
Module

x/ts_serve/mod.ts>serveDirWithTs

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

This can be used in the same way as the serveDir function of the standard library, but if the file is TypeScript, it will be rewritten to JavaScript.

import { serve } from "https://deno.land/std@0.177.0/http/mod.ts";
import { serveDirWithTs, fourceInstantiateWasm } from "https://deno.land/x/ts_serve@v1.4.4/mod.ts";

fourceInstantiateWasm();
serve((request) => serveDirWithTs(request));

Parameters

request: Request
optional
options: ServeDirOptions