-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
55 lines (52 loc) · 1.58 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
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vite';
type ViteConfig = {
mode: string;
command: string;
};
// https://vitejs.dev/config/
export default ({ mode }: ViteConfig) => {
const generateScopedName = mode === 'production' ? '[hash:base64:3]' : '[local]_[hash:base64:3]';
return defineConfig({
plugins: [
react({
babel: {
babelrc: true,
},
}),
],
server: {
port: 3000,
host: '0.0.0.0',
open: true,
},
resolve: {
alias: {
'#assets': path.resolve(__dirname, './src/app/assets'),
'#components': path.resolve(__dirname, './src/app/components'),
'#constants': path.resolve(__dirname, './src/app/constants'),
'#hooks': path.resolve(__dirname, './src/app/hooks'),
'#models': path.resolve(__dirname, './src/app/models'),
'#navigation': path.resolve(__dirname, './src/app/navigation'),
'#redux': path.resolve(__dirname, './src/app/redux'),
'#pages': path.resolve(__dirname, './src/app/pages'),
'#services': path.resolve(__dirname, './src/app/services'),
'#themes': path.resolve(__dirname, './src/app/themes'),
'#types': path.resolve(__dirname, './src/app/types'),
'#utils': path.resolve(__dirname, './src/app/utils'),
},
},
css: {
modules: {
localsConvention: 'camelCaseOnly',
generateScopedName,
},
preprocessorOptions: {
scss: {
additionalData: "@use './src/app/styles' as *;",
},
},
},
});
};