feat: esbuild增加不同开发模式下对cnosole debugger的处理 (#2907)

This commit is contained in:
scottMan1001
2023-07-11 11:52:54 +08:00
committed by GitHub
parent c6e135195a
commit 4e3e721650
3 changed files with 6 additions and 6 deletions

View File

@@ -2,12 +2,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: ['debugger'],
drop: mode === 'procution' ? ['console', 'debugger'] : [],
},
build: {
reportCompressedSize: false,
@@ -22,6 +22,6 @@ const commonConfig: UserConfig = {
presets: [presetUno(), presetTypography()],
}),
],
};
});
export { commonConfig };