mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-27 02:30:17 +08:00
4f0b892d39
* use relative basepath * remove lang folder from template * gitignore frontend folder
38 lines
842 B
JavaScript
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] }
|
|
})
|
|
})
|
|
]
|
|
};
|
|
});
|