add simple-host example

This commit is contained in:
Olivier Chafik 2025-11-24 16:01:10 +00:00
commit 1f3bc52142
No known key found for this signature in database

View file

@ -1,16 +1,23 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile";
import { resolve } from "path";
// Get the entry from environment variable, default to ui-react
const uiPath = process.env.UI;
const INPUT = process.env.INPUT;
if (!INPUT) {
throw new Error("INPUT environment variable is not set");
}
const isDevelopment = process.env.NODE_ENV === "development";
export default defineConfig({
plugins: [react(), viteSingleFile()],
build: {
sourcemap: isDevelopment ? "inline" : undefined,
cssMinify: !isDevelopment,
minify: !isDevelopment,
rollupOptions: {
input: uiPath,
input: INPUT,
},
outDir: `dist`,
emptyOutDir: false,