62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
|
|
// electron.vite.config.ts
|
||
|
|
import { resolve } from "path";
|
||
|
|
import { defineConfig, externalizeDepsPlugin, bytecodePlugin } from "electron-vite";
|
||
|
|
import vue from "@vitejs/plugin-vue";
|
||
|
|
import AutoImport from "unplugin-auto-import/vite";
|
||
|
|
import Components from "unplugin-vue-components/vite";
|
||
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
||
|
|
import { NaiveUiResolver } from "unplugin-vue-components/resolvers";
|
||
|
|
var electron_vite_config_default = defineConfig({
|
||
|
|
main: {
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
"@": resolve("src"),
|
||
|
|
"@renderer": resolve("src/renderer/src")
|
||
|
|
}
|
||
|
|
},
|
||
|
|
plugins: [externalizeDepsPlugin(), bytecodePlugin(), tsconfigPaths()]
|
||
|
|
},
|
||
|
|
preload: {
|
||
|
|
plugins: [externalizeDepsPlugin(), bytecodePlugin()],
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
"@": resolve("src"),
|
||
|
|
"@renderer": resolve("src/renderer/src")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
renderer: {
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
"@": resolve("src"),
|
||
|
|
"@renderer": resolve("src/renderer/src")
|
||
|
|
}
|
||
|
|
},
|
||
|
|
plugins: [
|
||
|
|
bytecodePlugin(),
|
||
|
|
vue({
|
||
|
|
template: {
|
||
|
|
compilerOptions: {
|
||
|
|
// 将webview标签标记为自定义元素
|
||
|
|
isCustomElement: (tag) => ["webview"].includes(tag)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}),
|
||
|
|
AutoImport({
|
||
|
|
imports: [
|
||
|
|
"vue",
|
||
|
|
{
|
||
|
|
"naive-ui": ["useDialog", "useMessage", "useNotification", "useLoadingBar"]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}),
|
||
|
|
Components({
|
||
|
|
resolvers: [NaiveUiResolver()]
|
||
|
|
})
|
||
|
|
]
|
||
|
|
}
|
||
|
|
});
|
||
|
|
export {
|
||
|
|
electron_vite_config_default as default
|
||
|
|
};
|