-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
38 lines (37 loc) · 1.18 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
import { defineConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
import react from '@vitejs/plugin-react-swc';
import tsconfigPaths from 'vite-tsconfig-paths';
import graphqlLoader from 'vite-plugin-graphql-loader';
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
return {
base: `https://cdn.nav.no/fager/min-side-arbeidsgiver/build/${mode}`,
plugins: [
tsconfigPaths(),
graphqlLoader(),
react(),
legacy({
modernPolyfills: ['es.string.replace', 'esnext.string.replace-all'],
polyfills: ['es.string.replace', 'esnext.string.replace-all'],
}),
],
optimizeDeps: {
exclude: ['js-big-decimal'],
},
define: {
__BUILD_TIMESTAMP__: new Date(),
__BASE_PATH__: JSON.stringify('/min-side-arbeidsgiver'),
},
build: {
outDir: `build/${mode}`,
sourcemap: true,
},
server: {
port: 3000,
proxy: {
'/min-side-arbeidsgiver/artikler': 'http://localhost:8080',
},
},
};
});