mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 14:55:43 +00:00
build(restructure): wire @/ alias into vite dev/build resolver
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
/// <reference types="node" />
|
/// <reference types="node" />
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
|
import path from "node:path";
|
||||||
|
|
||||||
const host = process.env.TAURI_DEV_HOST;
|
const host = process.env.TAURI_DEV_HOST;
|
||||||
|
|
||||||
@@ -16,6 +17,14 @@ const optimizeDepsEntries = [
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
// `@/* → src/*` — must mirror vitest.config.ts + tsconfig paths. The dev and
|
||||||
|
// build resolvers differ: tsconfig `paths` covers tsc + `vite build`, but
|
||||||
|
// `vite dev` needs this explicit alias or `@/` imports fail to resolve.
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": path.resolve(__dirname, "./src"),
|
||||||
|
},
|
||||||
|
},
|
||||||
clearScreen: false,
|
clearScreen: false,
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
entries: optimizeDepsEntries,
|
entries: optimizeDepsEntries,
|
||||||
|
|||||||
Reference in New Issue
Block a user