build: add compile script and binaries

This commit is contained in:
Julien Oculi 2024-01-23 15:13:01 +01:00
parent e06b594d66
commit 452e32ef05
4 changed files with 7 additions and 1 deletions

View file

@ -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,

BIN
server Normal file

Binary file not shown.

BIN
server.exe Normal file

Binary file not shown.

View file

@ -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,