Mirror of https://github.com/roostorg/coop
github.com/roostorg/coop
1import path from 'path';
2import { defineConfig } from 'vite';
3import react from '@vitejs/plugin-react';
4import svgr from 'vite-plugin-svgr';
5import tsconfigPaths from 'vite-tsconfig-paths';
6import commonjs from 'vite-plugin-commonjs';
7
8export default defineConfig({
9 plugins: [
10 react(),
11 svgr(),
12 tsconfigPaths(),
13 commonjs(),
14 ],
15 resolve: {
16 alias: {
17 '@': path.resolve(__dirname, './src'),
18 // Redirect `recharts-scale/es6/getNiceTickValues` through our wrapper so
19 // we can recover from upstream's DecimalError "Division by zero" on
20 // degenerate chart domains. See `src/rechartsScaleWrapper.js`.
21 'recharts-scale/es6/getNiceTickValues': path.resolve(
22 __dirname,
23 './src/rechartsScaleWrapper.js',
24 ),
25 },
26 },
27 build: {
28 outDir: 'build',
29 },
30 server: {
31 proxy: {
32 '/api': {
33 target: 'http://localhost:8080',
34 changeOrigin: true,
35 },
36 },
37 },
38 test: {
39 globals: true,
40 environment: 'jsdom',
41 setupFiles: './src/setupTests.ts',
42 },
43});