aboutsummaryrefslogtreecommitdiffstats
path: root/vite.config.js
blob: e0f3671ffdd7577a30e4daa4e477e4679881e446 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { sveltekit } from "@sveltejs/kit/vite";
import Icons from "unplugin-icons/vite";

import path from "path";

/** @type {import('vite').UserConfig} */
const config = {
	plugins: [sveltekit(), Icons({ compiler: "svelte" })],
	resolve: {
		alias: {
			$comp: path.resolve("src/components"),
		},
	},
	server: {
		proxy:
			process.env.NODE_ENV === "development"
				? {
						"/api/": {
							target: "http://localhost:3119",
							rewrite: (path) => path.replace(/^\/api\//, ""),
						},
				  }
				: undefined,
	},
};

export default config;