-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
51 lines (47 loc) · 912 Bytes
/
vite.config.js
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import postcss from './postcss.config.js'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import Icons from 'unplugin-icons/vite'
import path from 'path'
/**
* @return {import('vite').ProxyOptions}
*/
const singleProxy = (path, port) => ({
target: 'http://localhost:' + port,
changeOrigin: true,
rewrite: (url) => url.replace(new RegExp(`^/${path}`), ''),
})
/**
* @type {import('vite').UserConfig}
*/
const config = {
plugins: [
svelte(),
Icons({
compiler: 'svelte',
}),
],
css: { postcss },
resolve: {
alias: {
src: path.resolve(__dirname, './src'),
},
},
esbuild: {
include: ['js', 'svelte'],
},
clearScreen: false,
server: {
port: 8080,
proxy: {
'/packs': singleProxy('packs', 8081),
'/assets': singleProxy('assets', 8082),
},
},
build: {
sourcemap: true,
minify: true,
outDir: 'build',
},
base: '/minecraft-tweaks/',
}
export default config