forked from oldj/SwitchHosts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.render.config.ts
52 lines (51 loc) · 1.38 KB
/
vite.render.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
import react from '@vitejs/plugin-react'
import * as path from 'path'
import { defineConfig } from 'vite'
import svgr from 'vite-plugin-svgr'
import tsconfigPaths from 'vite-tsconfig-paths'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
tsconfigPaths(),
svgr({
// Set it to `true` to export React component as default.
// Notice that it will overrides the default behavior of Vite.
exportAsDefault: true,
}),
react(),
],
base: './',
root: path.join(__dirname, 'src', 'renderer'),
build: {
rollupOptions: {
input: {
renderer: path.join(__dirname, 'src', 'renderer', 'index.html'),
},
},
outDir: path.join(__dirname, 'build'),
minify: true,
ssr: false,
emptyOutDir: false,
},
css: {
modules: {
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@root': path.resolve(__dirname),
'@assets': path.resolve(__dirname, 'assets'),
'@src': path.resolve(__dirname, 'src'),
'@common': path.resolve(__dirname, 'src', 'common'),
'@main': path.resolve(__dirname, 'src', 'main'),
'@renderer': path.resolve(__dirname, 'src', 'renderer'),
'@styles': path.resolve(__dirname, 'src', 'renderer', 'styles'),
},
},
server: {
host: '127.0.0.1',
port: 8220,
},
})