Strip console logs from production build

pull/18/head
Flashfyre 2024-03-28 11:48:51 -04:00
parent b06c101020
commit 96bafab830
1 changed files with 12 additions and 9 deletions

View File

@ -1,14 +1,17 @@
import { defineConfig } from 'vite';
// import fs from 'vite-plugin-fs';
export default defineConfig({
plugins: [/*fs()*/],
server: { host: '0.0.0.0', port: 8000 },
clearScreen: false,
build: {
minify: 'esbuild',
},
esbuild: {
keepNames: true,
export default defineConfig(({ mode }) => {
return {
plugins: [/*fs()*/],
server: { host: '0.0.0.0', port: 8000 },
clearScreen: false,
build: {
minify: 'esbuild',
},
esbuild: {
pure: mode === 'production' ? [ 'console.log' ] : [],
keepNames: true,
}
}
})