Strip console logs from production build
parent
b06c101020
commit
96bafab830
|
@ -1,14 +1,17 @@
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
// import fs from 'vite-plugin-fs';
|
// import fs from 'vite-plugin-fs';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig(({ mode }) => {
|
||||||
plugins: [/*fs()*/],
|
return {
|
||||||
server: { host: '0.0.0.0', port: 8000 },
|
plugins: [/*fs()*/],
|
||||||
clearScreen: false,
|
server: { host: '0.0.0.0', port: 8000 },
|
||||||
build: {
|
clearScreen: false,
|
||||||
minify: 'esbuild',
|
build: {
|
||||||
},
|
minify: 'esbuild',
|
||||||
esbuild: {
|
},
|
||||||
keepNames: true,
|
esbuild: {
|
||||||
|
pure: mode === 'production' ? [ 'console.log' ] : [],
|
||||||
|
keepNames: true,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue