@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.
- package/dist/BuildInfo.d.ts +4 -4
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +3 -3
- package/dist/Chunks.d.ts +2 -2
- package/dist/Compilation.d.ts +40 -40
- package/dist/Compiler.d.ts +23 -25
- package/dist/ConcatenatedModule.d.ts +1 -1
- package/dist/ContextModule.d.ts +1 -1
- package/dist/ContextModuleFactory.d.ts +2 -2
- package/dist/Diagnostics.d.ts +2 -2
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExecuteModulePlugin.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +2 -2
- package/dist/ExternalModule.d.ts +1 -1
- package/dist/FileSystem.d.ts +3 -3
- package/dist/Module.d.ts +6 -6
- package/dist/ModuleGraph.d.ts +3 -3
- package/dist/MultiCompiler.d.ts +8 -8
- package/dist/MultiStats.d.ts +3 -3
- package/dist/MultiWatching.d.ts +3 -3
- package/dist/NativeWatchFileSystem.d.ts +5 -5
- package/dist/NormalModule.d.ts +6 -6
- package/dist/NormalModuleFactory.d.ts +4 -4
- package/dist/Resolver.d.ts +2 -2
- package/dist/ResolverFactory.d.ts +3 -3
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +2 -2
- package/dist/RuntimeModule.d.ts +4 -4
- package/dist/Stats.d.ts +4 -4
- package/dist/VirtualModulesPlugin.d.ts +1 -1
- package/dist/Watching.d.ts +5 -5
- package/dist/builtin-loader/index.d.ts +1 -1
- package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +1 -1
- package/dist/builtin-loader/swc/index.d.ts +5 -5
- package/dist/builtin-loader/swc/types.d.ts +8 -10
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +10 -5
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +2 -2
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +3 -3
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +4 -4
- package/dist/builtin-plugin/IgnorePlugin.d.ts +4 -4
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +6 -6
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -8
- package/dist/builtin-plugin/RslibPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +5 -5
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +4 -4
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +5 -5
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/{CaseSensitivePlugin.d.ts → WarnCaseSensitiveModulesPlugin.d.ts} +1 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +3 -3
- package/dist/builtin-plugin/WorkerPlugin.d.ts +4 -4
- package/dist/builtin-plugin/base.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/index.d.ts +7 -7
- package/dist/builtin-plugin/css-extract/loader.d.ts +2 -2
- package/dist/builtin-plugin/css-extract/utils.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +4 -4
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/options.d.ts +6 -6
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +5 -5
- package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +88 -84
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +10 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +10 -0
- package/dist/builtin-plugin/rsc/index.d.ts +15 -0
- package/dist/config/adapter.d.ts +7 -7
- package/dist/config/adapterRuleUse.d.ts +16 -16
- package/dist/config/browserslistTargetHandler.d.ts +1 -1
- package/dist/config/defaults.d.ts +2 -11
- package/dist/config/devServer.d.ts +32 -32
- package/dist/config/index.d.ts +5 -5
- package/dist/config/normalization.d.ts +9 -9
- package/dist/config/target.d.ts +7 -7
- package/dist/config/types.d.ts +74 -75
- package/dist/container/ContainerPlugin.d.ts +4 -4
- package/dist/container/ContainerReferencePlugin.d.ts +4 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +3 -3
- package/dist/container/ModuleFederationPlugin.d.ts +6 -6
- package/dist/container/ModuleFederationPluginV1.d.ts +5 -5
- package/dist/container/index.d.ts +4 -4
- package/dist/cssExtractHmr.js +19 -19
- package/dist/cssExtractLoader.js +16 -16
- package/dist/exports.d.ts +74 -76
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1943 -1892
- package/dist/lib/AbstractMethodError.d.ts +1 -1
- package/dist/lib/Cache.d.ts +2 -2
- package/dist/lib/CacheFacade.d.ts +3 -3
- package/dist/lib/DllPlugin.d.ts +1 -1
- package/dist/lib/DllReferencePlugin.d.ts +5 -5
- package/dist/lib/EntryOptionPlugin.d.ts +2 -2
- package/dist/lib/EnvironmentPlugin.d.ts +1 -1
- package/dist/lib/HookWebpackError.d.ts +2 -2
- package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
- package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
- package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
- package/dist/lib/WebpackError.d.ts +3 -3
- package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
- package/dist/lib/cache/getLazyHashedEtag.d.ts +1 -1
- package/dist/lib/cache/mergeEtags.d.ts +1 -1
- package/dist/loader-runner/ModuleError.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +3 -3
- package/dist/loader-runner/loadLoader.d.ts +2 -2
- package/dist/loader-runner/service.d.ts +8 -8
- package/dist/loader-runner/utils.d.ts +3 -3
- package/dist/loader-runner/worker.d.ts +3 -3
- package/dist/logging/createConsoleLogger.d.ts +4 -4
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
- package/dist/node/NodeTemplatePlugin.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +3 -3
- package/dist/node/nodeConsole.d.ts +2 -2
- package/dist/rspack.d.ts +6 -15
- package/dist/rspackOptionsApply.d.ts +1 -1
- package/dist/sharing/ConsumeSharedPlugin.d.ts +3 -3
- package/dist/sharing/ProvideSharedPlugin.d.ts +4 -4
- package/dist/sharing/SharePlugin.d.ts +1 -1
- package/dist/sharing/ShareRuntimePlugin.d.ts +3 -3
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +15 -15
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
- package/dist/stats/StatsFactory.d.ts +5 -5
- package/dist/stats/StatsPrinter.d.ts +3 -3
- package/dist/stats/statsFactoryUtils.d.ts +5 -5
- package/dist/swc.d.ts +2 -2
- package/dist/taps/compilation.d.ts +2 -2
- package/dist/taps/compiler.d.ts +1 -1
- package/dist/taps/contextModuleFactory.d.ts +1 -1
- package/dist/taps/index.d.ts +6 -6
- package/dist/taps/javascriptModules.d.ts +1 -1
- package/dist/taps/normalModuleFactory.d.ts +1 -1
- package/dist/taps/types.d.ts +3 -3
- package/dist/trace/index.d.ts +4 -4
- package/dist/trace/traceHookPlugin.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/createReadonlyMap.d.ts +1 -1
- package/dist/util/fs.d.ts +14 -14
- package/dist/util/hash/wasm-hash.d.ts +1 -1
- package/dist/util/identifier.d.ts +1 -1
- package/dist/util/index.d.ts +1 -2
- package/dist/util/source.d.ts +2 -2
- package/dist/util/validateConfig.d.ts +1 -1
- package/dist/worker.js +111 -111
- package/hot/dev-server.js +64 -64
- package/hot/emitter.js +11 -11
- package/hot/lazy-compilation-node.js +41 -41
- package/hot/lazy-compilation-web.js +52 -52
- package/hot/log-apply-result.js +36 -36
- package/hot/log.js +30 -30
- package/hot/only-dev-server.js +92 -92
- package/hot/poll.js +31 -31
- package/hot/signal.js +53 -53
- package/module.d.ts +215 -215
- package/package.json +4 -4
package/hot/only-dev-server.js
CHANGED
|
@@ -4,100 +4,100 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/*globals __webpack_hash__ */
|
|
6
6
|
if (module.hot) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
62
|
+
require("./log-apply-result")(updatedModules, renewedModules);
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
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
|
-
|
|
8
|
-
|
|
7
|
+
var hotPollInterval = +__resourceQuery.slice(1) || 10 * 60 * 1000;
|
|
8
|
+
var log = require("./log");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
+
var log = require("./log");
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
63
|
-
|
|
62
|
+
checkForUpdate();
|
|
63
|
+
});
|
|
64
64
|
} else {
|
|
65
|
-
|
|
65
|
+
throw new Error("[HMR] Hot Module Replacement is disabled.");
|
|
66
66
|
}
|