mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-24 09:18:37 +02:00
fix(tauri): update tauri to work with vite
This commit is contained in:
@@ -3,9 +3,10 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"identifier": "xyz.learnanything.desktop",
|
"identifier": "xyz.learnanything.desktop",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "https://dev.learn-anything.xyz",
|
"frontendDist": "../web/.output/public",
|
||||||
"devUrl": "http://localhost:3000",
|
"devUrl": "http://localhost:3000",
|
||||||
"beforeDevCommand": "bun dev"
|
"beforeDevCommand": "bun dev",
|
||||||
|
"beforeBuildCommand": "bun web:build"
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"windows": [
|
"windows": [
|
||||||
@@ -24,6 +25,12 @@
|
|||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"targets": "all",
|
"targets": "all",
|
||||||
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"]
|
"icon": [
|
||||||
|
"icons/32x32.png",
|
||||||
|
"icons/128x128.png",
|
||||||
|
"icons/128x128@2x.png",
|
||||||
|
"icons/icon.icns",
|
||||||
|
"icons/icon.ico"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
web/.gitignore
vendored
4
web/.gitignore
vendored
@@ -21,4 +21,6 @@ yarn.lock
|
|||||||
/blob-report/
|
/blob-report/
|
||||||
/playwright/.cache/
|
/playwright/.cache/
|
||||||
|
|
||||||
.ronin
|
.ronin
|
||||||
|
|
||||||
|
app.config.timestamp_*.js
|
||||||
|
|||||||
@@ -1,7 +1,29 @@
|
|||||||
import { defineConfig } from "@tanstack/start/config"
|
import { defineConfig } from "@tanstack/start/config"
|
||||||
import tsConfigPaths from "vite-tsconfig-paths"
|
import tsConfigPaths from "vite-tsconfig-paths"
|
||||||
|
|
||||||
export default defineConfig({
|
const is_tauri = process.env.TAURI_ENV_TARGET_TRIPLE !== undefined;
|
||||||
|
|
||||||
|
let config = is_tauri ? defineConfig({
|
||||||
|
vite: {
|
||||||
|
envPrefix: ['VITE_', 'TAURI_ENV_*'],
|
||||||
|
build: {
|
||||||
|
target:
|
||||||
|
process.env.TAURI_ENV_PLATFORM == 'windows'
|
||||||
|
? 'chrome105'
|
||||||
|
: 'safari13',
|
||||||
|
minify: !process.env.TAURI_ENV_DEBUG ? 'esbuild' : false,
|
||||||
|
sourcemap: !!process.env.TAURI_ENV_DEBUG,
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
tsConfigPaths({
|
||||||
|
projects: ["./tsconfig.json"],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
preset: "static"
|
||||||
|
}
|
||||||
|
}) : defineConfig({
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [
|
plugins: [
|
||||||
tsConfigPaths({
|
tsConfigPaths({
|
||||||
@@ -10,3 +32,5 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export default config;
|
||||||
|
|||||||
Reference in New Issue
Block a user