-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
88 lines (82 loc) · 2.24 KB
/
vite.config.ts
File metadata and controls
88 lines (82 loc) · 2.24 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// vite.config.ts
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
import AutoImport from 'unplugin-auto-import/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vite'
import VueDevTools from 'vite-plugin-vue-devtools'
import { viteStaticCopy } from 'vite-plugin-static-copy'
import pkg from './package.json'
export default defineConfig({
define: {
'import.meta.env.VITE_APP_VERSION': JSON.stringify(pkg.version),
},
plugins: [
vue({
template: {
compilerOptions: {
// <piece> - кастомный элемент
isCustomElement: (tag) => tag.startsWith('piece'),
},
},
}),
AutoImport({
imports: [
'vue',
{
'naive-ui': ['useDialog', 'useMessage', 'useNotification', 'useLoadingBar'],
},
],
}),
Components({
resolvers: [NaiveUiResolver()],
}),
viteStaticCopy({
targets: [
{
src: 'node_modules/@lichess-org/stockfish-web/sf_18_smallnet.js',
dest: 'stockfish/nnue',
},
{
src: 'node_modules/@lichess-org/stockfish-web/sf_18_smallnet.wasm',
dest: 'stockfish/nnue',
},
{
src: 'node_modules/stockfish/src/stockfish-17.1-lite-single-03e3232.js',
dest: 'stockfish/single',
},
{
src: 'node_modules/stockfish/src/stockfish-17.1-lite-single-03e3232.wasm',
dest: 'stockfish/single',
},
],
}),
// 🔥 Включаем Vue Devtools
VueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
},
build: {
rollupOptions: {
output: {
manualChunks: {
'naive-ui': ['naive-ui'],
'echarts': ['echarts', 'vue-echarts'],
'chess-logic': ['@lichess-org/chessground', 'chessops'],
'vendor': ['vue', 'vue-router', 'pinia', 'vue-i18n'],
},
},
},
chunkSizeWarningLimit: 1000,
},
})