gradio/ui/packages/app/vite.config.js
pngwn 26d2c190fc
add test infra + add browser tests to CI (#852)
* add test infra

* improve test setup and utils

* finish a test

* add browser tests to ci

* fix ci

* fix ci

* fix ci

* fix ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* debug ci

* fix ci

* update lockfile

* fix formatting

* install browser when not cached

* bust cache

* debug test in ci

* fix button label

* generate screenshots for failed tests

* generate screenshots for failed tests

* generate screenshots for failed tests

* fix tests

* clean uip debug logs

* add setuip + teardown to functional tests

* remove build from static checks
2022-03-23 15:19:12 +00:00

41 lines
941 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/index.js";
//@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: JSON.stringify("http://localhost:7860/")
},
css: {
postcss: {
plugins: [nested, tailwind]
}
},
plugins: [
svelte({
hot: !process.env.VITEST,
preprocess: sveltePreprocess({
postcss: { plugins: [tailwind, nested] }
})
})
],
test: {
environment: "happy-dom",
include: ["**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"]
}
};
});