add tauri
This commit is contained in:
1 parent
590ec40548
commit
126a3749f9
28 files changed
+6068
-710
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
|
||||
const TAURI_HOST = ''
|
||||
const host = process.env.TAURI_DEV_HOST;
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
@@ -23,7 +23,7 @@ export default defineConfig({
|
||||
],
|
||||
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
|
||||
{ icon: 'github', link: 'https://git.polv.cc/polv/yt2press' }
|
||||
]
|
||||
},
|
||||
markdown: {
|
||||
@@ -34,6 +34,16 @@ export default defineConfig({
|
||||
vite: {
|
||||
clearScreen: false,
|
||||
server: {
|
||||
// make sure this port matches the devUrl port in tauri.conf.json file
|
||||
port: 5173,
|
||||
// Tauri expects a fixed port, fail if that port is not available
|
||||
strictPort: true,
|
||||
// if the host Tauri is expecting is set, use it
|
||||
host: host || false,
|
||||
watch: {
|
||||
// tell vite to ignore watching `src-tauri`
|
||||
ignored: ['**/src-tauri/**'],
|
||||
},
|
||||
proxy: {
|
||||
'/socket': {
|
||||
target: 'ws://localhost:8080',
|
||||
@@ -42,5 +52,18 @@ export default defineConfig({
|
||||
}
|
||||
},
|
||||
},
|
||||
// Env variables starting with the item of `envPrefix` will be exposed in tauri's source code through `import.meta.env`.
|
||||
envPrefix: ['VITE_', 'TAURI_ENV_*'],
|
||||
build: {
|
||||
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
|
||||
target:
|
||||
process.env.TAURI_ENV_PLATFORM == 'windows'
|
||||
? 'chrome105'
|
||||
: 'safari13',
|
||||
// don't minify for debug builds
|
||||
minify: !process.env.TAURI_ENV_DEBUG ? 'esbuild' : false,
|
||||
// produce sourcemaps for debug builds
|
||||
sourcemap: !!process.env.TAURI_ENV_DEBUG,
|
||||
},
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user