-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
63 lines (57 loc) · 1.48 KB
/
vite.config.ts
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
import basicSsl from '@vitejs/plugin-basic-ssl';
import legacy from '@vitejs/plugin-legacy';
import react from '@vitejs/plugin-react';
import * as path from 'node:path';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
jsxRuntime: 'automatic',
fastRefresh: true,
// include: '**/*.tsx',
}),
legacy({
targets: ['defaults', 'not IE 11'],
}),
basicSsl(),
],
json: {
stringify: true,
},
build: {
outDir: './dist',
sourcemap: true,
},
css: {
modules: {
localsConvention: 'camelCase',
},
preprocessorOptions: {
css: {
additionalData: `@import "./node_modules/@vkontakte/vkui-tokens";`,
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src/'),
'@routes': path.resolve(__dirname, './src/routes'),
'@components': path.resolve(__dirname, './src/components'),
'@pages': path.resolve(__dirname, './src/pages'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@services': path.resolve(__dirname, './src/services'),
'@config': path.resolve(__dirname, './src/config'),
'@store': path.resolve(__dirname, './src/store'),
'@models': path.resolve(__dirname, './src/models'),
'@api': path.resolve(__dirname, './src/api'),
},
},
server: {
https: true,
host: true,
cors: true,
// hmr: { clientPort: 5174, port: 5174 },
},
clearScreen: true,
});