1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/frontend/vite.config.ts
Tymoteusz Czech 47152cf05b
Feat/invite user (#2061)
* refactor: user creation screen cleanup

* feat: deprecation notice for google sso

* fix: docs openid typo

* invite link bar

* invite link page

* fix prettier docs

* regenerated openapi

* hooks for invite page api

* update openapi

* feat: invite link update

* feat: add public signup token soft-delete

* public signup frontend feature flag

* fix: new user api issues

* feat: allow for creating new user from invite link

* Feat/invite user public controller (#2106)

* added PublicInviteController for public urls

* added PublicInviteController for public urls

* added PublicInviteController for public urls

* added PublicInviteController for public urls

* fix test

* fix test

* update openapi

* refactor: password reset props

* fix: public invite schema and validation

Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>

* user invite frontend

Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>

* invite link delete confirmation dialog

* refactor: password reset action

* fix: new user invite loading state

* fix: run ts check with ci

* revert openapi changes

* fix: invite token api interface

* fix: openapi schema index

* fix: update test snapshots

* update frontend snapshot

* fix: prettier ci

* fix: updates after review

Co-authored-by: andreas-unleash <104830839+andreas-unleash@users.noreply.github.com>
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-09-30 13:01:32 +02:00

73 lines
2.2 KiB
TypeScript

import { defineConfig, mergeConfig } from 'vite';
import {
configDefaults,
defineConfig as vitestDefineConfig,
} 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 UNLEASH_API = process.env.UNLEASH_API || 'http://localhost:4242';
const UNLEASH_BASE_PATH = process.env.UNLEASH_BASE_PATH || '/';
if (!UNLEASH_BASE_PATH.startsWith('/') || !UNLEASH_BASE_PATH.endsWith('/')) {
console.error('UNLEASH_BASE_PATH must both start and end with /');
process.exit(1);
}
const vitestConfig = vitestDefineConfig({
test: {
globals: true,
setupFiles: 'src/setupTests.ts',
environment: 'jsdom',
exclude: [...configDefaults.exclude, '**/cypress/**'],
},
});
export default mergeConfig(
defineConfig({
base: UNLEASH_BASE_PATH,
build: {
outDir: 'build',
assetsDir: 'static',
},
server: {
open: true,
host: true,
port: 3000,
proxy: {
[`${UNLEASH_BASE_PATH}api`]: {
target: UNLEASH_API,
changeOrigin: true,
},
[`${UNLEASH_BASE_PATH}auth`]: {
target: UNLEASH_API,
changeOrigin: true,
},
[`${UNLEASH_BASE_PATH}logout`]: {
target: UNLEASH_API,
changeOrigin: true,
},
[`${UNLEASH_BASE_PATH}health`]: {
target: UNLEASH_API,
changeOrigin: true,
},
[`${UNLEASH_BASE_PATH}invite`]: {
target: UNLEASH_API,
changeOrigin: true,
},
[`${UNLEASH_BASE_PATH}edge`]: {
target: UNLEASH_API,
changeOrigin: true,
},
},
},
plugins: [react(), tsconfigPaths(), svgr(), envCompatible()],
esbuild: {
logOverride: { 'this-is-undefined-in-esm': 'silent' },
},
}),
vitestConfig
);