Skip to content

Commit

Permalink
fix: 被执行时才调用getManifest(),避免在入口立即调用getManifest() (#11718)
Browse files Browse the repository at this point in the history
* fix: dev环境构建SSR server.js时,环境判断错误导致输出的dev产物带上了hash

* Update packages/preset-umi/src/features/ssr/webpack/webpack.ts

Co-authored-by: chencheng (云谦) <[email protected]>

* fix: dev环境构建SSR server.js时,环境判断错误导致输出的dev产物带上了hash

* feature: 支持自定义SSR构建目标,默认为node,可配置为webworker以支持运行在类似Cloudflare Workers的平台
以解决 react-dom/server renderToReadableStream 不存在的问题

* feature: getManifest支持传入sourceDir表示SSR产物目录

* feature: getManifest支持传入sourceDir表示SSR产物目录

* fix: rendertoreadablestream is not a function

* Revert "feature: 支持自定义SSR构建目标,默认为node,可配置为webworker以支持运行在类似Cloudflare Workers的平台"

This reverts commit 5b0946a.

* fix: rendertoreadablestream is not a function

* Update packages/server/src/ssr.ts

Co-authored-by: 咲奈Sakina <[email protected]>

* Update packages/server/src/ssr.ts

Co-authored-by: 咲奈Sakina <[email protected]>

* fix: 还原g_getAssets

* fix: 被执行时才调用getManifest(),避免在入口立即调用getManifest()

* fix: 被执行时才调用getManifest(),避免在入口立即调用getManifest()

* fix: 被执行时才调用getManifest(),避免在入口立即调用getManifest()

---------

Co-authored-by: 奇风 <[email protected]>
Co-authored-by: chencheng (云谦) <[email protected]>
Co-authored-by: 咲奈Sakina <[email protected]>
  • Loading branch information
4 people authored Oct 10, 2023
1 parent 9bd959a commit 8d55ffb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/preset-umi/templates/server.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ export function createHistory(opts) {

// TODO: remove global variable
global.g_getAssets = (fileName) => {
let m = typeof manifest === 'function' ? manifest() : manifest;
let m = getManifest();
return m.assets[fileName];
};
const manifest = {{{ env }}} === 'development' ? getManifest : getManifest();
const createOpts = {
routesWithServerLoader,
PluginManager,
Expand Down

0 comments on commit 8d55ffb

Please sign in to comment.