@rspack-canary/core 1.7.0-canary-a2d4dc73-20251231074311 → 1.7.0-canary-b303a917-20251231130755

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.
Files changed (182) hide show
  1. package/dist/BuildInfo.d.ts +4 -4
  2. package/dist/Chunk.d.ts +3 -3
  3. package/dist/ChunkGraph.d.ts +3 -3
  4. package/dist/Chunks.d.ts +2 -2
  5. package/dist/Compilation.d.ts +40 -40
  6. package/dist/Compiler.d.ts +23 -25
  7. package/dist/ConcatenatedModule.d.ts +1 -1
  8. package/dist/ContextModule.d.ts +1 -1
  9. package/dist/ContextModuleFactory.d.ts +2 -2
  10. package/dist/Diagnostics.d.ts +2 -2
  11. package/dist/Entrypoint.d.ts +1 -1
  12. package/dist/ExecuteModulePlugin.d.ts +1 -1
  13. package/dist/ExportsInfo.d.ts +2 -2
  14. package/dist/ExternalModule.d.ts +1 -1
  15. package/dist/FileSystem.d.ts +3 -3
  16. package/dist/Module.d.ts +6 -6
  17. package/dist/ModuleGraph.d.ts +3 -3
  18. package/dist/MultiCompiler.d.ts +8 -8
  19. package/dist/MultiStats.d.ts +3 -3
  20. package/dist/MultiWatching.d.ts +3 -3
  21. package/dist/NativeWatchFileSystem.d.ts +5 -5
  22. package/dist/NormalModule.d.ts +6 -6
  23. package/dist/NormalModuleFactory.d.ts +4 -4
  24. package/dist/Resolver.d.ts +2 -2
  25. package/dist/ResolverFactory.d.ts +3 -3
  26. package/dist/RspackError.d.ts +2 -2
  27. package/dist/RuntimeGlobals.d.ts +2 -2
  28. package/dist/RuntimeModule.d.ts +4 -4
  29. package/dist/Stats.d.ts +4 -4
  30. package/dist/VirtualModulesPlugin.d.ts +1 -1
  31. package/dist/Watching.d.ts +5 -5
  32. package/dist/builtin-loader/index.d.ts +1 -1
  33. package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +1 -1
  34. package/dist/builtin-loader/swc/index.d.ts +5 -5
  35. package/dist/builtin-loader/swc/types.d.ts +8 -10
  36. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +10 -5
  38. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
  39. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
  41. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +2 -2
  42. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  43. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +4 -4
  44. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +3 -3
  46. package/dist/builtin-plugin/EntryPlugin.d.ts +3 -3
  47. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/ExternalsPlugin.d.ts +3 -3
  51. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +2 -2
  52. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +3 -3
  53. package/dist/builtin-plugin/HttpUriPlugin.d.ts +4 -4
  54. package/dist/builtin-plugin/IgnorePlugin.d.ts +4 -4
  55. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +6 -6
  56. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  57. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +2 -2
  58. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
  59. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
  60. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
  61. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
  62. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
  65. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -8
  66. package/dist/builtin-plugin/RslibPlugin.d.ts +2 -2
  67. package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
  68. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/RuntimePlugin.d.ts +5 -5
  70. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  71. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +4 -4
  72. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +5 -5
  73. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -3
  74. package/dist/builtin-plugin/{CaseSensitivePlugin.d.ts → WarnCaseSensitiveModulesPlugin.d.ts} +1 -1
  75. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +3 -3
  76. package/dist/builtin-plugin/WorkerPlugin.d.ts +4 -4
  77. package/dist/builtin-plugin/base.d.ts +3 -3
  78. package/dist/builtin-plugin/css-extract/index.d.ts +7 -7
  79. package/dist/builtin-plugin/css-extract/loader.d.ts +2 -2
  80. package/dist/builtin-plugin/css-extract/utils.d.ts +1 -1
  81. package/dist/builtin-plugin/html-plugin/hooks.d.ts +4 -4
  82. package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
  83. package/dist/builtin-plugin/html-plugin/options.d.ts +6 -6
  84. package/dist/builtin-plugin/html-plugin/plugin.d.ts +5 -5
  85. package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
  86. package/dist/builtin-plugin/index.d.ts +88 -84
  87. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
  88. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
  89. package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
  90. package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +10 -0
  91. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +10 -0
  92. package/dist/builtin-plugin/rsc/index.d.ts +15 -0
  93. package/dist/config/adapter.d.ts +7 -7
  94. package/dist/config/adapterRuleUse.d.ts +16 -16
  95. package/dist/config/browserslistTargetHandler.d.ts +1 -1
  96. package/dist/config/defaults.d.ts +2 -11
  97. package/dist/config/devServer.d.ts +32 -32
  98. package/dist/config/index.d.ts +5 -5
  99. package/dist/config/normalization.d.ts +9 -9
  100. package/dist/config/target.d.ts +7 -7
  101. package/dist/config/types.d.ts +74 -75
  102. package/dist/container/ContainerPlugin.d.ts +4 -4
  103. package/dist/container/ContainerReferencePlugin.d.ts +4 -4
  104. package/dist/container/ModuleFederationManifestPlugin.d.ts +3 -3
  105. package/dist/container/ModuleFederationPlugin.d.ts +6 -6
  106. package/dist/container/ModuleFederationPluginV1.d.ts +5 -5
  107. package/dist/container/index.d.ts +4 -4
  108. package/dist/cssExtractHmr.js +19 -19
  109. package/dist/cssExtractLoader.js +16 -16
  110. package/dist/exports.d.ts +74 -76
  111. package/dist/index.d.ts +3 -3
  112. package/dist/index.js +1943 -1892
  113. package/dist/lib/AbstractMethodError.d.ts +1 -1
  114. package/dist/lib/Cache.d.ts +2 -2
  115. package/dist/lib/CacheFacade.d.ts +3 -3
  116. package/dist/lib/DllPlugin.d.ts +1 -1
  117. package/dist/lib/DllReferencePlugin.d.ts +5 -5
  118. package/dist/lib/EntryOptionPlugin.d.ts +2 -2
  119. package/dist/lib/EnvironmentPlugin.d.ts +1 -1
  120. package/dist/lib/HookWebpackError.d.ts +2 -2
  121. package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
  122. package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
  123. package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
  124. package/dist/lib/WebpackError.d.ts +3 -3
  125. package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
  126. package/dist/lib/cache/getLazyHashedEtag.d.ts +1 -1
  127. package/dist/lib/cache/mergeEtags.d.ts +1 -1
  128. package/dist/loader-runner/ModuleError.d.ts +1 -1
  129. package/dist/loader-runner/index.d.ts +3 -3
  130. package/dist/loader-runner/loadLoader.d.ts +2 -2
  131. package/dist/loader-runner/service.d.ts +8 -8
  132. package/dist/loader-runner/utils.d.ts +3 -3
  133. package/dist/loader-runner/worker.d.ts +3 -3
  134. package/dist/logging/createConsoleLogger.d.ts +4 -4
  135. package/dist/moduleFederationDefaultRuntime.js +1 -1
  136. package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
  137. package/dist/node/NodeTemplatePlugin.d.ts +1 -1
  138. package/dist/node/NodeWatchFileSystem.d.ts +3 -3
  139. package/dist/node/nodeConsole.d.ts +2 -2
  140. package/dist/rspack.d.ts +6 -15
  141. package/dist/rspackOptionsApply.d.ts +1 -1
  142. package/dist/sharing/ConsumeSharedPlugin.d.ts +3 -3
  143. package/dist/sharing/ProvideSharedPlugin.d.ts +4 -4
  144. package/dist/sharing/SharePlugin.d.ts +1 -1
  145. package/dist/sharing/ShareRuntimePlugin.d.ts +3 -3
  146. package/dist/stats/DefaultStatsFactoryPlugin.d.ts +15 -15
  147. package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
  148. package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
  149. package/dist/stats/StatsFactory.d.ts +5 -5
  150. package/dist/stats/StatsPrinter.d.ts +3 -3
  151. package/dist/stats/statsFactoryUtils.d.ts +5 -5
  152. package/dist/swc.d.ts +2 -2
  153. package/dist/taps/compilation.d.ts +2 -2
  154. package/dist/taps/compiler.d.ts +1 -1
  155. package/dist/taps/contextModuleFactory.d.ts +1 -1
  156. package/dist/taps/index.d.ts +6 -6
  157. package/dist/taps/javascriptModules.d.ts +1 -1
  158. package/dist/taps/normalModuleFactory.d.ts +1 -1
  159. package/dist/taps/types.d.ts +3 -3
  160. package/dist/trace/index.d.ts +4 -4
  161. package/dist/trace/traceHookPlugin.d.ts +1 -1
  162. package/dist/util/SplitChunkSize.d.ts +1 -1
  163. package/dist/util/createHash.d.ts +1 -1
  164. package/dist/util/createReadonlyMap.d.ts +1 -1
  165. package/dist/util/fs.d.ts +14 -14
  166. package/dist/util/hash/wasm-hash.d.ts +1 -1
  167. package/dist/util/identifier.d.ts +1 -1
  168. package/dist/util/index.d.ts +1 -2
  169. package/dist/util/source.d.ts +2 -2
  170. package/dist/util/validateConfig.d.ts +1 -1
  171. package/dist/worker.js +111 -111
  172. package/hot/dev-server.js +64 -64
  173. package/hot/emitter.js +11 -11
  174. package/hot/lazy-compilation-node.js +41 -41
  175. package/hot/lazy-compilation-web.js +52 -52
  176. package/hot/log-apply-result.js +36 -36
  177. package/hot/log.js +30 -30
  178. package/hot/only-dev-server.js +92 -92
  179. package/hot/poll.js +31 -31
  180. package/hot/signal.js +53 -53
  181. package/module.d.ts +215 -215
  182. package/package.json +4 -4
