提交 fc8acd26 作者: 方治民

build: terser minify

上级 6a182a2c
...@@ -59,23 +59,20 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -59,23 +59,20 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
// Load proxy configuration from .env // Load proxy configuration from .env
proxy: createProxy(VITE_PROXY), proxy: createProxy(VITE_PROXY),
}, },
esbuild: {
pure: VITE_DROP_CONSOLE ? ['console.log', 'debugger'] : [],
},
build: { build: {
target: 'es2015', target: 'es2015',
cssTarget: 'chrome80', cssTarget: 'chrome80',
// minify: 'terser', minify: 'terser',
/** /**
* 当 minify=“minify:'terser'” 解开注释 * 当 minify=“minify:'terser'” 解开注释
* Uncomment when minify="minify:'terser'" * Uncomment when minify="minify:'terser'"
*/ */
// terserOptions: { terserOptions: {
// compress: { compress: {
// keep_infinity: true, keep_infinity: true,
// drop_console: VITE_DROP_CONSOLE, drop_console: VITE_DROP_CONSOLE,
// }, },
// }, },
// Turning off brotliSize display can slightly reduce packaging time // Turning off brotliSize display can slightly reduce packaging time
reportCompressedSize: false, reportCompressedSize: false,
chunkSizeWarningLimit: 2000, chunkSizeWarningLimit: 2000,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论