From a1019f80a5d5b6242d8fb0975994ce1ae6e78e94 Mon Sep 17 00:00:00 2001 From: Tal500 Date: Wed, 1 Mar 2023 05:26:52 +0200 Subject: [PATCH] fix(plugin-legacy): no `build.target` override on SSR build (#12171) --- packages/plugin-legacy/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-legacy/src/index.ts b/packages/plugin-legacy/src/index.ts index acb318db988591..84453271e65736 100644 --- a/packages/plugin-legacy/src/index.ts +++ b/packages/plugin-legacy/src/index.ts @@ -165,7 +165,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] { name: 'vite:legacy-config', config(config, env) { - if (env.command === 'build') { + if (env.command === 'build' && !config.build?.ssr) { if (!config.build) { config.build = {} }