@@ -4,100 +4,100 @@
4
4
  */
5
5
  /*globals __webpack_hash__ */
6
6
  if (module.hot) {
7
- /** @type {undefined|string} */
8
- var lastHash;
9
- var upToDate = function upToDate() {
10
- return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
11
- };
12
- var log = require('./log');
13
- var check = function check() {
14
- module.hot
15
- .check()
16
- .then(function (updatedModules) {
17
- if (!updatedModules) {
18
- log('warning', '[HMR] Cannot find update. Need to do a full reload!');
19
- log(
20
- 'warning',
21
- '[HMR] (Probably because of restarting the webpack-dev-server)',
22
- );
23
- return;
24
- }
7
+ /** @type {undefined|string} */
8
+ var lastHash;
9
+ var upToDate = function upToDate() {
10
+ return /** @type {string} */ (lastHash).indexOf(__webpack_hash__) >= 0;
11
+ };
12
+ var log = require("./log");
13
+ var check = function check() {
14
+ module.hot
15
+ .check()
16
+ .then(function (updatedModules) {
17
+ if (!updatedModules) {
18
+ log("warning", "[HMR] Cannot find update. Need to do a full reload!");
19
+ log(
20
+ "warning",
21
+ "[HMR] (Probably because of restarting the webpack-dev-server)"
22
+ );
23
+ return;
24
+ }
25
25
 
26
- return module.hot
27
- .apply({
28
- ignoreUnaccepted: true,
29
- ignoreDeclined: true,
30
- ignoreErrored: true,
31
- onUnaccepted: function (data) {
32
- log(
33
- 'warning',
34
- 'Ignored an update to unaccepted module ' +
35
- data.chain.join(' -> '),
36
- );
37
- },
38
- onDeclined: function (data) {
39
- log(
40
- 'warning',
41
- 'Ignored an update to declined module ' +
42
- data.chain.join(' -> '),
43
- );
44
- },
45
- onErrored: function (data) {
46
- log('error', data.error);
47
- log(
48
- 'warning',
49
- 'Ignored an error while updating module ' +
50
- data.moduleId +
51
- ' (' +
52
- data.type +
53
- ')',
54
- );
55
- },
56
- })
57
- .then(function (renewedModules) {
58
- if (!upToDate()) {
59
- check();
60
- }
26
+ return module.hot
27
+ .apply({
28
+ ignoreUnaccepted: true,
29
+ ignoreDeclined: true,
30
+ ignoreErrored: true,
31
+ onUnaccepted: function (data) {
32
+ log(
33
+ "warning",
34
+ "Ignored an update to unaccepted module " +
35
+ data.chain.join(" -> ")
36
+ );
37
+ },
38
+ onDeclined: function (data) {
39
+ log(
40
+ "warning",
41
+ "Ignored an update to declined module " +
42
+ data.chain.join(" -> ")
43
+ );
44
+ },
45
+ onErrored: function (data) {
46
+ log("error", data.error);
47
+ log(
48
+ "warning",
49
+ "Ignored an error while updating module " +
50
+ data.moduleId +
51
+ " (" +
52
+ data.type +
53
+ ")"
54
+ );
55
+ }
56
+ })
57
+ .then(function (renewedModules) {
58
+ if (!upToDate()) {
59
+ check();
60
+ }
61
61
 
62
- require('./log-apply-result')(updatedModules, renewedModules);
62
+ require("./log-apply-result")(updatedModules, renewedModules);
63
63
 
64
- if (upToDate()) {
65
- log('info', '[HMR] App is up to date.');
66
- }
67
- });
68
- })
69
- .catch(function (err) {
70
- var status = module.hot.status();
71
- if (['abort', 'fail'].indexOf(status) >= 0) {
72
- log(
73
- 'warning',
74
- '[HMR] Cannot check for update. Need to do a full reload!',
75
- );
76
- log('warning', '[HMR] ' + log.formatError(err));
77
- } else {
78
- log('warning', '[HMR] Update check failed: ' + log.formatError(err));
79
- }
80
- });
81
- };
82
- var hotEmitter = require('./emitter');
83
- hotEmitter.on('webpackHotUpdate', function (currentHash) {
84
- lastHash = currentHash;
85
- if (!upToDate()) {
86
- var status = module.hot.status();
87
- if (status === 'idle') {
88
- log('info', '[HMR] Checking for updates on the server...');
89
- check();
90
- } else if (['abort', 'fail'].indexOf(status) >= 0) {
91
- log(
92
- 'warning',
93
- '[HMR] Cannot apply update as a previous update ' +
94
- status +
95
- 'ed. Need to do a full reload!',
96
- );
97
- }
98
- }
99
- });
100
- log('info', '[HMR] Waiting for update signal from WDS...');
64
+ if (upToDate()) {
65
+ log("info", "[HMR] App is up to date.");
66
+ }
67
+ });
68
+ })
69
+ .catch(function (err) {
70
+ var status = module.hot.status();
71
+ if (["abort", "fail"].indexOf(status) >= 0) {
72
+ log(
73
+ "warning",
74
+ "[HMR] Cannot check for update. Need to do a full reload!"
75
+ );
76
+ log("warning", "[HMR] " + log.formatError(err));
77
+ } else {
78
+ log("warning", "[HMR] Update check failed: " + log.formatError(err));
79
+ }
80
+ });
81
+ };
82
+ var hotEmitter = require("./emitter");
83
+ hotEmitter.on("webpackHotUpdate", function (currentHash) {
84
+ lastHash = currentHash;
85
+ if (!upToDate()) {
86
+ var status = module.hot.status();
87
+ if (status === "idle") {
88
+ log("info", "[HMR] Checking for updates on the server...");
89
+ check();
90
+ } else if (["abort", "fail"].indexOf(status) >= 0) {
91
+ log(
92
+ "warning",
93
+ "[HMR] Cannot apply update as a previous update " +
94
+ status +
95
+ "ed. Need to do a full reload!"
96
+ );
97
+ }
98
+ }
99
+ });
100
+ log("info", "[HMR] Waiting for update signal from WDS...");
101
101
  } else {
102
- throw new Error('[HMR] Hot Module Replacement is disabled.');
102
+ throw new Error("[HMR] Hot Module Replacement is disabled.");
103
103
  }
