2023-04-06 23:28:37 +08:00
|
|
|
import UnoCSS from 'unocss/vite';
|
|
|
|
|
import { type UserConfig } from 'vite';
|
2023-04-05 00:20:48 +08:00
|
|
|
|
2023-07-11 11:52:54 +08:00
|
|
|
const commonConfig: (mode: string) => UserConfig = (mode) => ({
|
2023-04-05 00:20:48 +08:00
|
|
|
server: {
|
|
|
|
|
host: true,
|
|
|
|
|
},
|
|
|
|
|
esbuild: {
|
2023-08-16 21:35:21 +08:00
|
|
|
drop: mode === 'production' ? ['console', 'debugger'] : [],
|
2023-04-05 00:20:48 +08:00
|
|
|
},
|
|
|
|
|
build: {
|
|
|
|
|
reportCompressedSize: false,
|
|
|
|
|
chunkSizeWarningLimit: 1500,
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
// TODO: Prevent memory overflow
|
|
|
|
|
maxParallelFileOps: 3,
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-11-23 17:40:49 +08:00
|
|
|
plugins: [UnoCSS()],
|
2023-07-11 11:52:54 +08:00
|
|
|
});
|
2023-04-05 00:20:48 +08:00
|
|
|
|
|
|
|
|
export { commonConfig };
|