Skip to content

Commit 7c3c341

Browse files
committed
delete buggy jsx
1 parent 2c53bf0 commit 7c3c341

File tree

3 files changed

+0
-59
lines changed

3 files changed

+0
-59
lines changed

mod.ts

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,6 @@ import {
44
import { contentType } from "https://deno.land/std@0.206.0/media_types/content_type.ts"
55
import { transpile } from "./src/transpile.ts"
66

7-
import {
8-
relative,
9-
join,
10-
normalize,
11-
fromFileUrl,
12-
} from "https://deno.land/std@0.224.0/path/mod.ts"
13-
14-
const cwd = Deno.cwd()
15-
const scriptDir = join(fromFileUrl(import.meta.url), "..")
16-
console.log({cwd, scriptDir})
17-
const relPath = normalize(relative(scriptDir, cwd))
18-
19-
const relImport = async (path: string) => {
20-
const adjustedPath = join(relPath, path).replaceAll("\\", "/")
21-
22-
return await import("./" + adjustedPath)
23-
}
24-
257
const getFile = async (filepath: string) =>
268
await Deno.open(
279
filepath,
@@ -84,38 +66,8 @@ async (filepath: string, url: URL) => {
8466
}
8567
}
8668

87-
const htmlPreset =
88-
(body: string) => `<!doctype html><html>
89-
<head>
90-
<meta charset="UTF-8">
91-
</head>
92-
<body>
93-
${body}
94-
</body>
95-
</html>`
96-
97-
let cacheBuster = 0
98-
9969
Deno.serve(handler({
10070
ts: handleTs,
101-
async tsx(filepath, url, req) {
102-
const accept = req.headers.get("accept") || ""
103-
104-
if (accept.includes("text/html")) {
105-
return new Response(
106-
htmlPreset(
107-
(await relImport(
108-
filepath + "#" + cacheBuster++
109-
)).default
110-
),
111-
{ headers: {
112-
"content-type": "text/html",
113-
}}
114-
)
115-
} else {
116-
return await handleTs(filepath, url)
117-
}
118-
}
11971
}))
12072

12173
const appendParam =

test/tsx/deno.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/tsx/index.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)