build: add compile script and binaries
This commit is contained in:
parent
e06b594d66
commit
452e32ef05
|
@ -1,6 +1,9 @@
|
||||||
{
|
{
|
||||||
"tasks": {
|
"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": {
|
"fmt": {
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
|
|
BIN
server.exe
Normal file
BIN
server.exe
Normal file
Binary file not shown.
|
@ -2,6 +2,9 @@ import { bundle } from 'emit'
|
||||||
import ssr from 'preact-render-to-string'
|
import ssr from 'preact-render-to-string'
|
||||||
import denoConfig from './deno.json' with { type: 'json' }
|
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
|
//Compile and bundle client script to js
|
||||||
const script = await bundle('./script.tsx', {
|
const script = await bundle('./script.tsx', {
|
||||||
minify: true,
|
minify: true,
|
||||||
|
|
Loading…
Reference in a new issue