feat: add resolving alias @ to ./src

This commit is contained in:
zihluwang committed 2025-07-26 00:48:13 +08:00
1 parent 84455906c9
commit 7cdbc4ac85
9 files changed
+63 -158

No files matched your search

+11 -5
View File
@@ -1,13 +1,19 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { fileURLToPath } from "node:url"
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
// @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST;
const host = process.env.TAURI_DEV_HOST
// https://vitejs.dev/config/
export default defineConfig(async () => ({
plugins: [react()],
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
@@ -29,4 +35,4 @@ export default defineConfig(async () => ({
ignored: ["**/src-tauri/**"],
},
},
}));
}))