generated from UNDP-Data/dv-ui-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
34 lines (33 loc) · 868 Bytes
/
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
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable no-unused-vars */
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import eslint from 'vite-plugin-eslint';
export default defineConfig(({ command, mode }) => {
const externalEnvs = loadEnv(mode, process.cwd(), '');
return {
plugins: [react(), eslint()],
define: {
'process.env': externalEnvs,
},
build: {
outDir: 'build',
cssCodeSplit: false,
rollupOptions: {
output: {
entryFileNames: '[name].js',
assetFileNames: '[name].[ext]',
},
},
},
server: {
cors: {
origin: '*',
methods: ['GET'],
preflightContinue: false,
optionsSuccessStatus: 204,
},
},
};
});