@mpxjs/webpack-plugin 2.10.18-beta.8 → 2.10.18-beta.9

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
@@ -654,7 +654,7 @@ class MpxWebpackPlugin {
654
654
  }, (chunk, set) => {
655
655
  compilation.addRuntimeModule(
656
656
  chunk,
657
- new LoadAsyncChunkModule(this.options.rnConfig && this.options.rnConfig.asyncChunk && this.options.rnConfig.asyncChunk.timeout)
657
+ new LoadAsyncChunkModule()
658
658
  )
659
659
  return true
660
660
  })
@@ -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 (timeout) {
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, result) {',
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 = ${RuntimeGlobals.global}.__mpx.config.rnConfig && ${RuntimeGlobals.global}.__mpx.config.rnConfig.loadChunkAsync`,
58
55
  'try {',
59
56
  Template.indent([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.10.18-beta.8",
3
+ "version": "2.10.18-beta.9",
4
4
  "description": "mpx compile core",
5
5
  "keywords": [
6
6
  "mpx"