-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.mts
57 lines (56 loc) · 1.36 KB
/
vite.config.mts
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
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",
"~": __dirname,
"package.json": __dirname + "/package.json",
},
},
plugins: [
tsconfigPaths(),
checker({
eslint: {
lintCommand: "eslint --ext .js,.ts,.vue",
},
typescript: true,
vueTsc: true,
}),
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.includes("-") || tag === "webview",
},
},
}),
electron({
entry: {
main: "./src-electron/main.ts",
preload: "./src/preload.ts",
injectPreload: "./src/inject",
miniPlayerPreload: "./src/miniplayer/preload.ts",
},
vite: {
build: {
outDir: "dist",
},
plugins: [vue(), tsconfigPaths()],
},
}),
],
}
})