Skip to content

Commit 1c1bf70

Browse files
committed
Revert "fixup!"
This reverts commit edf1f60.
1 parent edf1f60 commit 1c1bf70

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎src/generators/web/bundlers/vite.mjs‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { pathToFileURL } from 'node:url';
55

66
import {
77
build as viteBuild,
8+
defaultClientConditions,
9+
defaultServerConditions,
810
mergeConfig,
911
} from 'vite';
1012

@@ -159,6 +161,7 @@ export const createViteConfig = ({
159161
vite = {},
160162
}) => {
161163
const root = resolve(vite.root ?? process.cwd());
164+
const conditions = server ? defaultServerConditions : defaultClientConditions;
162165

163166
return {
164167
...vite,
@@ -186,6 +189,7 @@ export const createViteConfig = ({
186189
{ resolve: vite.resolve },
187190
{
188191
resolve: {
192+
conditions: ['rolldown', ...conditions],
189193
dedupe: ['preact'],
190194

191195
// Vite applies string aliases to matching package subpaths too.
@@ -227,6 +231,7 @@ export const createViteConfig = ({
227231
watch: null,
228232
lib: false,
229233

234+
...(server ? { manifest: false } : {}),
230235
ssr: server,
231236

232237
// Browser output follows the generator's minification setting. Temporary
@@ -256,6 +261,14 @@ export const createViteConfig = ({
256261
...vite.ssr,
257262
external: [],
258263
noExternal: true,
264+
resolve: {
265+
...vite.ssr?.resolve,
266+
conditions: [
267+
'rolldown',
268+
...defaultServerConditions,
269+
...(vite.ssr?.resolve?.conditions ?? []),
270+
],
271+
},
259272
},
260273
}
261274
: {}),

0 commit comments

Comments
 (0)