package/hot/poll.js CHANGED
@@ -4,37 +4,37 @@
4
4
  */
5
5
  /*globals __resourceQuery */
6
6
  if (module.hot) {
7
- var hotPollInterval = +__resourceQuery.slice(1) || 10 * 60 * 1000;
8
- var log = require('./log');
7
+ var hotPollInterval = +__resourceQuery.slice(1) || 10 * 60 * 1000;
8
+ var log = require("./log");
9
9
 
10
- /**
11
- * @param {boolean=} fromUpdate true when called from update
12
- */
13
- var checkForUpdate = function checkForUpdate(fromUpdate) {
14
- if (module.hot.status() === 'idle') {
15
- module.hot
16
- .check(true)
17
- .then(function (updatedModules) {
18
- if (!updatedModules) {
19
- if (fromUpdate) log('info', '[HMR] Update applied.');
20
- return;
21
- }
22
- require('./log-apply-result')(updatedModules, updatedModules);
23
- checkForUpdate(true);
24
- })
25
- .catch(function (err) {
26
- var status = module.hot.status();
27
- if (['abort', 'fail'].indexOf(status) >= 0) {
28
- log('warning', '[HMR] Cannot apply update.');
29
- log('warning', '[HMR] ' + log.formatError(err));
30
- log('warning', '[HMR] You need to restart the application!');
31
- } else {
32
- log('warning', '[HMR] Update failed: ' + log.formatError(err));
33
- }
34
- });
35
- }
36
- };
37
- setInterval(checkForUpdate, hotPollInterval);
10
+ /**
11
+ * @param {boolean=} fromUpdate true when called from update
12
+ */
13
+ var checkForUpdate = function checkForUpdate(fromUpdate) {
14
+ if (module.hot.status() === "idle") {
15
+ module.hot
16
+ .check(true)
17
+ .then(function (updatedModules) {
18
+ if (!updatedModules) {
19
+ if (fromUpdate) log("info", "[HMR] Update applied.");
20
+ return;
21
+ }
22
+ require("./log-apply-result")(updatedModules, updatedModules);
23
+ checkForUpdate(true);
24
+ })
25
+ .catch(function (err) {
26
+ var status = module.hot.status();
27
+ if (["abort", "fail"].indexOf(status) >= 0) {
28
+ log("warning", "[HMR] Cannot apply update.");
29
+ log("warning", "[HMR] " + log.formatError(err));
30
+ log("warning", "[HMR] You need to restart the application!");
31
+ } else {
32
+ log("warning", "[HMR] Update failed: " + log.formatError(err));
33
+ }
34
+ });
35
+ }
36
+ };
37
+ setInterval(checkForUpdate, hotPollInterval);
38
38
  } else {
39
- throw new Error('[HMR] Hot Module Replacement is disabled.');
39
+ throw new Error("[HMR] Hot Module Replacement is disabled.");
40
40
  }
