mirror of https://github.com/webpack/webpack.git
reuse name variable in share scope
This commit is contained in:
parent
64f2bdb7a9
commit
4ed2ecfcff
|
|
@ -217,10 +217,8 @@ class ContainerEntryModule extends Module {
|
|||
])};`,
|
||||
`var init = ${runtimeTemplate.basicFunction("shareScope, initScope", [
|
||||
`if (!${RuntimeGlobals.shareScopeMap}) return;`,
|
||||
`var oldScope = ${RuntimeGlobals.shareScopeMap}[${JSON.stringify(
|
||||
this._shareScope
|
||||
)}];`,
|
||||
`var name = ${JSON.stringify(this._shareScope)}`,
|
||||
`var oldScope = ${RuntimeGlobals.shareScopeMap}[name];`,
|
||||
`if(oldScope && oldScope !== shareScope) throw new Error("Container initialization failed as it has already been initialized with a different share scope");`,
|
||||
`${RuntimeGlobals.shareScopeMap}[name] = shareScope;`,
|
||||
`return ${RuntimeGlobals.initializeSharing}(name, initScope);`
|
||||
|
|
|
|||
Loading…
Reference in New Issue