-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
40 lines (38 loc) · 1.43 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
import * as path from 'path'
import { internalIpV4 } from 'internal-ip'
import { defineConfig } from 'vite'
import solidPlugin from 'vite-plugin-solid'
// https://vitejs.dev/config/
export default defineConfig(async () => {
const host = await internalIpV4()
/** @type {import('vite').UserConfig} */
const config = {
resolve: {
alias: {
'@interfaces': path.resolve(__dirname, './src/interfaces'),
'@components': path.resolve(__dirname, './src/components'),
'@redux': path.resolve(__dirname, './src/redux'),
'@pages': path.resolve(__dirname, './src/pages'),
'@styles': path.resolve(__dirname, './src/styles'),
'@config': path.resolve(__dirname, './src/config'),
'@src': path.resolve(__dirname, './src'),
'@assets': path.resolve(__dirname, './assets'),
'@hooks': path.resolve(__dirname, './src/utils/hooks'),
'@static': path.resolve(__dirname, './src/static'),
'@utils': path.resolve(__dirname, './src/utils'),
},
},
plugins: [solidPlugin()],
server: {
host: '0.0.0.0', // listen on all addresses
port: 3000,
strictPort: true,
hmr: {
protocol: 'ws',
host,
port: 5183,
},
},
}
return config
})