Skip to content

Commit

Permalink
refactor: correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Apr 7, 2024
1 parent 7a56401 commit 8530bba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/preset-umi/src/features/ssr/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ export default (api: IApi) => {
api.modifyConfig((memo) => {
// define SSR_BUILD_TARGET to strip useless logic
memo.define ??= {};
memo.define.SSR_BUILD_TARGET =
api.config.ssr.serverBuildTarget || 'express';
memo.define['process.env.SSR_BUILD_TARGET'] =
memo.ssr.serverBuildTarget || 'express';

if (api.config.serverBuildTarget === 'worker') {
if (memo.ssr.serverBuildTarget === 'worker') {
// use browser version of react-dom/server for worker mode
// ref: https://github.com/facebook/react/blob/f86afca090b668d8be10b642750844759768d1ad/packages/react-server-dom-webpack/package.json#L52
memo.alias['react-dom/server$'] = winPath(
Expand Down

0 comments on commit 8530bba

Please sign in to comment.