Skip to content

Commit b3cf692

Browse files
authored
Merge pull request #2335 from didi/fix-rn-loadChunkAsync
fix: 修复RN异步分包加载global未被正常处理
2 parents ff8d973 + 76097de commit b3cf692

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/webpack-plugin/lib/react/LoadAsyncChunkModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class LoadAsyncChunkRuntimeModule extends HelperRuntimeModule {
5454
]),
5555
'}',
5656
`var timeout = setTimeout(callback.bind(null, 'timeout'), ${this.timeout})`,
57-
'var loadChunkAsyncFn = global.__mpx.config.rnConfig && global.__mpx.config.rnConfig.loadChunkAsync',
57+
`var loadChunkAsyncFn = ${RuntimeGlobals.global}.__mpx.config.rnConfig && ${RuntimeGlobals.global}.__mpx.config.rnConfig.loadChunkAsync`,
5858
'try {',
5959
Template.indent([
6060
'loadChunkAsyncFn(config).then(callback).catch(callback)'

0 commit comments

Comments
 (0)