Skip to content

Commit

Permalink
fix: set node resolve overrideConditions for ssr resolveId
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed May 10, 2024
1 parent 3ad3009 commit 60824f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,16 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
(res = tryNodeResolve(
id,
importer,
options,
{
...options,
overrideConditions: ssr
? [
...(ssrConfig?.resolve?.externalConditions ?? []),
'production',
'development',
]
: undefined,
},
targetWeb,
depsOptimizer,
ssr,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import * as mixDep from '@vitejs/test-mix-dep'
export { mixDep }

0 comments on commit 60824f0

Please sign in to comment.