mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
b2b1f9b9df
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>
60 lines
1.5 KiB
TypeScript
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" }],
|
|
}),
|
|
],
|
|
},
|
|
});
|