-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.js
More file actions
48 lines (47 loc) · 1.14 KB
/
vite.config.js
File metadata and controls
48 lines (47 loc) · 1.14 KB
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
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'url';
import { defineConfig } from 'vite';
import vueDevTools from 'vite-plugin-vue-devtools';
export default defineConfig(({ mode }) => {
return {
plugins: [vue(), vueDevTools()],
server: {
port: 8080,
proxy: {
'^/devapi': {
target: 'http://localhost:3000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/devapi/, ''),
},
'/vatusa': {
target: 'https://api.vatusa.net/v2',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/vatusa/, '/'),
},
},
},
resolve: {
alias: [
{
find: '@',
replacement: fileURLToPath(new URL('./src', import.meta.url)),
},
],
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "@/assets/css/styles" as *;`,
silenceDeprecations: ['import', 'slash-div', 'color-functions', 'global-builtin'],
},
},
},
define:
mode === 'development'
? {
'window.env.VITE_FOLDER_PREFIX': JSON.stringify(process.env.VITE_FOLDER_PREFIX),
'window.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}
: {},
};
});