@mpxjs/webpack-plugin 2.10.14-beta.20 → 2.10.14-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -638,7 +638,7 @@ class MpxWebpackPlugin {
|
|
|
638
638
|
}, (chunk, set) => {
|
|
639
639
|
compilation.addRuntimeModule(
|
|
640
640
|
chunk,
|
|
641
|
-
new LoadAsyncChunkModule(
|
|
641
|
+
new LoadAsyncChunkModule()
|
|
642
642
|
)
|
|
643
643
|
return true
|
|
644
644
|
})
|
|
@@ -3,9 +3,8 @@ const Template = require('webpack/lib/Template')
|
|
|
3
3
|
const HelperRuntimeModule = require('webpack/lib/runtime/HelperRuntimeModule')
|
|
4
4
|
|
|
5
5
|
class LoadAsyncChunkRuntimeModule extends HelperRuntimeModule {
|
|
6
|
-
constructor (
|
|
6
|
+
constructor () {
|
|
7
7
|
super('load async chunk')
|
|
8
|
-
this.timeout = timeout || 10000
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
generate () {
|
|
@@ -32,7 +31,7 @@ class LoadAsyncChunkRuntimeModule extends HelperRuntimeModule {
|
|
|
32
31
|
]),
|
|
33
32
|
'}',
|
|
34
33
|
'inProgress[url] = [done]',
|
|
35
|
-
'var callback = function (type
|
|
34
|
+
'var callback = function (type) {',
|
|
36
35
|
Template.indent([
|
|
37
36
|
'var event = {',
|
|
38
37
|
Template.indent([
|
|
@@ -45,7 +44,6 @@ class LoadAsyncChunkRuntimeModule extends HelperRuntimeModule {
|
|
|
45
44
|
]),
|
|
46
45
|
Template.indent([
|
|
47
46
|
'var doneFns = inProgress[url]',
|
|
48
|
-
'clearTimeout(timeout)',
|
|
49
47
|
'delete inProgress[url]',
|
|
50
48
|
`doneFns && doneFns.forEach(${runtimeTemplate.returningFunction(
|
|
51
49
|
'fn(event)',
|
|
@@ -53,7 +51,6 @@ class LoadAsyncChunkRuntimeModule extends HelperRuntimeModule {
|
|
|
53
51
|
)})`
|
|
54
52
|
]),
|
|
55
53
|
'}',
|
|
56
|
-
`var timeout = setTimeout(callback.bind(null, 'timeout'), ${this.timeout})`,
|
|
57
54
|
'var loadChunkAsyncFn = global.__mpx.config.rnConfig && global.__mpx.config.rnConfig.loadChunkAsync',
|
|
58
55
|
'try {',
|
|
59
56
|
Template.indent([
|