diff --git a/deno.json b/deno.json index 9efe5e1..aab9784 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,9 @@ { "tasks": { - "serve": "deno run --allow-env --allow-read --allow-write --allow-net --watch=./client,./script.tsx,./style.css ./server.tsx" + "serve": "deno run --allow-env --allow-read --allow-write --allow-net --watch=./client,./script.tsx,./style.css ./server.tsx", + "compile": "deno task compile:win & deno task compile:lin", + "compile:win": "deno compile --allow-env --allow-read --allow-write --allow-net --target=x86_64-pc-windows-msvc ./server.tsx", + "compile:lin": "deno compile --allow-env --allow-read --allow-write --allow-net --target=x86_64-unknown-linux-gnu ./server.tsx" }, "fmt": { "singleQuote": true, diff --git a/server b/server new file mode 100644 index 0000000..79b9728 Binary files /dev/null and b/server differ diff --git a/server.exe b/server.exe new file mode 100644 index 0000000..8643b3a Binary files /dev/null and b/server.exe differ diff --git a/server.tsx b/server.tsx index 9813c85..edfea17 100644 --- a/server.tsx +++ b/server.tsx @@ -2,6 +2,9 @@ import { bundle } from 'emit' import ssr from 'preact-render-to-string' import denoConfig from './deno.json' with { type: 'json' } +//only for deno compile (https://github.com/denoland/fresh/issues/785) +import * as React from 'preact/compat' + //Compile and bundle client script to js const script = await bundle('./script.tsx', { minify: true,