Blame view

internal/vite-config/src/config/common.ts 604 Bytes
vben authored
1
import { presetTypography, presetUno } from 'unocss';
2
3
import UnoCSS from 'unocss/vite';
import { type UserConfig } from 'vite';
4
5
const commonConfig: (mode: string) => UserConfig = (mode) => ({
6
7
8
9
  server: {
    host: true,
  },
  esbuild: {
10
    drop: mode === 'procution' ? ['console', 'debugger'] : [],
11
12
13
14
15
16
17
18
19
  },
  build: {
    reportCompressedSize: false,
    chunkSizeWarningLimit: 1500,
    rollupOptions: {
      // TODO: Prevent memory overflow
      maxParallelFileOps: 3,
    },
  },
vben authored
20
21
22
23
24
  plugins: [
    UnoCSS({
      presets: [presetUno(), presetTypography()],
    }),
  ],
25
});
26
27

export { commonConfig };