0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/demo-app/vite.config.ts
Gao Sun a6002d5f19
refactor: produce br outputs (#6376)
* refactor: produce br outputs

* refactor: fix favicon url
2024-08-06 22:08:36 +08:00

22 lines
638 B
TypeScript

import react from '@vitejs/plugin-react';
import { mergeConfig, defineConfig, type UserConfig } from 'vite';
import viteCompression from 'vite-plugin-compression';
import { defaultConfig } from '../../vite.shared.config';
const buildConfig = (mode: string): UserConfig => ({
base: '/demo-app',
server: {
port: 5003,
hmr: {
port: 6003,
},
},
plugins: [
react(),
viteCompression({ disable: mode === 'development' }),
viteCompression({ disable: mode === 'development', algorithm: 'brotliCompress' }),
],
});
export default defineConfig(({ mode }) => mergeConfig(defaultConfig, buildConfig(mode)));