diff --git a/packages/vite/src/node/ssr/ssrModuleLoader.ts b/packages/vite/src/node/ssr/ssrModuleLoader.ts index 3e498809f32829..898ce3324b393f 100644 --- a/packages/vite/src/node/ssr/ssrModuleLoader.ts +++ b/packages/vite/src/node/ssr/ssrModuleLoader.ts @@ -121,7 +121,7 @@ async function instantiateModule( const { isProduction, - resolve: { dedupe, preserveSymlinks }, + resolve: { dedupe, preserveSymlinks, conditions }, root, } = server.config @@ -129,7 +129,7 @@ async function instantiateModule( mainFields: ['main'], browserField: true, conditions: [], - overrideConditions: ['production', 'development'], + overrideConditions: [...conditions, 'production', 'development'], extensions: ['.js', '.cjs', '.json'], dedupe, preserveSymlinks,