1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/vite.config.ts
Nuno Góis 5872a1c82c refactor: adapt to Vite (#940)
* chore: adapt to vite

* remove react-scripts

* add jsdom dep, update snaps

* fix tests

* fix: formatting

* fix: vercel rewrite

* fix: regeneratorRuntime is not defined

Co-authored-by: Tymoteusz Czech <tymek+gpg@getunleash.ai>
Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
2022-05-05 16:15:22 +01:00

38 lines
1.0 KiB
TypeScript

import { configDefaults, defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths';
import react from '@vitejs/plugin-react';
import svgr from 'vite-plugin-svgr';
import envCompatible from 'vite-plugin-env-compatible';
const API_URL = process.env.UNLEASH_API || 'http://localhost:4242';
// https://vitejs.dev/config/
export default defineConfig({
test: {
globals: true,
setupFiles: 'src/setupTests.ts',
environment: 'jsdom',
exclude: [...configDefaults.exclude, '**/cypress/**'],
},
server: {
proxy: {
'/api': {
target: API_URL,
changeOrigin: true,
},
'/auth': {
target: API_URL,
changeOrigin: true,
},
'/logout': {
target: API_URL,
changeOrigin: true,
},
},
},
build: {
outDir: 'build',
},
plugins: [react(), tsconfigPaths(), svgr(), envCompatible()],
});