-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
49 lines (47 loc) · 1.13 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
import * as fs from 'fs'
import * as path from 'path'
import svg from '@neodx/svg/vite'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
// https://vitejs.dev/config/
const config = defineConfig({
build: {
sourcemap: true,
},
server: {
port: 3001,
https: {
cert: fs.readFileSync(path.resolve(__dirname, 'ssl/webapp.crt')),
key: fs.readFileSync(path.resolve(__dirname, 'ssl/webapp.key')),
},
proxy: {
'/api': {
target: 'http://localhost:3000',
rewrite: (path) => path.replace('/api/', '/'),
},
},
},
plugins: [
react({
babel: { babelrc: true },
}),
tsconfigPaths(),
svg({
root: 'src/shared/ui/assets/icons',
output: 'public',
fileName: '{name}.{hash:8}.svg',
metadata: {
path: 'src/shared/ui/general/icon/sprites.generated.ts',
runtime: {
size: true,
viewBox: true,
},
},
group: false,
resetColors: false,
}),
],
})
// eslint-disable-next-line import/no-default-export
export default config