forked from cgwire/kitsu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
51 lines (50 loc) · 1.11 KB
/
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 { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue2'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
build: {
minify: true,
sourcemap: true
},
resolve: {
vue: 'vue/dist/vue.esm.js',
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
alias: [
{
find: '@',
replacement: path.resolve(__dirname, 'src')
}
]
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "@/variables.scss";`
}
}
},
server: {
host: '127.0.0.1',
port: 8080,
proxy: {
'/api': {
target: process.env.KITSU_API_TARGET || 'http://127.0.0.1:5000',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '')
},
'/socket.io': {
target: process.env.KITSU_EVENT_TARGET || 'http://127.0.0.1:5001',
ws: true
}
}
},
test: {
globals: true,
threads: false,
environment: 'jsdom',
setupFiles: ['vitest-localstorage-mock', 'tests/unit.setup.js'],
mockReset: false
}
})