mirror of https://github.com/webpack/webpack.git
Merge pull request #15542 from wangjinyang/bugfix/mf-hmr-error
fix hrm error when works with Module federation
This commit is contained in:
commit
2a58ce7883
|
|
@ -73,9 +73,9 @@ class RemoteRuntimeModule extends RuntimeModule {
|
|||
Template.indent(
|
||||
`error.message += '\\nwhile loading "' + data[1] + '" from ' + data[2];`
|
||||
),
|
||||
`__webpack_modules__[id] = ${runtimeTemplate.basicFunction("", [
|
||||
"throw error;"
|
||||
])}`,
|
||||
`${
|
||||
RuntimeGlobals.moduleFactories
|
||||
}[id] = ${runtimeTemplate.basicFunction("", ["throw error;"])}`,
|
||||
"data.p = 0;"
|
||||
])};`,
|
||||
`var handleFunction = ${runtimeTemplate.basicFunction(
|
||||
|
|
@ -111,10 +111,11 @@ class RemoteRuntimeModule extends RuntimeModule {
|
|||
)};`,
|
||||
`var onFactory = ${runtimeTemplate.basicFunction("factory", [
|
||||
"data.p = 1;",
|
||||
`__webpack_modules__[id] = ${runtimeTemplate.basicFunction(
|
||||
"module",
|
||||
["module.exports = factory();"]
|
||||
)}`
|
||||
`${
|
||||
RuntimeGlobals.moduleFactories
|
||||
}[id] = ${runtimeTemplate.basicFunction("module", [
|
||||
"module.exports = factory();"
|
||||
])}`
|
||||
])};`,
|
||||
"handleFunction(__webpack_require__, data[2], 0, 0, onExternal, 1);"
|
||||
])});`
|
||||
|
|
|
|||
Loading…
Reference in New Issue