-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.js
45 lines (43 loc) · 992 Bytes
/
vite.config.js
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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "path";
import commonjsExternals from "vite-plugin-commonjs-externals";
import { builtinModules } from "module";
const commonjsPackages = [
// Electron
"electron",
"electron/main",
"electron/common",
"electron/renderer",
// Node
...builtinModules,
// Custom
"winston",
"winston-daily-rotate-file"
];
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 3060,
strictPort: true
},
plugins: [commonjsExternals({ externals: commonjsPackages }), react()],
resolve: {
alias: [
{
find: "@",
replacement: path.resolve(__dirname, "src")
}
]
},
build: {
sourcemap: true,
target: "chrome98",
outDir: "./dist/vi",
emptyOutDir: true,
assetsDir: "./"
},
// The script/style src paths need to be relative.
// Removing the default '/' at start by setting base to empty.
base: ""
});