-
-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathvite.config.js
More file actions
66 lines (65 loc) · 1.57 KB
/
vite.config.js
File metadata and controls
66 lines (65 loc) · 1.57 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: tag => ['drag', 'drop', 'model-viewer'].includes(tag)
}
}
})
],
build: {
sourcemap: true,
target: 'es2020'
},
resolve: {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
alias: {
'@': `${import.meta.dirname}/src/`,
vue: 'vue/dist/vue.esm-bundler.js',
'fabricjs-psbrush': `${import.meta.dirname}/node_modules/fabricjs-psbrush/dist/index.mjs`,
moment: `${import.meta.dirname}/node_modules/moment/min/moment-with-locales.js`
}
},
css: {
devSourcemap: true,
preprocessorOptions: {
scss: {
additionalData: `@use "@/variables.scss" as *;`,
api: 'modern'
}
}
},
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',
changeOrigin: true,
ws: true
}
}
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['vitest-localstorage-mock', 'tests/unit.setup.js'],
mockReset: false,
isolate: true,
deps: {
optimizer: {
client: {
include: ['vue', 'vuex', 'vue-router', '@vue/test-utils']
}
}
}
}
})