Ben Lin
2024-06-18 c3e294ff76aff4654c7218645c7a13b539f66a36
internal/vite-config/src/config/common.ts
@@ -1,13 +1,12 @@
import { presetTypography, presetUno } from 'unocss';
import UnoCSS from 'unocss/vite';
import { type UserConfig } from 'vite';
const commonConfig: UserConfig = {
const commonConfig: (mode: string) => UserConfig = (mode) => ({
  server: {
    host: true,
  },
  esbuild: {
    drop: ['console', 'debugger'],
    drop: mode === 'production' ? ['console', 'debugger'] : [],
  },
  build: {
    reportCompressedSize: false,
@@ -17,11 +16,7 @@
      maxParallelFileOps: 3,
    },
  },
  plugins: [
    UnoCSS({
      presets: [presetUno(), presetTypography()],
    }),
  ],
};
  plugins: [UnoCSS()],
});
export { commonConfig };