gradio/ui/packages/app/vite.config.js
pngwn 4f0b892d39
use relative basepath (#665)
* use relative basepath

* remove lang folder from template

* gitignore frontend folder
2022-02-18 13:50:34 +00:00

38 lines
842 B
JavaScript

import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import sveltePreprocess from "svelte-preprocess";
// this is dupe config, gonna try fix this
import tailwind from "tailwindcss";
import nested from "tailwindcss/nesting";
//@ts-ignore
export default defineConfig(({ mode }) => {
const production = mode === "production";
return {
base: "./",
build: {
outDir: "../../../gradio/templates/frontend"
},
define: {
BUILD_MODE: production ? JSON.stringify("prod") : JSON.stringify("dev"),
BACKEND_URL: production
? JSON.stringify("")
: JSON.stringify("http://localhost:7860/")
},
css: {
postcss: {
plugins: [nested, tailwind]
}
},
plugins: [
svelte({
preprocess: sveltePreprocess({
postcss: { plugins: [nested, tailwind] }
})
})
]
};
});