Files
Folo/apps/desktop/configs/vite.electron-render.config.ts
T
DIYgodandDIYgod 8b07a9a573 chore: desktop dir (#2924)
* chore: desktop dir

* chore: desktop src and configs

* chore: auto-fix linting and formatting issues

* fix: path

* fix: path

* fix: path

* fix: path

* fix

* fix

* fix

* test

* test

* test

* test

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: DIYgod <8266075+DIYgod@users.noreply.github.com>
2025-03-02 17:19:22 +08:00

33 lines
860 B
TypeScript

import { dirname, resolve } from "node:path"
import { fileURLToPath } from "node:url"
import type { UserConfig } from "vite"
import { createPlatformSpecificImportPlugin } from "../plugins/vite/specific-import"
import { viteRenderBaseConfig } from "./vite.render.config"
const root = resolve(fileURLToPath(dirname(import.meta.url)), "..")
export default {
...viteRenderBaseConfig,
plugins: [...viteRenderBaseConfig.plugins, createPlatformSpecificImportPlugin("electron")],
root: resolve(root, "src/renderer"),
build: {
outDir: resolve(root, "dist/renderer"),
sourcemap: !!process.env.CI,
target: "esnext",
rollupOptions: {
input: {
main: resolve(root, "src/renderer/index.html"),
},
},
minify: true,
},
define: {
...viteRenderBaseConfig.define,
ELECTRON: "true",
},
} satisfies UserConfig