Make vite work out-of-the-box for simple-host (#33)

This commit is contained in:
Jan Olaf Martin 2025-12-01 13:57:46 -08:00 • committed by GitHub
commit a7d73c72e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,24 +1,24 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile";
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: INPUT,
export default defineConfig(({ mode }) => {
const isDevelopment = mode === "development";
return {
plugins: [react()],
build: {
sourcemap: isDevelopment ? "inline" : undefined,
cssMinify: !isDevelopment,
minify: !isDevelopment,
rollupOptions: {
input: [
"index.html",
"example-host-vanilla.html",
"example-host-react.html",
"sandbox.html",
],
},
outDir: `dist`,
emptyOutDir: false,
},
outDir: `dist`,
emptyOutDir: false,
},
};
});