From ed384cfeff9e3ccb0fdbb07ec91758308da66226 Mon Sep 17 00:00:00 2001 From: Florian Dreier Date: Thu, 23 Sep 2021 21:47:24 +0200 Subject: [PATCH] fix: esbuild minification and renderLegacyChunks false (#5054) --- packages/plugin-legacy/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-legacy/index.js b/packages/plugin-legacy/index.js index ac7abf75893c99..fbcb6789761086 100644 --- a/packages/plugin-legacy/index.js +++ b/packages/plugin-legacy/index.js @@ -97,7 +97,7 @@ function viteLegacyPlugin(options = {}) { apply: 'build', configResolved(config) { - if (!config.build.ssr && config.build.minify === 'esbuild') { + if (!config.build.ssr && genLegacy && config.build.minify === 'esbuild') { throw new Error( `Can't use esbuild as the minifier when targeting legacy browsers ` + `because esbuild minification is not legacy safe.`