forked from caoxiemeihao/electron-vite-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
42 lines (41 loc) · 992 Bytes
/
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
import path from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import electron from 'vite-plugin-electron'
import electronRenderer from 'vite-plugin-electron/renderer'
import polyfillExports from 'vite-plugin-electron/polyfill-exports'
import electronConfig from './vite-electron.config'
import Pages from 'vite-plugin-pages'
import WindiCSS from 'vite-plugin-windicss'
export default defineConfig({
plugins: [
vue(),
WindiCSS(),
electron(electronConfig),
electronRenderer(),
polyfillExports(),
Pages({
importMode: "async"
}),
],
build: {
emptyOutDir: false,
cssCodeSplit: false,
rollupOptions: {
input: {
index: "/index.html"
},
output: {
entryFileNames(chunkInfo) {
return `${chunkInfo.name}.[hash].js`
},
}
}
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"~": path.resolve(__dirname, "./"),
}
}
})