mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-23 00:38:28 +00:00
checkpoint. good to merge. we have a working tsunami view inside of wave (with lots of caveats). but enough for some dev testing. merge so we dont drift too far from main and while we're at a stable point.
105 lines
2.8 KiB
TypeScript
105 lines
2.8 KiB
TypeScript
// Copyright 2025, Command Line Inc.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import { defineConfig } from "electron-vite";
|
|
import { ViteImageOptimizer } from "vite-plugin-image-optimizer";
|
|
import { viteStaticCopy } from "vite-plugin-static-copy";
|
|
import svgr from "vite-plugin-svgr";
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
|
|
// from our electron build
|
|
const CHROME = "chrome140";
|
|
const NODE = "node22";
|
|
|
|
export default defineConfig({
|
|
main: {
|
|
root: ".",
|
|
build: {
|
|
target: NODE,
|
|
rollupOptions: {
|
|
input: {
|
|
index: "emain/emain.ts",
|
|
},
|
|
},
|
|
outDir: "dist/main",
|
|
},
|
|
plugins: [tsconfigPaths()],
|
|
resolve: {
|
|
alias: {
|
|
"@": "frontend",
|
|
},
|
|
},
|
|
server: {
|
|
open: false,
|
|
},
|
|
define: {
|
|
"process.env.WS_NO_BUFFER_UTIL": "true",
|
|
"process.env.WS_NO_UTF_8_VALIDATE": "true",
|
|
},
|
|
},
|
|
preload: {
|
|
root: ".",
|
|
build: {
|
|
target: NODE,
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
input: {
|
|
index: "emain/preload.ts",
|
|
"preload-webview": "emain/preload-webview.ts",
|
|
},
|
|
output: {
|
|
format: "cjs",
|
|
},
|
|
},
|
|
outDir: "dist/preload",
|
|
},
|
|
server: {
|
|
open: false,
|
|
},
|
|
plugins: [tsconfigPaths()],
|
|
},
|
|
renderer: {
|
|
root: ".",
|
|
build: {
|
|
target: CHROME,
|
|
sourcemap: true,
|
|
outDir: "dist/frontend",
|
|
rollupOptions: {
|
|
input: {
|
|
index: "index.html",
|
|
},
|
|
},
|
|
},
|
|
optimizeDeps: {
|
|
include: ["monaco-yaml/yaml.worker.js"],
|
|
},
|
|
server: {
|
|
open: false,
|
|
watch: {
|
|
ignored: ["dist/**", "**/*.go", "**/go.mod", "**/go.sum", "**/*.md", "**/*.json", "emain/**"],
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
silenceDeprecations: ["mixed-decls"],
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
tsconfigPaths(),
|
|
{ ...ViteImageOptimizer(), apply: "build" },
|
|
svgr({
|
|
svgrOptions: { exportType: "default", ref: true, svgo: false, titleProp: true },
|
|
include: "**/*.svg",
|
|
}),
|
|
react({}),
|
|
tailwindcss(),
|
|
viteStaticCopy({
|
|
targets: [{ src: "node_modules/monaco-editor/min/vs/*", dest: "monaco" }],
|
|
}),
|
|
],
|
|
},
|
|
});
|