This commit is contained in:
Untone 2024-07-10 20:58:09 +03:00
parent 4be03d9b7f
commit a9bfcc1e61
5 changed files with 18 additions and 15 deletions

View File

@ -1,9 +1,11 @@
import { ViteCustomizableConfig, defineConfig } from "@solidjs/start/config" import { ViteCustomizableConfig, defineConfig } from "@solidjs/start/config"
import { internalIpV4 } from "internal-ip" import { internalIpV4 } from "internal-ip"
import { readFileSync } from 'fs' // biome-ignore lint/correctness/noNodejsModules: build context
import { readFileSync } from 'node:fs'
const mobile = !!/android|ios/.exec(process.env.TAURI_ENV_PLATFORM) const mobile = !!/android|ios/.exec(process.env.TAURI_ENV_PLATFORM)
let key = '', cert = '' let key = ''
let cert = ''
try { try {
key = readFileSync("./localhost-key.pem").toString() key = readFileSync("./localhost-key.pem").toString()
cert = readFileSync("./localhost.pem").toString() cert = readFileSync("./localhost.pem").toString()

View File

@ -8,7 +8,8 @@
"dev": "vinxi dev", "dev": "vinxi dev",
"build": "vinxi build", "build": "vinxi build",
"serve": "vinxi preview", "serve": "vinxi preview",
"tauri": "tauri" "tauri": "tauri",
"fix": "npx @biomejs/biome check src/. --fix"
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@ -1,23 +1,23 @@
import { createSignal } from "solid-js"; import { createSignal } from 'solid-js'
import "./app.css"; import './app.css'
export default function App() { export default function App() {
const [count, setCount] = createSignal(0); const [count, setCount] = createSignal(0)
return ( return (
<main> <main>
<h1>Hello world!</h1> <h1>Hello world!</h1>
<img src='tauri.svg' /> <img src="tauri.svg" />
<button class="increment" onClick={() => setCount(count() + 1)} type="button"> <button class="increment" onClick={() => setCount(count() + 1)} type="button">
Clicks: {count()} Clicks: {count()}
</button> </button>
<p> <p>
Visit{" "} Visit{' '}
<a href="https://start.solidjs.com" target="_blank"> <a href="https://start.solidjs.com" target="_blank" rel="noreferrer">
start.solidjs.com start.solidjs.com
</a>{" "} </a>{' '}
to learn how to build SolidStart apps. to learn how to build SolidStart apps.
</p> </p>
</main> </main>
); )
} }

View File

@ -1,4 +1,4 @@
// @refresh reload // @refresh reload
import { mount, StartClient } from "@solidjs/start/client"; import { StartClient, mount } from '@solidjs/start/client'
mount(() => <StartClient />, document.getElementById("app")!); mount(() => <StartClient />, document.getElementById('app') || document.body)

View File

@ -1,5 +1,5 @@
// @refresh reload // @refresh reload
import { createHandler, StartServer } from "@solidjs/start/server"; import { StartServer, createHandler } from '@solidjs/start/server'
export default createHandler(() => ( export default createHandler(() => (
<StartServer <StartServer
@ -18,4 +18,4 @@ export default createHandler(() => (
</html> </html>
)} )}
/> />
)); ))