添加意外删除的'vite.config.ts'文件

This commit is contained in:
2026-05-16 01:06:40 +08:00
parent 3158338d0b
commit 29df8ca491
3 changed files with 49 additions and 12 deletions

6
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "nekosonic", "name": "nekosonic",
"version": "0.1.0", "version": "0.3.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "nekosonic", "name": "nekosonic",
"version": "0.1.0", "version": "0.3.0",
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2", "@tauri-apps/api": "^2",
"@tauri-apps/plugin-dialog": "^2.7.1", "@tauri-apps/plugin-dialog": "^2.7.1",
@ -27,7 +27,7 @@
"@types/node": "^25.6.0", "@types/node": "^25.6.0",
"@types/qrcode": "^1.5.6", "@types/qrcode": "^1.5.6",
"@vicons/ionicons5": "^0.13.0", "@vicons/ionicons5": "^0.13.0",
"@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue": "^5.2.4",
"@vueuse/motion": "^3.0.3", "@vueuse/motion": "^3.0.3",
"tailwindcss": "^4.2.4", "tailwindcss": "^4.2.4",
"typescript": "~5.6.2", "typescript": "~5.6.2",

View File

@ -40,13 +40,5 @@
"type": "downloadBootstrapper" "type": "downloadBootstrapper"
} }
} }
},
"plugins": {
"updater": {
"endpoints": [
"https://github.com/atdunbg/Nekosonic-Music/releases/latest/download/latest.json"
],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDM1MDdCMTJCRTE3MUI4N0QKUldSOXVISGhLN0VITmM3ZkJlbjF3UGJrK3h6ellWZ2xSUG03b3d1RWlDeldSWk1nc0pic2J2MVkK"
}
} }
} }

45
vite.config.ts Normal file
View File

@ -0,0 +1,45 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import tailwindcss from "@tailwindcss/vite";
import Icons from "unplugin-icons/vite";
import { fileURLToPath, URL } from "node:url";
// \@ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST;
// https://vite.dev/config/
export default defineConfig(async () => ({
plugins: [
vue(),
tailwindcss(),
Icons({ compiler: "vue3" }),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
//
// 1. prevent Vite from obscuring rust errors
clearScreen: false,
// 2. tauri expects a fixed port, fail if that port is not available
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell Vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
}));