aboutsummaryrefslogtreecommitdiffstats
path: root/vite.config.js
blob: edb1caae26b5695512b1aea96a94f4ab1031986d (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
import { sveltekit } from '@sveltejs/kit/vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

import wasm from 'vite-plugin-wasm';
import topLevelAwait from 'vite-plugin-top-level-await';
import path from 'path';

/** @type {import('vite').UserConfig} */
const config = {
	plugins: [nodePolyfills(), sveltekit(), topLevelAwait(), wasm()],
	resolve: {
		alias: {
			$comp: path.resolve('src/components/index.js')
		}
	},
	server: {
		proxy: {
			'/api': {
				target: 'http://localhost:3119',
				rewrite: (path) => path.replace(/^\/api/, '')
			}
		}
	}
};

export default config;