mirror of https://github.com/webpack/webpack.git
allow to merge multiple hmr updates which calling hot.check while previous update is ready
This commit is contained in:
parent
3dbbdcb28c
commit
1266d76956
|
@ -276,6 +276,7 @@ const { isSourceEqual } = require("./util/source");
|
||||||
* @typedef {Object} PathData
|
* @typedef {Object} PathData
|
||||||
* @property {ChunkGraph=} chunkGraph
|
* @property {ChunkGraph=} chunkGraph
|
||||||
* @property {string=} hash
|
* @property {string=} hash
|
||||||
|
* @property {string=} index
|
||||||
* @property {function(number): string=} hashWithLength
|
* @property {function(number): string=} hashWithLength
|
||||||
* @property {(Chunk|ChunkPathData)=} chunk
|
* @property {(Chunk|ChunkPathData)=} chunk
|
||||||
* @property {(Module|ModulePathData)=} module
|
* @property {(Module|ModulePathData)=} module
|
||||||
|
@ -831,7 +832,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
||||||
/** @type {SyncHook<[Chunk, string]>} */
|
/** @type {SyncHook<[Chunk, string]>} */
|
||||||
chunkAsset: new SyncHook(["chunk", "filename"]),
|
chunkAsset: new SyncHook(["chunk", "filename"]),
|
||||||
|
|
||||||
/** @type {SyncWaterfallHook<[string, object, AssetInfo]>} */
|
/** @type {SyncWaterfallHook<[string, PathData, AssetInfo]>} */
|
||||||
assetPath: new SyncWaterfallHook(["path", "options", "assetInfo"]),
|
assetPath: new SyncWaterfallHook(["path", "options", "assetInfo"]),
|
||||||
|
|
||||||
/** @type {SyncBailHook<[], boolean>} */
|
/** @type {SyncBailHook<[], boolean>} */
|
||||||
|
@ -996,6 +997,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
||||||
/** @private @type {Map<string, Module>} */
|
/** @private @type {Map<string, Module>} */
|
||||||
this._modules = new Map();
|
this._modules = new Map();
|
||||||
this.records = null;
|
this.records = null;
|
||||||
|
/** @type {string | undefined} */
|
||||||
|
this.hash = undefined;
|
||||||
|
/** @type {string | undefined} */
|
||||||
|
this.fullHash = undefined;
|
||||||
|
/** @type {number | undefined} */
|
||||||
|
this.index = undefined;
|
||||||
/** @type {string[]} */
|
/** @type {string[]} */
|
||||||
this.additionalChunkAssets = [];
|
this.additionalChunkAssets = [];
|
||||||
/** @type {CompilationAssets} */
|
/** @type {CompilationAssets} */
|
||||||
|
@ -2781,6 +2788,11 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
||||||
ChunkGraph.setChunkGraphForModule(module, chunkGraph);
|
ChunkGraph.setChunkGraphForModule(module, chunkGraph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.index =
|
||||||
|
this.records && this.records.index !== undefined
|
||||||
|
? this.records.index + 1
|
||||||
|
: 0;
|
||||||
|
|
||||||
this.hooks.seal.call();
|
this.hooks.seal.call();
|
||||||
|
|
||||||
this.logger.time("optimize dependencies");
|
this.logger.time("optimize dependencies");
|
||||||
|
@ -3056,6 +3068,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
||||||
|
|
||||||
this.summarizeDependencies();
|
this.summarizeDependencies();
|
||||||
if (shouldRecord) {
|
if (shouldRecord) {
|
||||||
|
this.records.index = this.index;
|
||||||
this.hooks.record.call(this, this.records);
|
this.hooks.record.call(this, this.records);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4442,6 +4455,7 @@ This prevents using hashes of each other and should be avoided.`);
|
||||||
try {
|
try {
|
||||||
manifest = this.getRenderManifest({
|
manifest = this.getRenderManifest({
|
||||||
chunk,
|
chunk,
|
||||||
|
index: `${this.index}`,
|
||||||
hash: this.hash,
|
hash: this.hash,
|
||||||
fullHash: this.fullHash,
|
fullHash: this.fullHash,
|
||||||
outputOptions,
|
outputOptions,
|
||||||
|
@ -4586,9 +4600,10 @@ This prevents using hashes of each other and should be avoided.`);
|
||||||
* @returns {string} interpolated path
|
* @returns {string} interpolated path
|
||||||
*/
|
*/
|
||||||
getPath(filename, data = {}) {
|
getPath(filename, data = {}) {
|
||||||
if (!data.hash) {
|
if (!data.hash || !data.index) {
|
||||||
data = {
|
data = {
|
||||||
hash: this.hash,
|
hash: this.hash,
|
||||||
|
index: `${this.index}`,
|
||||||
...data
|
...data
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -4601,9 +4616,10 @@ This prevents using hashes of each other and should be avoided.`);
|
||||||
* @returns {{ path: string, info: AssetInfo }} interpolated path and asset info
|
* @returns {{ path: string, info: AssetInfo }} interpolated path and asset info
|
||||||
*/
|
*/
|
||||||
getPathWithInfo(filename, data = {}) {
|
getPathWithInfo(filename, data = {}) {
|
||||||
if (!data.hash) {
|
if (!data.hash || !data.index) {
|
||||||
data = {
|
data = {
|
||||||
hash: this.hash,
|
hash: this.hash,
|
||||||
|
index: `${this.index}`,
|
||||||
...data
|
...data
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,8 @@ const JavascriptParser = require("./javascript/JavascriptParser");
|
||||||
const {
|
const {
|
||||||
evaluateToIdentifier
|
evaluateToIdentifier
|
||||||
} = require("./javascript/JavascriptParserHelpers");
|
} = require("./javascript/JavascriptParserHelpers");
|
||||||
|
const CompilationIndexRuntimeModule = require("./runtime/CompilationIndexRuntimeModule");
|
||||||
|
const GetFullHashRuntimeModule = require("./runtime/GetFullHashRuntimeModule");
|
||||||
const { find, isSubset } = require("./util/SetHelpers");
|
const { find, isSubset } = require("./util/SetHelpers");
|
||||||
const TupleSet = require("./util/TupleSet");
|
const TupleSet = require("./util/TupleSet");
|
||||||
const { compareModulesById } = require("./util/comparators");
|
const { compareModulesById } = require("./util/comparators");
|
||||||
|
@ -48,6 +50,10 @@ const {
|
||||||
* @property {SyncBailHook<[TODO, string[]], void>} hotAcceptWithoutCallback
|
* @property {SyncBailHook<[TODO, string[]], void>} hotAcceptWithoutCallback
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const isOutOfBandModule = module =>
|
||||||
|
module instanceof CompilationIndexRuntimeModule ||
|
||||||
|
module instanceof GetFullHashRuntimeModule;
|
||||||
|
|
||||||
/** @type {WeakMap<JavascriptParser, HMRJavascriptParserHooks>} */
|
/** @type {WeakMap<JavascriptParser, HMRJavascriptParserHooks>} */
|
||||||
const parserHooksMap = new WeakMap();
|
const parserHooksMap = new WeakMap();
|
||||||
|
|
||||||
|
@ -342,6 +348,7 @@ class HotModuleReplacementPlugin {
|
||||||
chunkGraph.getChunkFullHashModulesSet(chunk);
|
chunkGraph.getChunkFullHashModulesSet(chunk);
|
||||||
if (fullHashModulesInThisChunk !== undefined) {
|
if (fullHashModulesInThisChunk !== undefined) {
|
||||||
for (const module of fullHashModulesInThisChunk) {
|
for (const module of fullHashModulesInThisChunk) {
|
||||||
|
if (isOutOfBandModule(module)) continue;
|
||||||
fullHashModules.add(module, chunk);
|
fullHashModules.add(module, chunk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -350,6 +357,7 @@ class HotModuleReplacementPlugin {
|
||||||
if (records.chunkModuleHashes) {
|
if (records.chunkModuleHashes) {
|
||||||
if (fullHashModulesInThisChunk !== undefined) {
|
if (fullHashModulesInThisChunk !== undefined) {
|
||||||
for (const module of modules) {
|
for (const module of modules) {
|
||||||
|
if (isOutOfBandModule(module)) continue;
|
||||||
const key = `${chunk.id}|${module.identifier()}`;
|
const key = `${chunk.id}|${module.identifier()}`;
|
||||||
const hash = getModuleHash(module);
|
const hash = getModuleHash(module);
|
||||||
if (
|
if (
|
||||||
|
@ -370,6 +378,7 @@ class HotModuleReplacementPlugin {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (const module of modules) {
|
for (const module of modules) {
|
||||||
|
if (isOutOfBandModule(module)) continue;
|
||||||
const key = `${chunk.id}|${module.identifier()}`;
|
const key = `${chunk.id}|${module.identifier()}`;
|
||||||
const hash = getModuleHash(module);
|
const hash = getModuleHash(module);
|
||||||
if (records.chunkModuleHashes[key] !== hash) {
|
if (records.chunkModuleHashes[key] !== hash) {
|
||||||
|
@ -381,6 +390,7 @@ class HotModuleReplacementPlugin {
|
||||||
} else {
|
} else {
|
||||||
if (fullHashModulesInThisChunk !== undefined) {
|
if (fullHashModulesInThisChunk !== undefined) {
|
||||||
for (const module of modules) {
|
for (const module of modules) {
|
||||||
|
if (isOutOfBandModule(module)) continue;
|
||||||
const key = `${chunk.id}|${module.identifier()}`;
|
const key = `${chunk.id}|${module.identifier()}`;
|
||||||
const hash = getModuleHash(module);
|
const hash = getModuleHash(module);
|
||||||
if (
|
if (
|
||||||
|
@ -452,6 +462,7 @@ class HotModuleReplacementPlugin {
|
||||||
compilation.outputOptions.hotUpdateMainFilename,
|
compilation.outputOptions.hotUpdateMainFilename,
|
||||||
{
|
{
|
||||||
hash: records.hash,
|
hash: records.hash,
|
||||||
|
index: `${records.index}`,
|
||||||
runtime
|
runtime
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -625,6 +636,7 @@ class HotModuleReplacementPlugin {
|
||||||
chunk: hotUpdateChunk,
|
chunk: hotUpdateChunk,
|
||||||
hash: records.hash,
|
hash: records.hash,
|
||||||
fullHash: records.hash,
|
fullHash: records.hash,
|
||||||
|
index: `${records.index}`,
|
||||||
outputOptions: compilation.outputOptions,
|
outputOptions: compilation.outputOptions,
|
||||||
moduleTemplates: compilation.moduleTemplates,
|
moduleTemplates: compilation.moduleTemplates,
|
||||||
dependencyTemplates: compilation.dependencyTemplates,
|
dependencyTemplates: compilation.dependencyTemplates,
|
||||||
|
@ -710,6 +722,8 @@ To fix this, make sure to include [runtime] in the output.hotUpdateMainFilename
|
||||||
{ removedChunkIds, removedModules, updatedChunkIds, assetInfo }
|
{ removedChunkIds, removedModules, updatedChunkIds, assetInfo }
|
||||||
] of hotUpdateMainContentByFilename) {
|
] of hotUpdateMainContentByFilename) {
|
||||||
const hotUpdateMainJson = {
|
const hotUpdateMainJson = {
|
||||||
|
n: compilation.index,
|
||||||
|
h: compilation.hash,
|
||||||
c: Array.from(updatedChunkIds),
|
c: Array.from(updatedChunkIds),
|
||||||
r: Array.from(removedChunkIds),
|
r: Array.from(removedChunkIds),
|
||||||
m:
|
m:
|
||||||
|
|
|
@ -140,6 +140,11 @@ exports.nodeModuleDecorator = "__webpack_require__.nmd";
|
||||||
*/
|
*/
|
||||||
exports.getFullHash = "__webpack_require__.h";
|
exports.getFullHash = "__webpack_require__.h";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the compilation index
|
||||||
|
*/
|
||||||
|
exports.compilationIndex = "__webpack_require__.N";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* an object containing all installed WebAssembly.Instance export objects keyed by module id
|
* an object containing all installed WebAssembly.Instance export objects keyed by module id
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,6 +12,7 @@ const AsyncModuleRuntimeModule = require("./runtime/AsyncModuleRuntimeModule");
|
||||||
const AutoPublicPathRuntimeModule = require("./runtime/AutoPublicPathRuntimeModule");
|
const AutoPublicPathRuntimeModule = require("./runtime/AutoPublicPathRuntimeModule");
|
||||||
const CompatGetDefaultExportRuntimeModule = require("./runtime/CompatGetDefaultExportRuntimeModule");
|
const CompatGetDefaultExportRuntimeModule = require("./runtime/CompatGetDefaultExportRuntimeModule");
|
||||||
const CompatRuntimeModule = require("./runtime/CompatRuntimeModule");
|
const CompatRuntimeModule = require("./runtime/CompatRuntimeModule");
|
||||||
|
const CompilationIndexRuntimeModule = require("./runtime/CompilationIndexRuntimeModule");
|
||||||
const CreateFakeNamespaceObjectRuntimeModule = require("./runtime/CreateFakeNamespaceObjectRuntimeModule");
|
const CreateFakeNamespaceObjectRuntimeModule = require("./runtime/CreateFakeNamespaceObjectRuntimeModule");
|
||||||
const CreateScriptUrlRuntimeModule = require("./runtime/CreateScriptUrlRuntimeModule");
|
const CreateScriptUrlRuntimeModule = require("./runtime/CreateScriptUrlRuntimeModule");
|
||||||
const DefinePropertyGettersRuntimeModule = require("./runtime/DefinePropertyGettersRuntimeModule");
|
const DefinePropertyGettersRuntimeModule = require("./runtime/DefinePropertyGettersRuntimeModule");
|
||||||
|
@ -44,6 +45,7 @@ const GLOBALS_ON_REQUIRE = [
|
||||||
RuntimeGlobals.ensureChunk,
|
RuntimeGlobals.ensureChunk,
|
||||||
RuntimeGlobals.entryModuleId,
|
RuntimeGlobals.entryModuleId,
|
||||||
RuntimeGlobals.getFullHash,
|
RuntimeGlobals.getFullHash,
|
||||||
|
RuntimeGlobals.compilationIndex,
|
||||||
RuntimeGlobals.global,
|
RuntimeGlobals.global,
|
||||||
RuntimeGlobals.makeNamespaceObject,
|
RuntimeGlobals.makeNamespaceObject,
|
||||||
RuntimeGlobals.moduleCache,
|
RuntimeGlobals.moduleCache,
|
||||||
|
@ -84,6 +86,16 @@ const TREE_DEPENDENCIES = {
|
||||||
[RuntimeGlobals.shareScopeMap]: [RuntimeGlobals.hasOwnProperty]
|
[RuntimeGlobals.shareScopeMap]: [RuntimeGlobals.hasOwnProperty]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleRuntimeModuleAssetPath = (assetPath, runtimeRequirements) => {
|
||||||
|
if (typeof assetPath !== "string") return;
|
||||||
|
if (/\[(full)?hash(:\d+)?\]/.test(assetPath)) {
|
||||||
|
runtimeRequirements.add(RuntimeGlobals.getFullHash);
|
||||||
|
}
|
||||||
|
if (/\[index\]/.test(assetPath)) {
|
||||||
|
runtimeRequirements.add(RuntimeGlobals.compilationIndex);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class RuntimePlugin {
|
class RuntimePlugin {
|
||||||
/**
|
/**
|
||||||
* @param {Compiler} compiler the Compiler
|
* @param {Compiler} compiler the Compiler
|
||||||
|
@ -203,6 +215,15 @@ class RuntimePlugin {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
compilation.hooks.runtimeRequirementInTree
|
||||||
|
.for(RuntimeGlobals.compilationIndex)
|
||||||
|
.tap("RuntimePlugin", chunk => {
|
||||||
|
compilation.addRuntimeModule(
|
||||||
|
chunk,
|
||||||
|
new CompilationIndexRuntimeModule(compilation.index)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
compilation.hooks.runtimeRequirementInTree
|
compilation.hooks.runtimeRequirementInTree
|
||||||
.for(RuntimeGlobals.global)
|
.for(RuntimeGlobals.global)
|
||||||
.tap("RuntimePlugin", chunk => {
|
.tap("RuntimePlugin", chunk => {
|
||||||
|
@ -229,14 +250,10 @@ class RuntimePlugin {
|
||||||
compilation.hooks.runtimeRequirementInTree
|
compilation.hooks.runtimeRequirementInTree
|
||||||
.for(RuntimeGlobals.getChunkScriptFilename)
|
.for(RuntimeGlobals.getChunkScriptFilename)
|
||||||
.tap("RuntimePlugin", (chunk, set) => {
|
.tap("RuntimePlugin", (chunk, set) => {
|
||||||
if (
|
handleRuntimeModuleAssetPath(
|
||||||
typeof compilation.outputOptions.chunkFilename === "string" &&
|
compilation.outputOptions.chunkFilename,
|
||||||
/\[(full)?hash(:\d+)?\]/.test(
|
set
|
||||||
compilation.outputOptions.chunkFilename
|
);
|
||||||
)
|
|
||||||
) {
|
|
||||||
set.add(RuntimeGlobals.getFullHash);
|
|
||||||
}
|
|
||||||
compilation.addRuntimeModule(
|
compilation.addRuntimeModule(
|
||||||
chunk,
|
chunk,
|
||||||
new GetChunkFilenameRuntimeModule(
|
new GetChunkFilenameRuntimeModule(
|
||||||
|
@ -256,12 +273,10 @@ class RuntimePlugin {
|
||||||
compilation.hooks.runtimeRequirementInTree
|
compilation.hooks.runtimeRequirementInTree
|
||||||
.for(RuntimeGlobals.getChunkUpdateScriptFilename)
|
.for(RuntimeGlobals.getChunkUpdateScriptFilename)
|
||||||
.tap("RuntimePlugin", (chunk, set) => {
|
.tap("RuntimePlugin", (chunk, set) => {
|
||||||
if (
|
handleRuntimeModuleAssetPath(
|
||||||
/\[(full)?hash(:\d+)?\]/.test(
|
compilation.outputOptions.hotUpdateChunkFilename,
|
||||||
compilation.outputOptions.hotUpdateChunkFilename
|
set
|
||||||
)
|
);
|
||||||
)
|
|
||||||
set.add(RuntimeGlobals.getFullHash);
|
|
||||||
compilation.addRuntimeModule(
|
compilation.addRuntimeModule(
|
||||||
chunk,
|
chunk,
|
||||||
new GetChunkFilenameRuntimeModule(
|
new GetChunkFilenameRuntimeModule(
|
||||||
|
@ -277,13 +292,10 @@ class RuntimePlugin {
|
||||||
compilation.hooks.runtimeRequirementInTree
|
compilation.hooks.runtimeRequirementInTree
|
||||||
.for(RuntimeGlobals.getUpdateManifestFilename)
|
.for(RuntimeGlobals.getUpdateManifestFilename)
|
||||||
.tap("RuntimePlugin", (chunk, set) => {
|
.tap("RuntimePlugin", (chunk, set) => {
|
||||||
if (
|
handleRuntimeModuleAssetPath(
|
||||||
/\[(full)?hash(:\d+)?\]/.test(
|
compilation.outputOptions.hotUpdateMainFilename,
|
||||||
compilation.outputOptions.hotUpdateMainFilename
|
set
|
||||||
)
|
);
|
||||||
) {
|
|
||||||
set.add(RuntimeGlobals.getFullHash);
|
|
||||||
}
|
|
||||||
compilation.addRuntimeModule(
|
compilation.addRuntimeModule(
|
||||||
chunk,
|
chunk,
|
||||||
new GetMainFilenameRuntimeModule(
|
new GetMainFilenameRuntimeModule(
|
||||||
|
|
|
@ -41,6 +41,7 @@ const MATCH_PADDED_HYPHENS_REPLACE_REGEX = /^-|-$/g;
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} RenderManifestOptions
|
* @typedef {Object} RenderManifestOptions
|
||||||
* @property {Chunk} chunk the chunk used to render
|
* @property {Chunk} chunk the chunk used to render
|
||||||
|
* @property {string} index
|
||||||
* @property {string} hash
|
* @property {string} hash
|
||||||
* @property {string} fullHash
|
* @property {string} fullHash
|
||||||
* @property {OutputOptions} outputOptions
|
* @property {OutputOptions} outputOptions
|
||||||
|
|
|
@ -147,6 +147,7 @@ const replacePathVariables = (path, data, assetInfo) => {
|
||||||
// Placeholders
|
// Placeholders
|
||||||
//
|
//
|
||||||
// [fullhash] - data.hash (3a4b5c6e7f)
|
// [fullhash] - data.hash (3a4b5c6e7f)
|
||||||
|
// [index] - data.index (14)
|
||||||
//
|
//
|
||||||
// Legacy Placeholders
|
// Legacy Placeholders
|
||||||
//
|
//
|
||||||
|
@ -171,6 +172,9 @@ const replacePathVariables = (path, data, assetInfo) => {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (data.index) {
|
||||||
|
replacements.set("index", replacer(data.index));
|
||||||
|
}
|
||||||
|
|
||||||
// Chunk Context
|
// Chunk Context
|
||||||
//
|
//
|
||||||
|
|
|
@ -808,9 +808,17 @@ const applyOutputDefaults = (
|
||||||
D(
|
D(
|
||||||
output,
|
output,
|
||||||
"hotUpdateChunkFilename",
|
"hotUpdateChunkFilename",
|
||||||
`[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`
|
futureDefaults
|
||||||
|
? `[id].[index].hot-update.${output.module ? "mjs" : "js"}`
|
||||||
|
: `[id].[fullhash].hot-update.${output.module ? "mjs" : "js"}`
|
||||||
|
);
|
||||||
|
D(
|
||||||
|
output,
|
||||||
|
"hotUpdateMainFilename",
|
||||||
|
futureDefaults
|
||||||
|
? "[runtime].[index].hot-update.json"
|
||||||
|
: "[runtime].[fullhash].hot-update.json"
|
||||||
);
|
);
|
||||||
D(output, "hotUpdateMainFilename", "[runtime].[fullhash].hot-update.json");
|
|
||||||
D(output, "crossOriginLoading", false);
|
D(output, "crossOriginLoading", false);
|
||||||
F(output, "scriptType", () => (output.module ? "module" : false));
|
F(output, "scriptType", () => (output.module ? "module" : false));
|
||||||
D(
|
D(
|
||||||
|
|
|
@ -8,6 +8,10 @@
|
||||||
var $interceptModuleExecution$ = undefined;
|
var $interceptModuleExecution$ = undefined;
|
||||||
var $moduleCache$ = undefined;
|
var $moduleCache$ = undefined;
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
var $getFullHash$ = undefined;
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
var $compilationIndex$ = undefined;
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
var $hmrModuleData$ = undefined;
|
var $hmrModuleData$ = undefined;
|
||||||
/** @type {() => Promise} */
|
/** @type {() => Promise} */
|
||||||
var $hmrDownloadManifest$ = undefined;
|
var $hmrDownloadManifest$ = undefined;
|
||||||
|
@ -26,12 +30,15 @@ module.exports = function () {
|
||||||
// status
|
// status
|
||||||
var registeredStatusHandlers = [];
|
var registeredStatusHandlers = [];
|
||||||
var currentStatus = "idle";
|
var currentStatus = "idle";
|
||||||
|
var additionalUpdate = false;
|
||||||
|
|
||||||
// while downloading
|
// while downloading
|
||||||
var blockingPromises;
|
var blockingPromises;
|
||||||
|
|
||||||
// The update info
|
// The update info
|
||||||
var currentUpdateApplyHandlers;
|
var currentUpdateApplyHandlers;
|
||||||
|
var currentUpdateCompilationIndex;
|
||||||
|
var currentUpdateCompilationHash;
|
||||||
var queuedInvalidatedModules;
|
var queuedInvalidatedModules;
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
@ -200,6 +207,12 @@ module.exports = function () {
|
||||||
var idx = registeredStatusHandlers.indexOf(l);
|
var idx = registeredStatusHandlers.indexOf(l);
|
||||||
if (idx >= 0) registeredStatusHandlers.splice(idx, 1);
|
if (idx >= 0) registeredStatusHandlers.splice(idx, 1);
|
||||||
},
|
},
|
||||||
|
getUpdateIndex: function () {
|
||||||
|
return currentUpdateCompilationIndex;
|
||||||
|
},
|
||||||
|
getUpdateHash: function () {
|
||||||
|
return currentUpdateCompilationHash;
|
||||||
|
},
|
||||||
|
|
||||||
//inherit from previous dispose call
|
//inherit from previous dispose call
|
||||||
data: currentModuleData[moduleId]
|
data: currentModuleData[moduleId]
|
||||||
|
@ -230,6 +243,9 @@ module.exports = function () {
|
||||||
case "prepare":
|
case "prepare":
|
||||||
blockingPromises.push(promise);
|
blockingPromises.push(promise);
|
||||||
return promise;
|
return promise;
|
||||||
|
case "check":
|
||||||
|
if (additionalUpdate) blockingPromises.push(promise);
|
||||||
|
return promise;
|
||||||
default:
|
default:
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
@ -244,25 +260,51 @@ module.exports = function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function hotCheck(applyOnUpdate) {
|
function applyOutOfBandInfo() {
|
||||||
if (currentStatus !== "idle") {
|
if (currentUpdateCompilationIndex !== undefined) {
|
||||||
throw new Error("check() is only allowed in idle status");
|
$compilationIndex$ = currentUpdateCompilationIndex;
|
||||||
|
currentUpdateCompilationIndex = undefined;
|
||||||
}
|
}
|
||||||
|
if (currentUpdateCompilationHash !== undefined) {
|
||||||
|
var value = currentUpdateCompilationHash;
|
||||||
|
$getFullHash$ = function () {
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
currentUpdateCompilationHash = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function hotCheck(applyOnUpdate) {
|
||||||
|
if (currentStatus !== "idle" && currentStatus !== "ready") {
|
||||||
|
throw new Error("check() is only allowed in idle or ready status");
|
||||||
|
}
|
||||||
|
additionalUpdate = currentStatus === "ready";
|
||||||
|
// apply outstanding compilation index update to get the new hot update files
|
||||||
|
applyOutOfBandInfo();
|
||||||
return setStatus("check")
|
return setStatus("check")
|
||||||
.then($hmrDownloadManifest$)
|
.then($hmrDownloadManifest$)
|
||||||
.then(function (update) {
|
.then(function (update) {
|
||||||
if (!update) {
|
if (!update) {
|
||||||
return setStatus(applyInvalidatedModules() ? "ready" : "idle").then(
|
return waitForBlockingPromises(function () {
|
||||||
|
additionalUpdate = applyInvalidatedModules() || additionalUpdate;
|
||||||
|
if (additionalUpdate && applyOnUpdate) {
|
||||||
|
return internalApply(applyOnUpdate);
|
||||||
|
} else {
|
||||||
|
return setStatus(additionalUpdate ? "ready" : "idle").then(
|
||||||
function () {
|
function () {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return setStatus("prepare").then(function () {
|
return setStatus("prepare").then(function () {
|
||||||
var updatedModules = [];
|
var updatedModules = [];
|
||||||
blockingPromises = [];
|
blockingPromises = [];
|
||||||
currentUpdateApplyHandlers = [];
|
if (!currentUpdateApplyHandlers) currentUpdateApplyHandlers = [];
|
||||||
|
currentUpdateCompilationIndex = update.n;
|
||||||
|
currentUpdateCompilationHash = update.h;
|
||||||
|
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
Object.keys($hmrDownloadUpdateHandlers$).reduce(function (
|
Object.keys($hmrDownloadUpdateHandlers$).reduce(function (
|
||||||
|
@ -308,6 +350,7 @@ module.exports = function () {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
applyInvalidatedModules();
|
applyInvalidatedModules();
|
||||||
|
applyOutOfBandInfo();
|
||||||
|
|
||||||
var results = currentUpdateApplyHandlers.map(function (handler) {
|
var results = currentUpdateApplyHandlers.map(function (handler) {
|
||||||
return handler(options);
|
return handler(options);
|
||||||
|
|
|
@ -21,6 +21,7 @@ class HotModuleReplacementRuntimeModule extends RuntimeModule {
|
||||||
require("./HotModuleReplacement.runtime.js")
|
require("./HotModuleReplacement.runtime.js")
|
||||||
)
|
)
|
||||||
.replace(/\$getFullHash\$/g, RuntimeGlobals.getFullHash)
|
.replace(/\$getFullHash\$/g, RuntimeGlobals.getFullHash)
|
||||||
|
.replace(/\$compilationIndex\$/g, RuntimeGlobals.compilationIndex)
|
||||||
.replace(
|
.replace(
|
||||||
/\$interceptModuleExecution\$/g,
|
/\$interceptModuleExecution\$/g,
|
||||||
RuntimeGlobals.interceptModuleExecution
|
RuntimeGlobals.interceptModuleExecution
|
||||||
|
|
|
@ -295,6 +295,7 @@ module.exports = function () {
|
||||||
for (var i = 0; i < currentUpdateRuntime.length; i++) {
|
for (var i = 0; i < currentUpdateRuntime.length; i++) {
|
||||||
currentUpdateRuntime[i](__webpack_require__);
|
currentUpdateRuntime[i](__webpack_require__);
|
||||||
}
|
}
|
||||||
|
currentUpdateRuntime = undefined;
|
||||||
|
|
||||||
// call accept handlers
|
// call accept handlers
|
||||||
for (var outdatedModuleId in outdatedDependencies) {
|
for (var outdatedModuleId in outdatedDependencies) {
|
||||||
|
@ -428,14 +429,20 @@ module.exports = function () {
|
||||||
applyHandlers,
|
applyHandlers,
|
||||||
updatedModulesList
|
updatedModulesList
|
||||||
) {
|
) {
|
||||||
applyHandlers.push(applyHandler);
|
if (!currentUpdate) {
|
||||||
currentUpdateChunks = {};
|
currentUpdate = {};
|
||||||
currentUpdateRemovedChunks = removedChunks;
|
|
||||||
currentUpdate = removedModules.reduce(function (obj, key) {
|
|
||||||
obj[key] = false;
|
|
||||||
return obj;
|
|
||||||
}, {});
|
|
||||||
currentUpdateRuntime = [];
|
currentUpdateRuntime = [];
|
||||||
|
currentUpdateRemovedChunks = [];
|
||||||
|
applyHandlers.push(applyHandler);
|
||||||
|
}
|
||||||
|
currentUpdateChunks = {};
|
||||||
|
currentUpdateRemovedChunks.push.apply(
|
||||||
|
currentUpdateRemovedChunks,
|
||||||
|
removedChunks
|
||||||
|
);
|
||||||
|
removedModules.forEach(function (key) {
|
||||||
|
currentUpdate[key] = false;
|
||||||
|
});
|
||||||
chunkIds.forEach(function (chunkId) {
|
chunkIds.forEach(function (chunkId) {
|
||||||
if (
|
if (
|
||||||
$hasOwnProperty$($installedChunks$, chunkId) &&
|
$hasOwnProperty$($installedChunks$, chunkId) &&
|
||||||
|
|
|
@ -231,6 +231,7 @@ class JavascriptModulesPlugin {
|
||||||
"JavascriptModulesPlugin",
|
"JavascriptModulesPlugin",
|
||||||
(result, options) => {
|
(result, options) => {
|
||||||
const {
|
const {
|
||||||
|
index,
|
||||||
hash,
|
hash,
|
||||||
chunk,
|
chunk,
|
||||||
chunkGraph,
|
chunkGraph,
|
||||||
|
@ -305,6 +306,7 @@ class JavascriptModulesPlugin {
|
||||||
filenameTemplate,
|
filenameTemplate,
|
||||||
pathOptions: {
|
pathOptions: {
|
||||||
hash,
|
hash,
|
||||||
|
index,
|
||||||
runtime: chunk.runtime,
|
runtime: chunk.runtime,
|
||||||
chunk,
|
chunk,
|
||||||
contentHashType: "javascript"
|
contentHashType: "javascript"
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
||||||
|
const RuntimeModule = require("../RuntimeModule");
|
||||||
|
|
||||||
|
class CompilationIndexRuntimeModule extends RuntimeModule {
|
||||||
|
/**
|
||||||
|
* @param {number} compilationIndex the compilation index
|
||||||
|
*/
|
||||||
|
constructor(compilationIndex) {
|
||||||
|
super("compilation index");
|
||||||
|
this.compilationIndex = compilationIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {string} runtime code
|
||||||
|
*/
|
||||||
|
generate() {
|
||||||
|
return `${RuntimeGlobals.compilationIndex} = ${this.compilationIndex};`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = CompilationIndexRuntimeModule;
|
|
@ -144,6 +144,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
|
||||||
)
|
)
|
||||||
: JSON.stringify(chunkFilename);
|
: JSON.stringify(chunkFilename);
|
||||||
const staticChunkFilename = compilation.getPath(chunkFilenameValue, {
|
const staticChunkFilename = compilation.getPath(chunkFilenameValue, {
|
||||||
|
index: `" + ${RuntimeGlobals.compilationIndex} + "`,
|
||||||
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
||||||
hashWithLength: length =>
|
hashWithLength: length =>
|
||||||
`" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
|
`" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
|
||||||
|
@ -229,6 +230,7 @@ class GetChunkFilenameRuntimeModule extends RuntimeModule {
|
||||||
const url =
|
const url =
|
||||||
dynamicFilename &&
|
dynamicFilename &&
|
||||||
compilation.getPath(JSON.stringify(dynamicFilename), {
|
compilation.getPath(JSON.stringify(dynamicFilename), {
|
||||||
|
index: `" + ${RuntimeGlobals.compilationIndex} + "`,
|
||||||
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
||||||
hashWithLength: length =>
|
hashWithLength: length =>
|
||||||
`" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
|
`" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
|
||||||
|
|
|
@ -29,6 +29,7 @@ class GetMainFilenameRuntimeModule extends RuntimeModule {
|
||||||
const { global, filename, compilation, chunk } = this;
|
const { global, filename, compilation, chunk } = this;
|
||||||
const { runtimeTemplate } = compilation;
|
const { runtimeTemplate } = compilation;
|
||||||
const url = compilation.getPath(JSON.stringify(filename), {
|
const url = compilation.getPath(JSON.stringify(filename), {
|
||||||
|
index: `" + ${RuntimeGlobals.compilationIndex} + "`,
|
||||||
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
||||||
hashWithLength: length =>
|
hashWithLength: length =>
|
||||||
`" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
|
`" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
|
||||||
|
|
|
@ -26,6 +26,7 @@ class AsyncWasmLoadingRuntimeModule extends RuntimeModule {
|
||||||
const wasmModuleSrcPath = compilation.getPath(
|
const wasmModuleSrcPath = compilation.getPath(
|
||||||
JSON.stringify(outputOptions.webassemblyModuleFilename),
|
JSON.stringify(outputOptions.webassemblyModuleFilename),
|
||||||
{
|
{
|
||||||
|
index: `" + ${RuntimeGlobals.compilationIndex} + "`,
|
||||||
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
||||||
hashWithLength: length =>
|
hashWithLength: length =>
|
||||||
`" + ${RuntimeGlobals.getFullHash}}().slice(0, ${length}) + "`,
|
`" + ${RuntimeGlobals.getFullHash}}().slice(0, ${length}) + "`,
|
||||||
|
|
|
@ -233,6 +233,7 @@ class WasmChunkLoadingRuntimeModule extends RuntimeModule {
|
||||||
const wasmModuleSrcPath = compilation.getPath(
|
const wasmModuleSrcPath = compilation.getPath(
|
||||||
JSON.stringify(outputOptions.webassemblyModuleFilename),
|
JSON.stringify(outputOptions.webassemblyModuleFilename),
|
||||||
{
|
{
|
||||||
|
index: `" + ${RuntimeGlobals.compilationIndex} + "`,
|
||||||
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
|
||||||
hashWithLength: length =>
|
hashWithLength: length =>
|
||||||
`" + ${RuntimeGlobals.getFullHash}}().slice(0, ${length}) + "`,
|
`" + ${RuntimeGlobals.getFullHash}}().slice(0, ${length}) + "`,
|
||||||
|
|
|
@ -274,9 +274,8 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
||||||
"",
|
"",
|
||||||
withHmr
|
withHmr
|
||||||
? Template.asString([
|
? Template.asString([
|
||||||
"var currentUpdatedModulesList;",
|
|
||||||
"var waitingUpdateResolves = {};",
|
"var waitingUpdateResolves = {};",
|
||||||
"function loadUpdateChunk(chunkId) {",
|
"function loadUpdateChunk(chunkId, updatedModulesList) {",
|
||||||
Template.indent([
|
Template.indent([
|
||||||
`return new Promise(${runtimeTemplate.basicFunction(
|
`return new Promise(${runtimeTemplate.basicFunction(
|
||||||
"resolve, reject",
|
"resolve, reject",
|
||||||
|
@ -302,6 +301,9 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
||||||
])};`,
|
])};`,
|
||||||
`${RuntimeGlobals.loadScript}(url, loadingEnded);`
|
`${RuntimeGlobals.loadScript}(url, loadingEnded);`
|
||||||
]
|
]
|
||||||
|
)}).then(${runtimeTemplate.basicFunction(
|
||||||
|
"updatedModules",
|
||||||
|
"if(updatedModulesList) updatedModulesList.push.apply(updatedModulesList, updatedModules);"
|
||||||
)});`
|
)});`
|
||||||
]),
|
]),
|
||||||
"}",
|
"}",
|
||||||
|
@ -311,12 +313,13 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
||||||
)}] = ${runtimeTemplate.basicFunction(
|
)}] = ${runtimeTemplate.basicFunction(
|
||||||
"chunkId, moreModules, runtime",
|
"chunkId, moreModules, runtime",
|
||||||
[
|
[
|
||||||
|
"var updatedModules = [];",
|
||||||
"for(var moduleId in moreModules) {",
|
"for(var moduleId in moreModules) {",
|
||||||
Template.indent([
|
Template.indent([
|
||||||
`if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`,
|
`if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`,
|
||||||
Template.indent([
|
Template.indent([
|
||||||
"currentUpdate[moduleId] = moreModules[moduleId];",
|
"currentUpdate[moduleId] = moreModules[moduleId];",
|
||||||
"if(currentUpdatedModulesList) currentUpdatedModulesList.push(moduleId);"
|
"updatedModules.push(moduleId);"
|
||||||
]),
|
]),
|
||||||
"}"
|
"}"
|
||||||
]),
|
]),
|
||||||
|
@ -324,7 +327,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
|
||||||
"if(runtime) currentUpdateRuntime.push(runtime);",
|
"if(runtime) currentUpdateRuntime.push(runtime);",
|
||||||
"if(waitingUpdateResolves[chunkId]) {",
|
"if(waitingUpdateResolves[chunkId]) {",
|
||||||
Template.indent([
|
Template.indent([
|
||||||
"waitingUpdateResolves[chunkId]();",
|
"waitingUpdateResolves[chunkId](updatedModules);",
|
||||||
"waitingUpdateResolves[chunkId] = undefined;"
|
"waitingUpdateResolves[chunkId] = undefined;"
|
||||||
]),
|
]),
|
||||||
"}"
|
"}"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports = [[/Module parse failed/]];
|
|
@ -0,0 +1,34 @@
|
||||||
|
import value from "./module";
|
||||||
|
import value2 from "./module2";
|
||||||
|
|
||||||
|
import.meta.webpackHot.accept("./module");
|
||||||
|
import.meta.webpackHot.accept("./module2");
|
||||||
|
|
||||||
|
it("should merge multiple updates when not using apply", done => {
|
||||||
|
expect(value).toBe(42);
|
||||||
|
expect(value2).toBe(42);
|
||||||
|
NEXT(err => {
|
||||||
|
if (err) return done(err);
|
||||||
|
NEXT(err => {
|
||||||
|
if (err) return done(err);
|
||||||
|
module.hot
|
||||||
|
.check()
|
||||||
|
.then(updatedModules => {
|
||||||
|
expect(updatedModules).toEqual(["./module.js", "./module2.js"]);
|
||||||
|
return module.hot.check(true).then(updatedModules => {
|
||||||
|
expect(updatedModules).toEqual(["./module.js", "./module2.js"]);
|
||||||
|
try {
|
||||||
|
expect(value).toBe(43);
|
||||||
|
expect(value2).toBe(43);
|
||||||
|
} catch (e) {
|
||||||
|
return done(e);
|
||||||
|
}
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
done(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,6 @@
|
||||||
|
export default 42;
|
||||||
|
---
|
||||||
|
throw new Error("Invalid")
|
||||||
|
export default 0;
|
||||||
|
---
|
||||||
|
export default 43
|
|
@ -0,0 +1,6 @@
|
||||||
|
export default 42;
|
||||||
|
---
|
||||||
|
}}}
|
||||||
|
export default 0;
|
||||||
|
---
|
||||||
|
export default 43
|
|
@ -1424,7 +1424,7 @@ declare class Compilation {
|
||||||
chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
|
chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
|
||||||
moduleAsset: SyncHook<[Module, string]>;
|
moduleAsset: SyncHook<[Module, string]>;
|
||||||
chunkAsset: SyncHook<[Chunk, string]>;
|
chunkAsset: SyncHook<[Chunk, string]>;
|
||||||
assetPath: SyncWaterfallHook<[string, object, AssetInfo]>;
|
assetPath: SyncWaterfallHook<[string, PathData, AssetInfo]>;
|
||||||
needAdditionalPass: SyncBailHook<[], boolean>;
|
needAdditionalPass: SyncBailHook<[], boolean>;
|
||||||
childCompiler: SyncHook<[Compiler, string, number]>;
|
childCompiler: SyncHook<[Compiler, string, number]>;
|
||||||
log: SyncBailHook<[string, LogEntry], true>;
|
log: SyncBailHook<[string, LogEntry], true>;
|
||||||
|
@ -1491,6 +1491,9 @@ declare class Compilation {
|
||||||
namedChunks: Map<string, Chunk>;
|
namedChunks: Map<string, Chunk>;
|
||||||
modules: Set<Module>;
|
modules: Set<Module>;
|
||||||
records: any;
|
records: any;
|
||||||
|
hash?: string;
|
||||||
|
fullHash?: string;
|
||||||
|
index?: number;
|
||||||
additionalChunkAssets: string[];
|
additionalChunkAssets: string[];
|
||||||
assets: CompilationAssets;
|
assets: CompilationAssets;
|
||||||
assetsInfo: Map<string, AssetInfo>;
|
assetsInfo: Map<string, AssetInfo>;
|
||||||
|
@ -1667,8 +1670,6 @@ declare class Compilation {
|
||||||
runtime: RuntimeSpec;
|
runtime: RuntimeSpec;
|
||||||
runtimes: RuntimeSpec[];
|
runtimes: RuntimeSpec[];
|
||||||
}[];
|
}[];
|
||||||
fullHash?: string;
|
|
||||||
hash?: string;
|
|
||||||
emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
|
emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
|
||||||
updateAsset(
|
updateAsset(
|
||||||
file: string,
|
file: string,
|
||||||
|
@ -8611,6 +8612,7 @@ declare interface ParserStateBase {
|
||||||
declare interface PathData {
|
declare interface PathData {
|
||||||
chunkGraph?: ChunkGraph;
|
chunkGraph?: ChunkGraph;
|
||||||
hash?: string;
|
hash?: string;
|
||||||
|
index?: string;
|
||||||
hashWithLength?: (arg0: number) => string;
|
hashWithLength?: (arg0: number) => string;
|
||||||
chunk?: Chunk | ChunkPathData;
|
chunk?: Chunk | ChunkPathData;
|
||||||
module?: Module | ModulePathData;
|
module?: Module | ModulePathData;
|
||||||
|
@ -9056,6 +9058,7 @@ declare interface RenderManifestOptions {
|
||||||
* the chunk used to render
|
* the chunk used to render
|
||||||
*/
|
*/
|
||||||
chunk: Chunk;
|
chunk: Chunk;
|
||||||
|
index: string;
|
||||||
hash: string;
|
hash: string;
|
||||||
fullHash: string;
|
fullHash: string;
|
||||||
outputOptions: Output;
|
outputOptions: Output;
|
||||||
|
@ -11419,7 +11422,7 @@ declare interface UpdateHashContextGenerator {
|
||||||
chunkGraph: ChunkGraph;
|
chunkGraph: ChunkGraph;
|
||||||
runtime: RuntimeSpec;
|
runtime: RuntimeSpec;
|
||||||
}
|
}
|
||||||
type UsageStateType = 0 | 1 | 2 | 3 | 4;
|
type UsageStateType = 0 | 2 | 3 | 1 | 4;
|
||||||
declare interface UserResolveOptions {
|
declare interface UserResolveOptions {
|
||||||
/**
|
/**
|
||||||
* A list of module alias configurations or an object which maps key to value
|
* A list of module alias configurations or an object which maps key to value
|
||||||
|
@ -12179,6 +12182,7 @@ declare namespace exports {
|
||||||
export let harmonyModuleDecorator: string;
|
export let harmonyModuleDecorator: string;
|
||||||
export let nodeModuleDecorator: string;
|
export let nodeModuleDecorator: string;
|
||||||
export let getFullHash: string;
|
export let getFullHash: string;
|
||||||
|
export let compilationIndex: string;
|
||||||
export let wasmInstances: string;
|
export let wasmInstances: string;
|
||||||
export let instantiateWasm: string;
|
export let instantiateWasm: string;
|
||||||
export let uncaughtErrorHandler: string;
|
export let uncaughtErrorHandler: string;
|
||||||
|
|
Loading…
Reference in New Issue