waveterm/electron.vite.config.ts
Evan Simkowitz b2b1f9b9df
Switch to using electron-vite instead of WebPack (#45)
This sets us back up to use Vite via the electron-vite package. This
will let us continue to build our testing suite on Vitest and take
advantage of Vite features like Hot Module Reloading, etc.

---------

Co-authored-by: sawka <mike.sawka@gmail.com>
2024-06-13 16:49:25 -07:00

60 lines
1.5 KiB
TypeScript

// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import react from "@vitejs/plugin-react";
import { defineConfig } from "electron-vite";
import { resolve } from "path";
import { viteStaticCopy } from "vite-plugin-static-copy";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
main: {
root: ".",
build: {
rollupOptions: {
input: {
index: resolve(__dirname, "emain/emain.ts"),
},
},
outDir: "dist/main",
},
plugins: [tsconfigPaths()],
},
preload: {
root: ".",
build: {
sourcemap: true,
rollupOptions: {
input: {
index: resolve(__dirname, "emain/preload.ts"),
},
output: {
format: "cjs",
},
},
outDir: "dist/preload",
},
plugins: [tsconfigPaths()],
},
renderer: {
root: ".",
build: {
target: "es6",
sourcemap: true,
outDir: "dist/frontend",
rollupOptions: {
input: {
index: resolve(__dirname, "index.html"),
},
},
},
plugins: [
react({}),
tsconfigPaths(),
viteStaticCopy({
targets: [{ src: "node_modules/monaco-editor/min/vs/*", dest: "monaco" }],
}),
],
},
});