package/hot/signal.js CHANGED
@@ -4,63 +4,63 @@
4
4
  */
5
5
  /*globals __resourceQuery */
6
6
  if (module.hot) {
7
- var log = require('./log');
7
+ var log = require("./log");
8
8
 
9
- /**
10
- * @param {boolean=} fromUpdate true when called from update
11
- */
12
- var checkForUpdate = function checkForUpdate(fromUpdate) {
13
- module.hot
14
- .check()
15
- .then(function (updatedModules) {
16
- if (!updatedModules) {
17
- if (fromUpdate) log('info', '[HMR] Update applied.');
18
- else log('warning', '[HMR] Cannot find update.');
19
- return;
20
- }
9
+ /**
10
+ * @param {boolean=} fromUpdate true when called from update
11
+ */
12
+ var checkForUpdate = function checkForUpdate(fromUpdate) {
13
+ module.hot
14
+ .check()
15
+ .then(function (updatedModules) {
16
+ if (!updatedModules) {
17
+ if (fromUpdate) log("info", "[HMR] Update applied.");
18
+ else log("warning", "[HMR] Cannot find update.");
19
+ return;
20
+ }
21
21
 
22
- return module.hot
23
- .apply({
24
- ignoreUnaccepted: true,
25
- onUnaccepted: function (data) {
26
- log(
27
- 'warning',
28
- 'Ignored an update to unaccepted module ' +
29
- data.chain.join(' -> '),
30
- );
31
- },
32
- })
33
- .then(function (renewedModules) {
34
- require('./log-apply-result')(updatedModules, renewedModules);
22
+ return module.hot
23
+ .apply({
24
+ ignoreUnaccepted: true,
25
+ onUnaccepted: function (data) {
26
+ log(
27
+ "warning",
28
+ "Ignored an update to unaccepted module " +
29
+ data.chain.join(" -> ")
30
+ );
31
+ }
32
+ })
33
+ .then(function (renewedModules) {
34
+ require("./log-apply-result")(updatedModules, renewedModules);
35
35
 
36
- checkForUpdate(true);
37
- return null;
38
- });
39
- })
40
- .catch(function (err) {
41
- var status = module.hot.status();
42
- if (['abort', 'fail'].indexOf(status) >= 0) {
43
- log('warning', '[HMR] Cannot apply update.');
44
- log('warning', '[HMR] ' + log.formatError(err));
45
- log('warning', '[HMR] You need to restart the application!');
46
- } else {
47
- log('warning', '[HMR] Update failed: ' + (err.stack || err.message));
48
- }
49
- });
50
- };
36
+ checkForUpdate(true);
37
+ return null;
38
+ });
39
+ })
40
+ .catch(function (err) {
41
+ var status = module.hot.status();
42
+ if (["abort", "fail"].indexOf(status) >= 0) {
43
+ log("warning", "[HMR] Cannot apply update.");
44
+ log("warning", "[HMR] " + log.formatError(err));
45
+ log("warning", "[HMR] You need to restart the application!");
46
+ } else {
47
+ log("warning", "[HMR] Update failed: " + (err.stack || err.message));
48
+ }
49
+ });
50
+ };
51
51
 
52
- process.on(__resourceQuery.slice(1) || 'SIGUSR2', function () {
53
- if (module.hot.status() !== 'idle') {
54
- log(
55
- 'warning',
56
- '[HMR] Got signal but currently in ' + module.hot.status() + ' state.',
57
- );
58
- log('warning', '[HMR] Need to be in idle state to start hot update.');
59
- return;
60
- }
52
+ process.on(__resourceQuery.slice(1) || "SIGUSR2", function () {
53
+ if (module.hot.status() !== "idle") {
54
+ log(
55
+ "warning",
56
+ "[HMR] Got signal but currently in " + module.hot.status() + " state."
57
+ );
58
+ log("warning", "[HMR] Need to be in idle state to start hot update.");
59
+ return;
60
+ }
61
61
 
62
- checkForUpdate();
63
- });
62
+ checkForUpdate();
63
+ });
64
64
  } else {
65
- throw new Error('[HMR] Hot Module Replacement is disabled.');
65
+ throw new Error("[HMR] Hot Module Replacement is disabled.");
66
66
  }