-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
61 lines (60 loc) · 1.63 KB
/
vite.config.ts
File metadata and controls
61 lines (60 loc) · 1.63 KB
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
53
54
55
56
57
58
59
60
61
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import electron from "vite-plugin-electron";
import checker from "vite-plugin-checker";
import tsconfigPaths from "vite-tsconfig-paths";
// https://vitejs.dev/config/
export default defineConfig((options) => {
return {
build: {
sourcemap: options.mode === "development" ? "inline" : false,
rollupOptions: { input: { index: "./index.html" } },
},
resolve: {
alias: {
vue: "vue/dist/vue.esm-bundler.js",
"~": import.meta.dirname,
"package.json": import.meta.dirname + "/package.json",
},
},
plugins: [
tsconfigPaths(),
checker({ vueTsc: true }),
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.includes("-") || tag === "webview",
},
},
}),
electron([
{
entry: {
main: "./src-electron/main.ts",
},
vite: {
build: { outDir: "dist" },
plugins: [vue(), tsconfigPaths()],
},
},
{
vite: {
build: {
outDir: "dist",
rollupOptions: {
input: {
preload: "./src/preload.ts",
injectPreload: "./src/inject",
miniPlayerPreload: "./src/miniplayer/preload.ts",
},
output: { format: "cjs", entryFileNames: "[name].js" },
external: ["electron"],
},
},
plugins: [vue(), tsconfigPaths()],
},
},
]),
],
};
});