From d3e2f3f7f17e09ebd591a6ca10b02e0b6d67edae Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 1 Oct 2021 19:25:51 +0800 Subject: [PATCH] fix(plugin-legacy): use terser as the default minifier fixes #5157 --- packages/playground/legacy/vite.config.js | 3 --- packages/plugin-legacy/index.js | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/playground/legacy/vite.config.js b/packages/playground/legacy/vite.config.js index a8fc762cd501a4..3d7d6b37d11451 100644 --- a/packages/playground/legacy/vite.config.js +++ b/packages/playground/legacy/vite.config.js @@ -10,9 +10,6 @@ module.exports = { ], build: { - // make tests faster - minify: false, - rollupOptions: { output: { chunkFileNames(chunkInfo) { diff --git a/packages/plugin-legacy/index.js b/packages/plugin-legacy/index.js index 60f7f4a227ff03..f88b77c5f6a33e 100644 --- a/packages/plugin-legacy/index.js +++ b/packages/plugin-legacy/index.js @@ -96,6 +96,14 @@ function viteLegacyPlugin(options = {}) { name: 'vite:legacy-generate-polyfill-chunk', apply: 'build', + config() { + return { + build: { + minify: 'terser' + } + } + }, + configResolved(config) { if (!config.build.ssr && genLegacy && config.build.minify === 'esbuild') { throw new Error(