-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
42 lines (39 loc) · 1.36 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { defineConfig, splitVendorChunkPlugin, loadEnv } from 'vite';
import reactPlugin from '@vitejs/plugin-react';
import svgrPlugin from 'vite-plugin-svgr';
import checkerPlugin from 'vite-plugin-checker';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
build: {
target: 'es2022',
sourcemap: true,
chunkSizeWarningLimit: 3000,
},
plugins: [
reactPlugin(),
svgrPlugin(),
checkerPlugin({
typescript: true,
eslint: {
lintCommand: 'eslint "./src/**/*.{ts,tsx,js,jsx}"',
},
}),
// Splitt node_modules til en egen chunk.
// Dette fikser noen sirkulære avhengigheter i @ds/react.
splitVendorChunkPlugin(),
],
server: {
port: 3000,
proxy: {
'/kandidatsok-proxy': 'http://localhost:3005/kandidatsok-proxy',
'/stillingssok-proxy': {
changeOrigin: true,
target: `${env.OPEN_SEARCH_URI}`,
rewrite: (path) => path.replace('/stillingssok-proxy', ''),
auth: `${env.OPEN_SEARCH_USERNAME}:${env.OPEN_SEARCH_PASSWORD}`,
},
},
},
};
});