add simple-host example
This commit is contained in:
parent
535dae6a73
commit
1f3bc52142
1 changed files with 1187 additions and 13 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue