2024-08-06 09:08:36 -05:00
|
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
import { mergeConfig, defineConfig, type UserConfig } from 'vite';
|
|
|
|
import viteCompression from 'vite-plugin-compression';
|
2024-07-23 01:52:45 -05:00
|
|
|
|
2024-07-24 04:47:02 -05:00
|
|
|
import { defaultConfig } from '../../vite.shared.config';
|
|
|
|
|
2024-08-06 09:08:36 -05:00
|
|
|
const buildConfig = (mode: string): UserConfig => ({
|
2024-07-23 01:52:45 -05:00
|
|
|
base: '/demo-app',
|
|
|
|
server: {
|
|
|
|
port: 5003,
|
|
|
|
hmr: {
|
|
|
|
port: 6003,
|
|
|
|
},
|
|
|
|
},
|
2024-08-06 09:08:36 -05:00
|
|
|
plugins: [
|
|
|
|
react(),
|
|
|
|
viteCompression({ disable: mode === 'development' }),
|
|
|
|
viteCompression({ disable: mode === 'development', algorithm: 'brotliCompress' }),
|
|
|
|
],
|
|
|
|
});
|
2024-07-23 01:52:45 -05:00
|
|
|
|
2024-08-06 09:08:36 -05:00
|
|
|
export default defineConfig(({ mode }) => mergeConfig(defaultConfig, buildConfig(mode)));
|