Skip to content

Commit

Permalink
feat: compatible with bun
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyuang committed Mar 28, 2024
1 parent 2f57101 commit 5eac01d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 3 additions & 0 deletions packages/plugin-react18/src/@types/react-dom/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'react-dom/server.node' {
export * from 'react-dom/server';
}
2 changes: 1 addition & 1 deletion packages/plugin-react18/src/entry/server-entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { PassThrough } from 'stream'
import * as React from 'react'
import { createElement } from 'react'
import { StaticRouter } from 'react-router-dom'
import { renderToString, renderToPipeableStream } from 'react-dom/server'
import { renderToString, renderToPipeableStream } from 'react-dom/server.node'
import { findRoute, getManifest, logGreen, normalizePath, getAsyncCssChunk, getAsyncJsChunk, reactRefreshFragment, localStorageWrapper, checkRoute, splitPageInfo, useStore } from 'ssr-common-utils'
import { ISSRContext, IConfig, ReactESMPreloadFeRouteItem, DynamicFC, StaticFC } from 'ssr-types'
import { serialize } from 'ssr-serialize-javascript'
Expand Down
8 changes: 1 addition & 7 deletions packages/utils/src/server/loadConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ const loadConfig = (): IConfig => {
'~': getCwd(),
'~/src': join(cwd, './src'),
_build: join(cwd, './build')
}, framework === 'ssr-plugin-react' ? {
'react-dom': loadModuleFromFramework('react-dom'),
'react-router': loadModuleFromFramework('react-router'),
'react-router-dom': loadModuleFromFramework('react-router-dom'),
'react/jsx-runtime': loadModuleFromFramework('react/jsx-runtime'),
'react/jsx-dev-runtime': loadModuleFromFramework('react/jsx-dev-runtime')
} : {
}, framework === 'ssr-plugin-react' ? {} : {
vue$: framework === 'ssr-plugin-vue' ? 'vue/dist/vue.runtime.esm.js' : 'vue/dist/vue.runtime.esm-bundler.js'
}, userConfig.alias)

Expand Down

0 comments on commit 5eac01d

Please sign in to comment.