-
-
Notifications
You must be signed in to change notification settings - Fork 106
/
vite.config.js
47 lines (46 loc) · 1.06 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue({})],
build: {
sourcemap: true
},
resolve: {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
alias: {
'@': path.resolve(__dirname, 'src/'),
vue: 'vue/dist/vue.esm-bundler.js'
}
},
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
}
})