gradio/ui/packages/app/vite.config.js

38 lines
842 B
JavaScript
Raw Normal View History

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";
2022-02-23 19:17:41 +08:00
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({
2022-03-12 00:00:48 +08:00
postcss: { plugins: [tailwind, nested] }
})
})
]
};
});