2024-06-14 01:49:25 +02:00
|
|
|
// Copyright 2024, Command Line Inc.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
import { defineConfig } from "electron-vite";
|
|
|
|
import { viteStaticCopy } from "vite-plugin-static-copy";
|
|
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
2024-06-22 09:44:37 +02:00
|
|
|
import path from "path";
|
2024-06-14 01:49:25 +02:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
main: {
|
|
|
|
root: ".",
|
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
|
|
|
input: {
|
2024-06-14 08:03:57 +02:00
|
|
|
index: "emain/emain.ts",
|
2024-06-14 01:49:25 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
outDir: "dist/main",
|
|
|
|
},
|
|
|
|
plugins: [tsconfigPaths()],
|
2024-06-22 09:44:37 +02:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"@": path.resolve(__dirname, "./frontend"),
|
|
|
|
},
|
|
|
|
}
|
2024-06-14 01:49:25 +02:00
|
|
|
},
|
|
|
|
preload: {
|
|
|
|
root: ".",
|
|
|
|
build: {
|
|
|
|
sourcemap: true,
|
|
|
|
rollupOptions: {
|
|
|
|
input: {
|
2024-06-14 08:03:57 +02:00
|
|
|
index: "emain/preload.ts",
|
2024-06-14 01:49:25 +02:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
format: "cjs",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
outDir: "dist/preload",
|
|
|
|
},
|
|
|
|
plugins: [tsconfigPaths()],
|
|
|
|
},
|
|
|
|
renderer: {
|
|
|
|
root: ".",
|
|
|
|
build: {
|
|
|
|
target: "es6",
|
|
|
|
sourcemap: true,
|
|
|
|
outDir: "dist/frontend",
|
|
|
|
rollupOptions: {
|
|
|
|
input: {
|
2024-06-14 08:03:57 +02:00
|
|
|
index: "index.html",
|
2024-06-14 01:49:25 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-06-17 18:58:28 +02:00
|
|
|
server: {
|
|
|
|
open: false,
|
|
|
|
},
|
2024-06-14 01:49:25 +02:00
|
|
|
plugins: [
|
|
|
|
react({}),
|
|
|
|
tsconfigPaths(),
|
|
|
|
viteStaticCopy({
|
|
|
|
targets: [{ src: "node_modules/monaco-editor/min/vs/*", dest: "monaco" }],
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|