From 2d95f1b8d71bbb03b903e749f7357e67e29377e9 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 15 Apr 2020 10:51:03 +0200 Subject: [PATCH 01/30] refactor HMR javascript part to reduce duplication add invalidate to HMR API --- lib/RuntimeGlobals.js | 5 + lib/hmr/HotModuleReplacement.runtime.js | 73 +- lib/hmr/HotModuleReplacementRuntimeModule.js | 4 + .../JavascriptHotModuleReplacement.runtime.js | 693 ++++++++++-------- lib/node/ReadFileChunkLoadingRuntimeModule.js | 83 +-- lib/node/RequireChunkLoadingRuntimeModule.js | 81 +- lib/web/JsonpChunkLoadingRuntimeModule.js | 87 +-- .../ImportScriptsChunkLoadingRuntimeModule.js | 71 +- .../__snapshots__/StatsTestCases.test.js.snap | 266 +++---- .../invalidate/conditional-accept/data.json | 7 + .../invalidate/conditional-accept/index.js | 48 ++ .../invalidate/conditional-accept/module1.js | 16 + .../invalidate/conditional-accept/module2.js | 16 + .../invalidate/conditional-accept/store.js | 9 + test/hotCases/invalidate/during-idle/a.js | 5 + test/hotCases/invalidate/during-idle/b.js | 7 + test/hotCases/invalidate/during-idle/c.js | 11 + test/hotCases/invalidate/during-idle/index.js | 19 + .../hotCases/invalidate/during-idle/module.js | 7 + 19 files changed, 828 insertions(+), 680 deletions(-) create mode 100644 test/hotCases/invalidate/conditional-accept/data.json create mode 100644 test/hotCases/invalidate/conditional-accept/index.js create mode 100644 test/hotCases/invalidate/conditional-accept/module1.js create mode 100644 test/hotCases/invalidate/conditional-accept/module2.js create mode 100644 test/hotCases/invalidate/conditional-accept/store.js create mode 100644 test/hotCases/invalidate/during-idle/a.js create mode 100644 test/hotCases/invalidate/during-idle/b.js create mode 100644 test/hotCases/invalidate/during-idle/c.js create mode 100644 test/hotCases/invalidate/during-idle/index.js create mode 100644 test/hotCases/invalidate/during-idle/module.js diff --git a/lib/RuntimeGlobals.js b/lib/RuntimeGlobals.js index 455f3f7bc..ba41a92c3 100644 --- a/lib/RuntimeGlobals.js +++ b/lib/RuntimeGlobals.js @@ -215,6 +215,11 @@ exports.hmrDownloadUpdateHandlers = "__webpack_require__.hmrC"; */ exports.hmrModuleData = "__webpack_require__.hmrD"; +/** + * array with handler functions when a module should be invalidated + */ +exports.hmrInvalidateModuleHandlers = "__webpack_require__.hmrI"; + /** * the AMD define function */ diff --git a/lib/hmr/HotModuleReplacement.runtime.js b/lib/hmr/HotModuleReplacement.runtime.js index bee7650b7..6c7bbaa8d 100644 --- a/lib/hmr/HotModuleReplacement.runtime.js +++ b/lib/hmr/HotModuleReplacement.runtime.js @@ -12,6 +12,7 @@ var $moduleCache$ = undefined; var $hmrModuleData$ = undefined; var $hmrDownloadManifest$ = undefined; var $hmrDownloadUpdateHandlers$ = undefined; +var $hmrInvalidateModuleHandlers$ = undefined; var __webpack_require__ = undefined; module.exports = function () { @@ -33,6 +34,7 @@ module.exports = function () { // The update info var currentUpdateApplyHandlers; var currentUpdateNewHash; + var queuedInvalidatedModules; $hmrModuleData$ = currentModuleData; @@ -51,6 +53,7 @@ module.exports = function () { }); $hmrDownloadUpdateHandlers$ = {}; + $hmrInvalidateModuleHandlers$ = {}; function createRequire(require, moduleId) { var me = installedModules[moduleId]; @@ -110,6 +113,7 @@ module.exports = function () { _declinedDependencies: {}, _selfAccepted: false, _selfDeclined: false, + _selfInvalidated: false, _disposeHandlers: [], _main: currentChildModule !== moduleId, _requireSelf: function () { @@ -145,6 +149,40 @@ module.exports = function () { var idx = hot._disposeHandlers.indexOf(callback); if (idx >= 0) hot._disposeHandlers.splice(idx, 1); }, + invalidate: function () { + this._selfInvalidated = true; + switch (currentStatus) { + case "idle": + currentUpdateApplyHandlers = []; + Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { + $hmrInvalidateModuleHandlers$[key]( + moduleId, + currentUpdateApplyHandlers + ); + }); + setStatus("ready"); + break; + case "ready": + Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { + $hmrInvalidateModuleHandlers$[key]( + moduleId, + currentUpdateApplyHandlers + ); + }); + break; + case "prepare": + case "check": + case "dispose": + case "apply": + (queuedInvalidatedModules = queuedInvalidatedModules || []).push( + moduleId + ); + break; + default: + // ignore requests in error states + break; + } + }, // Management API check: hotCheck, @@ -207,7 +245,7 @@ module.exports = function () { setStatus("check"); return $hmrDownloadManifest$().then(function (update) { if (!update) { - setStatus("idle"); + setStatus(applyInvalidatedModules() ? "ready" : "idle"); return null; } @@ -260,9 +298,12 @@ module.exports = function () { function internalApply(options) { options = options || {}; + applyInvalidatedModules(); + var results = currentUpdateApplyHandlers.map(function (handler) { return handler(options); }); + currentUpdateApplyHandlers = undefined; var errors = results .map(function (r) { @@ -287,7 +328,10 @@ module.exports = function () { // Now in "apply" phase setStatus("apply"); - currentHash = currentUpdateNewHash; + if (currentUpdateNewHash !== undefined) { + currentHash = currentUpdateNewHash; + currentUpdateNewHash = undefined; + } var error; var reportError = function (err) { @@ -314,7 +358,32 @@ module.exports = function () { }); } + if (queuedInvalidatedModules) { + return internalApply(options).then(function (list) { + outdatedModules.forEach(function (moduleId) { + if (list.indexOf(moduleId) < 0) list.push(moduleId); + }); + return list; + }); + } + setStatus("idle"); return Promise.resolve(outdatedModules); } + + function applyInvalidatedModules() { + if (queuedInvalidatedModules) { + if (!currentUpdateApplyHandlers) currentUpdateApplyHandlers = []; + Object.keys($hmrInvalidateModuleHandlers$).forEach(function (key) { + queuedInvalidatedModules.forEach(function (moduleId) { + $hmrInvalidateModuleHandlers$[key]( + moduleId, + currentUpdateApplyHandlers + ); + }); + }); + queuedInvalidatedModules = undefined; + return true; + } + } }; diff --git a/lib/hmr/HotModuleReplacementRuntimeModule.js b/lib/hmr/HotModuleReplacementRuntimeModule.js index b4620b7eb..393db01dc 100644 --- a/lib/hmr/HotModuleReplacementRuntimeModule.js +++ b/lib/hmr/HotModuleReplacementRuntimeModule.js @@ -28,6 +28,10 @@ class HotModuleReplacementRuntimeModule extends RuntimeModule { .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) .replace(/\$hmrDownloadManifest\$/g, RuntimeGlobals.hmrDownloadManifest) + .replace( + /\$hmrInvalidateModuleHandlers\$/g, + RuntimeGlobals.hmrInvalidateModuleHandlers + ) .replace( /\$hmrDownloadUpdateHandlers\$/g, RuntimeGlobals.hmrDownloadUpdateHandlers diff --git a/lib/hmr/JavascriptHotModuleReplacement.runtime.js b/lib/hmr/JavascriptHotModuleReplacement.runtime.js index 42a0fdaa9..a5d3f5905 100644 --- a/lib/hmr/JavascriptHotModuleReplacement.runtime.js +++ b/lib/hmr/JavascriptHotModuleReplacement.runtime.js @@ -5,369 +5,426 @@ "use strict"; -var $options$ = undefined; -var $updateModuleFactories$ = undefined; -var $updateRuntimeModules$ = undefined; +var $installedChunks$ = undefined; +var $loadUpdateChunk$ = undefined; var $moduleCache$ = undefined; var $moduleFactories$ = undefined; +var $ensureChunkHandlers$ = undefined; +var $hasOwnProperty$ = undefined; var $hmrModuleData$ = undefined; +var $hmrDownloadUpdateHandlers$ = undefined; +var $hmrInvalidateModuleHandlers$ = undefined; var __webpack_require__ = undefined; module.exports = function () { - function getAffectedModuleEffects(updateModuleId) { - var outdatedModules = [updateModuleId]; - var outdatedDependencies = {}; + var currentUpdateChunks; + var currentUpdate; + var currentUpdateRemovedChunks; + var currentUpdateRuntime; + function applyHandler(options) { + if ($ensureChunkHandlers$) delete $ensureChunkHandlers$.$key$Hmr; + currentUpdateChunks = undefined; + function getAffectedModuleEffects(updateModuleId) { + var outdatedModules = [updateModuleId]; + var outdatedDependencies = {}; - var queue = outdatedModules.map(function (id) { - return { - chain: [id], - id: id - }; - }); - while (queue.length > 0) { - var queueItem = queue.pop(); - var moduleId = queueItem.id; - var chain = queueItem.chain; - var module = $moduleCache$[moduleId]; - if (!module || module.hot._selfAccepted) continue; - if (module.hot._selfDeclined) { + var queue = outdatedModules.map(function (id) { return { - type: "self-declined", - chain: chain, - moduleId: moduleId + chain: [id], + id: id }; - } - if (module.hot._main) { - return { - type: "unaccepted", - chain: chain, - moduleId: moduleId - }; - } - for (var i = 0; i < module.parents.length; i++) { - var parentId = module.parents[i]; - var parent = $moduleCache$[parentId]; - if (!parent) continue; - if (parent.hot._declinedDependencies[moduleId]) { + }); + while (queue.length > 0) { + var queueItem = queue.pop(); + var moduleId = queueItem.id; + var chain = queueItem.chain; + var module = $moduleCache$[moduleId]; + if ( + !module || + (module.hot._selfAccepted && !module.hot._selfInvalidated) + ) + continue; + if (module.hot._selfDeclined) { return { - type: "declined", - chain: chain.concat([parentId]), - moduleId: moduleId, - parentId: parentId + type: "self-declined", + chain: chain, + moduleId: moduleId }; } - if (outdatedModules.indexOf(parentId) !== -1) continue; - if (parent.hot._acceptedDependencies[moduleId]) { - if (!outdatedDependencies[parentId]) - outdatedDependencies[parentId] = []; - addAllToSet(outdatedDependencies[parentId], [moduleId]); - continue; + if (module.hot._main) { + return { + type: "unaccepted", + chain: chain, + moduleId: moduleId + }; } - delete outdatedDependencies[parentId]; - outdatedModules.push(parentId); - queue.push({ - chain: chain.concat([parentId]), - id: parentId + for (var i = 0; i < module.parents.length; i++) { + var parentId = module.parents[i]; + var parent = $moduleCache$[parentId]; + if (!parent) continue; + if (parent.hot._declinedDependencies[moduleId]) { + return { + type: "declined", + chain: chain.concat([parentId]), + moduleId: moduleId, + parentId: parentId + }; + } + if (outdatedModules.indexOf(parentId) !== -1) continue; + if (parent.hot._acceptedDependencies[moduleId]) { + if (!outdatedDependencies[parentId]) + outdatedDependencies[parentId] = []; + addAllToSet(outdatedDependencies[parentId], [moduleId]); + continue; + } + delete outdatedDependencies[parentId]; + outdatedModules.push(parentId); + queue.push({ + chain: chain.concat([parentId]), + id: parentId + }); + } + } + + return { + type: "accepted", + moduleId: updateModuleId, + outdatedModules: outdatedModules, + outdatedDependencies: outdatedDependencies + }; + } + + function addAllToSet(a, b) { + for (var i = 0; i < b.length; i++) { + var item = b[i]; + if (a.indexOf(item) === -1) a.push(item); + } + } + + // at begin all updates modules are outdated + // the "outdated" status can propagate to parents if they don't accept the children + var outdatedDependencies = {}; + var outdatedModules = []; + var appliedUpdate = {}; + + var warnUnexpectedRequire = function warnUnexpectedRequire() { + console.warn( + "[HMR] unexpected require(" + result.moduleId + ") to disposed module" + ); + }; + + for (var moduleId in currentUpdate) { + if ($hasOwnProperty$(currentUpdate, moduleId)) { + var newModuleFactory = currentUpdate[moduleId]; + /** @type {TODO} */ + var result; + if (newModuleFactory) { + result = getAffectedModuleEffects(moduleId); + } else { + result = { + type: "disposed", + moduleId: moduleId + }; + } + /** @type {Error|false} */ + var abortError = false; + var doApply = false; + var doDispose = false; + var chainInfo = ""; + if (result.chain) { + chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); + } + switch (result.type) { + case "self-declined": + if (options.onDeclined) options.onDeclined(result); + if (!options.ignoreDeclined) + abortError = new Error( + "Aborted because of self decline: " + + result.moduleId + + chainInfo + ); + break; + case "declined": + if (options.onDeclined) options.onDeclined(result); + if (!options.ignoreDeclined) + abortError = new Error( + "Aborted because of declined dependency: " + + result.moduleId + + " in " + + result.parentId + + chainInfo + ); + break; + case "unaccepted": + if (options.onUnaccepted) options.onUnaccepted(result); + if (!options.ignoreUnaccepted) + abortError = new Error( + "Aborted because " + moduleId + " is not accepted" + chainInfo + ); + break; + case "accepted": + if (options.onAccepted) options.onAccepted(result); + doApply = true; + break; + case "disposed": + if (options.onDisposed) options.onDisposed(result); + doDispose = true; + break; + default: + throw new Error("Unexception type " + result.type); + } + if (abortError) { + return { + error: abortError + }; + } + if (doApply) { + appliedUpdate[moduleId] = newModuleFactory; + addAllToSet(outdatedModules, result.outdatedModules); + for (moduleId in result.outdatedDependencies) { + if ($hasOwnProperty$(result.outdatedDependencies, moduleId)) { + if (!outdatedDependencies[moduleId]) + outdatedDependencies[moduleId] = []; + addAllToSet( + outdatedDependencies[moduleId], + result.outdatedDependencies[moduleId] + ); + } + } + } + if (doDispose) { + addAllToSet(outdatedModules, [result.moduleId]); + appliedUpdate[moduleId] = warnUnexpectedRequire; + } + } + } + currentUpdate = undefined; + + // Store self accepted outdated modules to require them later by the module system + var outdatedSelfAcceptedModules = []; + for (var j = 0; j < outdatedModules.length; j++) { + var outdatedModuleId = outdatedModules[j]; + if ( + $moduleCache$[outdatedModuleId] && + $moduleCache$[outdatedModuleId].hot._selfAccepted && + // removed self-accepted modules should not be required + appliedUpdate[outdatedModuleId] !== warnUnexpectedRequire && + // when called invalidate self-accepting is not possible + !$moduleCache$[moduleId].hot._selfInvalidated + ) { + outdatedSelfAcceptedModules.push({ + module: outdatedModuleId, + require: $moduleCache$[outdatedModuleId].hot._requireSelf, + errorHandler: $moduleCache$[outdatedModuleId].hot._selfAccepted }); } } + var moduleOutdatedDependencies; + return { - type: "accepted", - moduleId: updateModuleId, - outdatedModules: outdatedModules, - outdatedDependencies: outdatedDependencies - }; - } + dispose: function () { + currentUpdateRemovedChunks.forEach(function (chunkId) { + delete $installedChunks$[chunkId]; + }); + currentUpdateRemovedChunks = undefined; - function addAllToSet(a, b) { - for (var i = 0; i < b.length; i++) { - var item = b[i]; - if (a.indexOf(item) === -1) a.push(item); - } - } + var idx; + var queue = outdatedModules.slice(); + while (queue.length > 0) { + var moduleId = queue.pop(); + var module = $moduleCache$[moduleId]; + if (!module) continue; - // at begin all updates modules are outdated - // the "outdated" status can propagate to parents if they don't accept the children - var outdatedDependencies = {}; - var outdatedModules = []; - var appliedUpdate = {}; + var data = {}; - var warnUnexpectedRequire = function warnUnexpectedRequire() { - console.warn( - "[HMR] unexpected require(" + result.moduleId + ") to disposed module" - ); - }; - - for (var moduleId in $updateModuleFactories$) { - if ( - Object.prototype.hasOwnProperty.call($updateModuleFactories$, moduleId) - ) { - var newModuleFactory = $updateModuleFactories$[moduleId]; - /** @type {TODO} */ - var result; - if (newModuleFactory) { - result = getAffectedModuleEffects(moduleId); - } else { - result = { - type: "disposed", - moduleId: moduleId - }; - } - /** @type {Error|false} */ - var abortError = false; - var doApply = false; - var doDispose = false; - var chainInfo = ""; - if (result.chain) { - chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); - } - switch (result.type) { - case "self-declined": - if ($options$.onDeclined) $options$.onDeclined(result); - if (!$options$.ignoreDeclined) - abortError = new Error( - "Aborted because of self decline: " + result.moduleId + chainInfo - ); - break; - case "declined": - if ($options$.onDeclined) $options$.onDeclined(result); - if (!$options$.ignoreDeclined) - abortError = new Error( - "Aborted because of declined dependency: " + - result.moduleId + - " in " + - result.parentId + - chainInfo - ); - break; - case "unaccepted": - if ($options$.onUnaccepted) $options$.onUnaccepted(result); - if (!$options$.ignoreUnaccepted) - abortError = new Error( - "Aborted because " + moduleId + " is not accepted" + chainInfo - ); - break; - case "accepted": - if ($options$.onAccepted) $options$.onAccepted(result); - doApply = true; - break; - case "disposed": - if ($options$.onDisposed) $options$.onDisposed(result); - doDispose = true; - break; - default: - throw new Error("Unexception type " + result.type); - } - if (abortError) { - return { - error: abortError - }; - } - if (doApply) { - appliedUpdate[moduleId] = newModuleFactory; - addAllToSet(outdatedModules, result.outdatedModules); - for (moduleId in result.outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call( - result.outdatedDependencies, - moduleId - ) - ) { - if (!outdatedDependencies[moduleId]) - outdatedDependencies[moduleId] = []; - addAllToSet( - outdatedDependencies[moduleId], - result.outdatedDependencies[moduleId] - ); + // Call dispose handlers + var disposeHandlers = module.hot._disposeHandlers; + for (j = 0; j < disposeHandlers.length; j++) { + disposeHandlers[j].call(null, data); } - } - } - if (doDispose) { - addAllToSet(outdatedModules, [result.moduleId]); - appliedUpdate[moduleId] = warnUnexpectedRequire; - } - } - } + $hmrModuleData$[moduleId] = data; - // Store self accepted outdated modules to require them later by the module system - var outdatedSelfAcceptedModules = []; - for (var j = 0; j < outdatedModules.length; j++) { - var outdatedModuleId = outdatedModules[j]; - if ( - $moduleCache$[outdatedModuleId] && - $moduleCache$[outdatedModuleId].hot._selfAccepted && - // removed self-accepted modules should not be required - appliedUpdate[outdatedModuleId] !== warnUnexpectedRequire - ) { - outdatedSelfAcceptedModules.push({ - module: outdatedModuleId, - require: $moduleCache$[outdatedModuleId].hot._requireSelf, - errorHandler: $moduleCache$[outdatedModuleId].hot._selfAccepted - }); - } - } + // disable module (this disables requires from this module) + module.hot.active = false; - var moduleOutdatedDependencies; + // remove module from cache + delete $moduleCache$[moduleId]; - return { - dispose: function () { - // $dispose$ + // when disposing there is no need to call dispose handler + delete outdatedDependencies[moduleId]; - var idx; - var queue = outdatedModules.slice(); - while (queue.length > 0) { - var moduleId = queue.pop(); - var module = $moduleCache$[moduleId]; - if (!module) continue; - - var data = {}; - - // Call dispose handlers - var disposeHandlers = module.hot._disposeHandlers; - for (j = 0; j < disposeHandlers.length; j++) { - disposeHandlers[j].call(null, data); - } - $hmrModuleData$[moduleId] = data; - - // disable module (this disables requires from this module) - module.hot.active = false; - - // remove module from cache - delete $moduleCache$[moduleId]; - - // when disposing there is no need to call dispose handler - delete outdatedDependencies[moduleId]; - - // remove "parents" references from all children - for (j = 0; j < module.children.length; j++) { - var child = $moduleCache$[module.children[j]]; - if (!child) continue; - idx = child.parents.indexOf(moduleId); - if (idx >= 0) { - child.parents.splice(idx, 1); - } - } - } - - // remove outdated dependency from module children - var dependency; - for (var outdatedModuleId in outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call( - outdatedDependencies, - outdatedModuleId - ) - ) { - module = $moduleCache$[outdatedModuleId]; - if (module) { - moduleOutdatedDependencies = outdatedDependencies[outdatedModuleId]; - for (j = 0; j < moduleOutdatedDependencies.length; j++) { - dependency = moduleOutdatedDependencies[j]; - idx = module.children.indexOf(dependency); - if (idx >= 0) module.children.splice(idx, 1); + // remove "parents" references from all children + for (j = 0; j < module.children.length; j++) { + var child = $moduleCache$[module.children[j]]; + if (!child) continue; + idx = child.parents.indexOf(moduleId); + if (idx >= 0) { + child.parents.splice(idx, 1); } } } - } - }, - apply: function (reportError) { - // insert new code - for (var updateModuleId in appliedUpdate) { - if ( - Object.prototype.hasOwnProperty.call(appliedUpdate, updateModuleId) - ) { - $moduleFactories$[updateModuleId] = appliedUpdate[updateModuleId]; - } - } - // run new runtime modules - for (var i = 0; i < $updateRuntimeModules$.length; i++) { - $updateRuntimeModules$[i](__webpack_require__); - } - - // call accept handlers - var error = null; - for (var outdatedModuleId in outdatedDependencies) { - if ( - Object.prototype.hasOwnProperty.call( - outdatedDependencies, - outdatedModuleId - ) - ) { - var module = $moduleCache$[outdatedModuleId]; - if (module) { - moduleOutdatedDependencies = outdatedDependencies[outdatedModuleId]; - var callbacks = []; - for (var j = 0; j < moduleOutdatedDependencies.length; j++) { - var dependency = moduleOutdatedDependencies[j]; - var acceptCallback = module.hot._acceptedDependencies[dependency]; - if (acceptCallback) { - if (callbacks.indexOf(acceptCallback) !== -1) continue; - callbacks.push(acceptCallback); + // remove outdated dependency from module children + var dependency; + for (var outdatedModuleId in outdatedDependencies) { + if ($hasOwnProperty$(outdatedDependencies, outdatedModuleId)) { + module = $moduleCache$[outdatedModuleId]; + if (module) { + moduleOutdatedDependencies = + outdatedDependencies[outdatedModuleId]; + for (j = 0; j < moduleOutdatedDependencies.length; j++) { + dependency = moduleOutdatedDependencies[j]; + idx = module.children.indexOf(dependency); + if (idx >= 0) module.children.splice(idx, 1); } } - for (var k = 0; k < callbacks.length; k++) { + } + } + }, + apply: function (reportError) { + // insert new code + for (var updateModuleId in appliedUpdate) { + if ($hasOwnProperty$(appliedUpdate, updateModuleId)) { + $moduleFactories$[updateModuleId] = appliedUpdate[updateModuleId]; + } + } + + // run new runtime modules + for (var i = 0; i < currentUpdateRuntime.length; i++) { + currentUpdateRuntime[i](__webpack_require__); + } + + // call accept handlers + var error = null; + for (var outdatedModuleId in outdatedDependencies) { + if ($hasOwnProperty$(outdatedDependencies, outdatedModuleId)) { + var module = $moduleCache$[outdatedModuleId]; + if (module) { + moduleOutdatedDependencies = + outdatedDependencies[outdatedModuleId]; + var callbacks = []; + for (var j = 0; j < moduleOutdatedDependencies.length; j++) { + var dependency = moduleOutdatedDependencies[j]; + var acceptCallback = + module.hot._acceptedDependencies[dependency]; + if (acceptCallback) { + if (callbacks.indexOf(acceptCallback) !== -1) continue; + callbacks.push(acceptCallback); + } + } + for (var k = 0; k < callbacks.length; k++) { + try { + callbacks[k].call(null, moduleOutdatedDependencies); + } catch (err) { + if (options.onErrored) { + options.onErrored({ + type: "accept-errored", + moduleId: outdatedModuleId, + dependencyId: moduleOutdatedDependencies[i], + error: err + }); + } + if (!options.ignoreErrored) { + if (!error) error = err; + } + } + } + } + } + } + + // Load self accepted modules + for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) { + var item = outdatedSelfAcceptedModules[o]; + var moduleId = item.module; + try { + item.require(moduleId); + } catch (err) { + if (typeof item.errorHandler === "function") { try { - callbacks[k].call(null, moduleOutdatedDependencies); - } catch (err) { - if ($options$.onErrored) { - $options$.onErrored({ - type: "accept-errored", - moduleId: outdatedModuleId, - dependencyId: moduleOutdatedDependencies[i], - error: err + item.errorHandler(err); + } catch (err2) { + if (options.onErrored) { + options.onErrored({ + type: "self-accept-error-handler-errored", + moduleId: moduleId, + error: err2, + originalError: err }); } - if (!$options$.ignoreErrored) { - if (!error) error = err; + if (!options.ignoreErrored) { + reportError(err2); } + reportError(err); } - } - } - } - } - - // Load self accepted modules - for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) { - var item = outdatedSelfAcceptedModules[o]; - var moduleId = item.module; - try { - item.require(moduleId); - } catch (err) { - if (typeof item.errorHandler === "function") { - try { - item.errorHandler(err); - } catch (err2) { - if ($options$.onErrored) { - $options$.onErrored({ - type: "self-accept-error-handler-errored", + } else { + if (options.onErrored) { + options.onErrored({ + type: "self-accept-errored", moduleId: moduleId, - error: err2, - originalError: err + error: err }); } - if (!$options$.ignoreErrored) { - reportError(err2); + if (!options.ignoreErrored) { + reportError(err); } - reportError(err); - } - } else { - if ($options$.onErrored) { - $options$.onErrored({ - type: "self-accept-errored", - moduleId: moduleId, - error: err - }); - } - if (!$options$.ignoreErrored) { - reportError(err); } } } - } - return outdatedModules; + return outdatedModules; + } + }; + } + $hmrInvalidateModuleHandlers$.$key$ = function (moduleId, applyHandlers) { + if (!currentUpdate) { + currentUpdate = {}; + currentUpdateRuntime = []; + currentUpdateRemovedChunks = []; + applyHandlers.push(applyHandler); + } + if (!$hasOwnProperty$(currentUpdate, moduleId)) { + currentUpdate[moduleId] = $moduleFactories$[moduleId]; + } + }; + $hmrDownloadUpdateHandlers$.$key$ = function ( + chunkIds, + removedChunks, + removedModules, + promises, + applyHandlers, + updatedModulesList + ) { + applyHandlers.push(applyHandler); + currentUpdateChunks = {}; + currentUpdateRemovedChunks = removedChunks; + currentUpdate = removedModules.reduce(function (obj, key) { + obj[key] = false; + return obj; + }, {}); + currentUpdateRuntime = []; + chunkIds.forEach(function (chunkId) { + if ( + $hasOwnProperty$($installedChunks$, chunkId) && + $installedChunks$[chunkId] !== undefined + ) { + promises.push($loadUpdateChunk$(chunkId, updatedModulesList)); + currentUpdateChunks[chunkId] = true; + } + }); + if ($ensureChunkHandlers$) { + $ensureChunkHandlers$.$key$Hmr = function (chunkId, promises) { + if ( + currentUpdateChunks && + !$hasOwnProperty$(currentUpdateChunks, chunkId) && + $hasOwnProperty$($installedChunks$, chunkId) && + $installedChunks$[chunkId] !== undefined + ) { + promises.push($loadUpdateChunk$(chunkId)); + currentUpdateChunks[chunkId] = true; + } + }; } }; }; diff --git a/lib/node/ReadFileChunkLoadingRuntimeModule.js b/lib/node/ReadFileChunkLoadingRuntimeModule.js index ed0ad8067..11bd751e1 100644 --- a/lib/node/ReadFileChunkLoadingRuntimeModule.js +++ b/lib/node/ReadFileChunkLoadingRuntimeModule.js @@ -103,36 +103,19 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { "});", "promises.push(installedChunkData[2] = promise);" ]), - "} else installedChunks[chunkId] = 0;", - "", - withHmr - ? Template.asString([ - "if(currentUpdateChunks && currentUpdateChunks[chunkId]) promises.push(loadUpdateChunk(chunkId));" - ]) - : "// no HMR" + "} else installedChunks[chunkId] = 0;" ]), "}" ]), "}" ]) - : Template.indent([ - "installedChunks[chunkId] = 0;", - "", - withHmr - ? Template.asString([ - "if(currentUpdateChunks && currentUpdateChunks[chunkId]) promises.push(loadUpdateChunk(chunkId));" - ]) - : "// no HMR" - ]), + : Template.indent(["installedChunks[chunkId] = 0;"]), "};" ]) : "// no chunk loading", "", withHmr ? Template.asString([ - "var currentUpdateChunks;", - "var currentUpdate;", - "var currentUpdateRuntime;", "function loadUpdateChunk(chunkId, updatedModulesList) {", Template.indent([ "return new Promise(function(resolve, reject) {", @@ -165,46 +148,28 @@ class ReadFileChunkLoadingRuntimeModule extends RuntimeModule { ]), "}", "", - `${RuntimeGlobals.hmrDownloadUpdateHandlers}.readFileVm = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`, - Template.indent([ - "applyHandlers.push(function(options) {", - Template.indent([ - "currentUpdateChunks = undefined;", - Template.getFunctionContent( - require("../hmr/JavascriptHotModuleReplacement.runtime.js") - ) - .replace(/\$options\$/g, "options") - .replace(/\$updateModuleFactories\$/g, "currentUpdate") - .replace(/\$updateRuntimeModules\$/g, "currentUpdateRuntime") - .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) - .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) - .replace( - /\$moduleFactories\$/g, - RuntimeGlobals.moduleFactories - ) - .replace( - /\/\/ \$dispose\$/g, - Template.asString([ - "removedChunks.forEach(function(chunkId) { delete installedChunks[chunkId]; });" - ]) - ) - ]), - "});", - "currentUpdateChunks = {};", - "currentUpdate = removedModules.reduce(function(obj, key) { obj[key] = false; return obj; }, {});", - "currentUpdateRuntime = [];", - "chunkIds.forEach(function(chunkId) {", - Template.indent([ - "if(installedChunks[chunkId] !== undefined) {", - Template.indent([ - "promises.push(loadUpdateChunk(chunkId, updatedModulesList));" - ]), - "}", - "currentUpdateChunks[chunkId] = true;" - ]), - "});" - ]), - "};" + Template.getFunctionContent( + require("../hmr/JavascriptHotModuleReplacement.runtime.js") + ) + .replace(/\$key\$/g, "readFileVm") + .replace(/\$installedChunks\$/g, "installedChunks") + .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") + .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) + .replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories) + .replace( + /\$ensureChunkHandlers\$/g, + RuntimeGlobals.ensureChunkHandlers + ) + .replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty) + .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) + .replace( + /\$hmrDownloadUpdateHandlers\$/g, + RuntimeGlobals.hmrDownloadUpdateHandlers + ) + .replace( + /\$hmrInvalidateModuleHandlers\$/g, + RuntimeGlobals.hmrInvalidateModuleHandlers + ) ]) : "// no HMR", "", diff --git a/lib/node/RequireChunkLoadingRuntimeModule.js b/lib/node/RequireChunkLoadingRuntimeModule.js index f5ae52fff..d321cbd57 100644 --- a/lib/node/RequireChunkLoadingRuntimeModule.js +++ b/lib/node/RequireChunkLoadingRuntimeModule.js @@ -95,32 +95,17 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { Template.indent("installedChunks[chunkIds[i]] = 1;") ]), "} else installedChunks[chunkId] = 1;", - "", - withHmr - ? Template.asString([ - "if(currentUpdateChunks && currentUpdateChunks[chunkId]) loadUpdateChunk(chunkId);" - ]) - : "// no HMR" + "" ]), "}" ]) - : Template.asString([ - "installedChunks[chunkId] = 1;", - withHmr - ? Template.asString([ - "if(currentUpdateChunks && currentUpdateChunks[chunkId]) loadUpdateChunk(chunkId);" - ]) - : "// no HMR" - ]), + : "installedChunks[chunkId] = 1;", "};" ]) : "// no chunk loading", "", withHmr ? Template.asString([ - "var currentUpdateChunks;", - "var currentUpdate;", - "var currentUpdateRuntime;", "function loadUpdateChunk(chunkId, updatedModulesList) {", Template.indent([ `var update = require("./" + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId));`, @@ -140,46 +125,28 @@ class RequireChunkLoadingRuntimeModule extends RuntimeModule { ]), "}", "", - `${RuntimeGlobals.hmrDownloadUpdateHandlers}.require = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`, - Template.indent([ - "applyHandlers.push(function(options) {", - Template.indent([ - "currentUpdateChunks = undefined;", - Template.getFunctionContent( - require("../hmr/JavascriptHotModuleReplacement.runtime.js") - ) - .replace(/\$options\$/g, "options") - .replace(/\$updateModuleFactories\$/g, "currentUpdate") - .replace(/\$updateRuntimeModules\$/g, "currentUpdateRuntime") - .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) - .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) - .replace( - /\$moduleFactories\$/g, - RuntimeGlobals.moduleFactories - ) - .replace( - /\/\/ \$dispose\$/g, - Template.asString([ - "removedChunks.forEach(function(chunkId) { delete installedChunks[chunkId]; });" - ]) - ) - ]), - "});", - "currentUpdateChunks = {};", - "currentUpdate = removedModules.reduce(function(obj, key) { obj[key] = false; return obj; }, {});", - "currentUpdateRuntime = [];", - "chunkIds.forEach(function(chunkId) {", - Template.indent([ - "if(installedChunks[chunkId] !== undefined) {", - Template.indent([ - "loadUpdateChunk(chunkId, updatedModulesList);" - ]), - "}", - "currentUpdateChunks[chunkId] = true;" - ]), - "});" - ]), - "};" + Template.getFunctionContent( + require("../hmr/JavascriptHotModuleReplacement.runtime.js") + ) + .replace(/\$key\$/g, "require") + .replace(/\$installedChunks\$/g, "installedChunks") + .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") + .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) + .replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories) + .replace( + /\$ensureChunkHandlers\$/g, + RuntimeGlobals.ensureChunkHandlers + ) + .replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty) + .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) + .replace( + /\$hmrDownloadUpdateHandlers\$/g, + RuntimeGlobals.hmrDownloadUpdateHandlers + ) + .replace( + /\$hmrInvalidateModuleHandlers\$/g, + RuntimeGlobals.hmrInvalidateModuleHandlers + ) ]) : "// no HMR", "", diff --git a/lib/web/JsonpChunkLoadingRuntimeModule.js b/lib/web/JsonpChunkLoadingRuntimeModule.js index 4cf4d78ea..37650ace2 100644 --- a/lib/web/JsonpChunkLoadingRuntimeModule.js +++ b/lib/web/JsonpChunkLoadingRuntimeModule.js @@ -115,23 +115,13 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { jsonpScript.call("", chunk), "document.head.appendChild(script);" ]), - "} else installedChunks[chunkId] = 0;", - "", - withHmr - ? "if(currentUpdateChunks && currentUpdateChunks[chunkId]) promises.push(loadUpdateChunk(chunkId));" - : "// no HMR" + "} else installedChunks[chunkId] = 0;" ]), "}" ]), "}" ]) - : Template.indent([ - "installedChunks[chunkId] = 0;", - "", - withHmr - ? "if(currentUpdateChunks && currentUpdateChunks[chunkId]) promises.push(loadUpdateChunk(chunkId));" - : "// no HMR" - ]) + : Template.indent(["installedChunks[chunkId] = 0;"]) )};` ]) : "// no chunk on demand loading", @@ -174,9 +164,6 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { "", withHmr ? Template.asString([ - "var currentUpdateChunks;", - "var currentUpdate;", - "var currentUpdateRuntime;", "var currentUpdatedModulesList;", "var waitingUpdateResolves = {};", "function loadUpdateChunk(chunkId) {", @@ -227,54 +214,28 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { ] )};`, "", - `${ - RuntimeGlobals.hmrDownloadUpdateHandlers - }.jsonp = ${runtimeTemplate.basicFunction( - "chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList", - [ - `applyHandlers.push(${runtimeTemplate.basicFunction("options", [ - "currentUpdateChunks = undefined;", - Template.getFunctionContent( - require("../hmr/JavascriptHotModuleReplacement.runtime.js") - ) - .replace(/\$options\$/g, "options") - .replace(/\$updateModuleFactories\$/g, "currentUpdate") - .replace( - /\$updateRuntimeModules\$/g, - "currentUpdateRuntime" - ) - .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) - .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) - .replace( - /\$moduleFactories\$/g, - RuntimeGlobals.moduleFactories - ) - .replace( - /\/\/ \$dispose\$/g, - Template.asString([ - runtimeTemplate.forEach( - "chunkId", - "removedChunks", - "delete installedChunks[chunkId];" - ) - ]) - ) - ])});`, - "currentUpdateChunks = {};", - `currentUpdate = removedModules.reduce(${runtimeTemplate.basicFunction( - "obj, key", - ["obj[key] = false;", "return obj;"] - )}, {});`, - "currentUpdateRuntime = [];", - "currentUpdatedModulesList = updatedModulesList;", - runtimeTemplate.forEach("chunkId", "chunkIds", [ - `if(${RuntimeGlobals.hasOwnProperty}(installedChunks, chunkId) && installedChunks[chunkId] !== undefined) {`, - Template.indent(["promises.push(loadUpdateChunk(chunkId));"]), - "}", - "currentUpdateChunks[chunkId] = true;" - ]) - ] - )};` + Template.getFunctionContent( + require("../hmr/JavascriptHotModuleReplacement.runtime.js") + ) + .replace(/\$key\$/g, "jsonp") + .replace(/\$installedChunks\$/g, "installedChunks") + .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") + .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) + .replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories) + .replace( + /\$ensureChunkHandlers\$/g, + RuntimeGlobals.ensureChunkHandlers + ) + .replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty) + .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) + .replace( + /\$hmrDownloadUpdateHandlers\$/g, + RuntimeGlobals.hmrDownloadUpdateHandlers + ) + .replace( + /\$hmrInvalidateModuleHandlers\$/g, + RuntimeGlobals.hmrInvalidateModuleHandlers + ) ]) : "// no HMR", "", diff --git a/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js b/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js index 7dac2ec16..4d0721fbc 100644 --- a/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +++ b/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js @@ -69,11 +69,7 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { Template.indent("installedChunks[chunkIds.pop()] = 1;") ]), "};", - `importScripts(${RuntimeGlobals.getChunkScriptFilename}(chunkId));`, - "", - withHmr - ? "if(currentUpdateChunks && currentUpdateChunks[chunkId]) loadUpdateChunk(chunkId);" - : "// no HMR" + `importScripts(${RuntimeGlobals.getChunkScriptFilename}(chunkId));` ]), "}" ]), @@ -83,9 +79,6 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { "", withHmr ? Template.asString([ - "var currentUpdateChunks;", - "var currentUpdate;", - "var currentUpdateRuntime;", "function loadUpdateChunk(chunkId, updatedModulesList) {", Template.indent([ "var success = false;", @@ -113,46 +106,28 @@ class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule { ]), "}", "", - `${RuntimeGlobals.hmrDownloadUpdateHandlers}.jsonp = function(chunkIds, removedChunks, removedModules, promises, applyHandlers, updatedModulesList) {`, - Template.indent([ - "applyHandlers.push(function(options) {", - Template.indent([ - "currentUpdateChunks = undefined;", - Template.getFunctionContent( - require("../hmr/JavascriptHotModuleReplacement.runtime.js") - ) - .replace(/\$options\$/g, "options") - .replace(/\$updateModuleFactories\$/g, "currentUpdate") - .replace(/\$updateRuntimeModules\$/g, "currentUpdateRuntime") - .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) - .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) - .replace( - /\$moduleFactories\$/g, - RuntimeGlobals.moduleFactories - ) - .replace( - /\/\/ \$dispose\$/g, - Template.asString([ - "removedChunks.forEach(function(chunkId) { delete installedChunks[chunkId]; });" - ]) - ) - ]), - "});", - "currentUpdateChunks = {};", - "currentUpdate = removedModules.reduce(function(obj, key) { obj[key] = false; return obj; }, {});", - "currentUpdateRuntime = [];", - "chunkIds.forEach(function(chunkId) {", - Template.indent([ - "if(installedChunks[chunkId] !== undefined) {", - Template.indent([ - "promises.push(loadUpdateChunk(chunkId, updatedModulesList));" - ]), - "}", - "currentUpdateChunks[chunkId] = true;" - ]), - "});" - ]), - "}" + Template.getFunctionContent( + require("../hmr/JavascriptHotModuleReplacement.runtime.js") + ) + .replace(/\$key\$/g, "importScrips") + .replace(/\$installedChunks\$/g, "installedChunks") + .replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk") + .replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache) + .replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories) + .replace( + /\$ensureChunkHandlers\$/g, + RuntimeGlobals.ensureChunkHandlers + ) + .replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty) + .replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData) + .replace( + /\$hmrDownloadUpdateHandlers\$/g, + RuntimeGlobals.hmrDownloadUpdateHandlers + ) + .replace( + /\$hmrInvalidateModuleHandlers\$/g, + RuntimeGlobals.hmrInvalidateModuleHandlers + ) ]) : "// no HMR", "", diff --git a/test/__snapshots__/StatsTestCases.test.js.snap b/test/__snapshots__/StatsTestCases.test.js.snap index 9cc3bfe38..571f43eff 100644 --- a/test/__snapshots__/StatsTestCases.test.js.snap +++ b/test/__snapshots__/StatsTestCases.test.js.snap @@ -1,19 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`StatsTestCases should print correct stats for aggressive-splitting-entry 1`] = ` -"Hash: 04643923d1e5b3d9b4e64c2917d507e71f03c5bf +"Hash: 70451bfc89d3718807c8e248e9e5e0b2dd571a44 Child fitting: - Hash: 04643923d1e5b3d9b4e6 + Hash: 70451bfc89d3718807c8 Time: X ms Built at: 1970-04-20 12:42:42 PublicPath: (none) Asset Size - fitting-0046e6aef2622051a0a3.js 13.2 KiB [emitted] [immutable] fitting-1e85d2c6a3bb53369456.js 1.91 KiB [emitted] [immutable] fitting-32fa512a201604f3e8b7.js 1.08 KiB [emitted] [immutable] fitting-64ea4fa3fe9d8c4817d8.js 1.91 KiB [emitted] [immutable] - Entrypoint main = fitting-1e85d2c6a3bb53369456.js fitting-64ea4fa3fe9d8c4817d8.js fitting-0046e6aef2622051a0a3.js - chunk fitting-0046e6aef2622051a0a3.js 1.87 KiB (javascript) 6.63 KiB (runtime) [entry] [rendered] + fitting-8c5036027c59f3e9a4a5.js 13.1 KiB [emitted] [immutable] + Entrypoint main = fitting-1e85d2c6a3bb53369456.js fitting-64ea4fa3fe9d8c4817d8.js fitting-8c5036027c59f3e9a4a5.js + chunk fitting-8c5036027c59f3e9a4a5.js 1.87 KiB (javascript) 6.62 KiB (runtime) [entry] [rendered] > ./index main ./e.js 899 bytes [built] ./f.js 900 bytes [built] @@ -31,7 +31,7 @@ Child fitting: > ./g ./index.js 7:0-13 ./g.js 916 bytes [built] Child content-change: - Hash: 4c2917d507e71f03c5bf + Hash: e248e9e5e0b2dd571a44 Time: X ms Built at: 1970-04-20 12:42:42 PublicPath: (none) @@ -39,9 +39,9 @@ Child content-change: content-change-1e85d2c6a3bb53369456.js 1.91 KiB [emitted] [immutable] content-change-32fa512a201604f3e8b7.js 1.08 KiB [emitted] [immutable] content-change-64ea4fa3fe9d8c4817d8.js 1.91 KiB [emitted] [immutable] - content-change-e59e7c1b76d46146f969.js 13.2 KiB [emitted] [immutable] - Entrypoint main = content-change-1e85d2c6a3bb53369456.js content-change-64ea4fa3fe9d8c4817d8.js content-change-e59e7c1b76d46146f969.js - chunk content-change-e59e7c1b76d46146f969.js 1.87 KiB (javascript) 6.64 KiB (runtime) [entry] [rendered] + content-change-e66ad755b1c39cc2ae4a.js 13.2 KiB [emitted] [immutable] + Entrypoint main = content-change-1e85d2c6a3bb53369456.js content-change-64ea4fa3fe9d8c4817d8.js content-change-e66ad755b1c39cc2ae4a.js + chunk content-change-e66ad755b1c39cc2ae4a.js 1.87 KiB (javascript) 6.62 KiB (runtime) [entry] [rendered] > ./index main ./e.js 899 bytes [built] ./f.js 900 bytes [built] @@ -61,13 +61,14 @@ Child content-change: `; exports[`StatsTestCases should print correct stats for aggressive-splitting-on-demand 1`] = ` -"Hash: 92339c1f044fa965d380 +"Hash: 21f9ed5ab7a127d97c1a Time: X ms Built at: 1970-04-20 12:42:42 PublicPath: (none) Asset Size 1c8f0f5fb926b811c0e5.js 1010 bytes [emitted] [immutable] 21fd8e73389271e24957.js 1.91 KiB [emitted] [immutable] +45ae21726ca0cc660a47.js 9.19 KiB [emitted] [immutable] [name: main] 64ea4fa3fe9d8c4817d8.js 1.91 KiB [emitted] [immutable] 6a2a05a9feb43a535129.js 1.91 KiB [emitted] [immutable] ae7ced4135ed4f2282f6.js 1.91 KiB [emitted] [immutable] @@ -75,15 +76,14 @@ b4a95c5544295741de67.js 1010 bytes [emitted] [immutable] b63bab94d02c84e0f081.js 1.91 KiB [emitted] [immutable] db9a189ff52c97050941.js 1.91 KiB [emitted] [immutable] de61daf57f7861bbb2f6.js 1.91 KiB [emitted] [immutable] -ed463ade3b69f0f1da84.js 9.22 KiB [emitted] [immutable] [name: main] f80243284f4ab491b78e.js 1.91 KiB [emitted] [immutable] fb5a5560e641649a6ed8.js 1010 bytes [emitted] [immutable] -Entrypoint main = ed463ade3b69f0f1da84.js +Entrypoint main = 45ae21726ca0cc660a47.js chunk 64ea4fa3fe9d8c4817d8.js 1.76 KiB [rendered] [recorded] aggressive splitted > ./c ./d ./e ./index.js 3:0-30 ./c.js 899 bytes [built] ./d.js 899 bytes [built] -chunk ed463ade3b69f0f1da84.js (main) 248 bytes (javascript) 4.51 KiB (runtime) [entry] [rendered] +chunk 45ae21726ca0cc660a47.js (main) 248 bytes (javascript) 4.49 KiB (runtime) [entry] [rendered] > ./index main ./index.js 248 bytes [built] + 5 hidden chunk modules @@ -149,7 +149,7 @@ Entrypoint main = bundle.js (6eef074bdaf47143a239.png static/file.html) exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = ` "Entrypoint main = main.js -chunk main.js (main) 515 bytes (javascript) 4.19 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered] +chunk main.js (main) 515 bytes (javascript) 4.18 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered] > ./ main ./index.js 515 bytes [built] + 5 hidden root modules @@ -181,7 +181,7 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] + 1 hidden dependent module - chunk disabled/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered] + chunk disabled/main.js (main) 147 bytes (javascript) 4.82 KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -198,7 +198,7 @@ exports[`StatsTestCases should print correct stats for async-commons-chunk-auto ./c.js + 1 modules 107 bytes [built] + 3 hidden root modules + 3 hidden dependent modules - chunk disabled/a.js (a) 216 bytes (javascript) 4.78 KiB (runtime) [entry] [rendered] + chunk disabled/a.js (a) 216 bytes (javascript) 4.77 KiB (runtime) [entry] [rendered] > ./a a ./a.js + 1 modules 156 bytes [built] + 7 hidden root modules @@ -220,7 +220,7 @@ Child default: chunk default/async-g.js (async-g) 34 bytes [rendered] > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] - chunk default/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) [entry] [rendered] + chunk default/main.js (main) 147 bytes (javascript) 4.83 KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -253,7 +253,7 @@ Child default: chunk default/769.js (id hint: vendors) 20 bytes [rendered] split chunk (cache group: defaultVendors) > ./c ./index.js 3:0-47 ./node_modules/z.js 20 bytes [built] - chunk default/a.js (a) 216 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered] + chunk default/a.js (a) 216 bytes (javascript) 4.82 KiB (runtime) [entry] [rendered] > ./a a ./a.js + 1 modules 156 bytes [built] + 7 hidden root modules @@ -279,7 +279,7 @@ Child vendors: > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] + 1 hidden dependent module - chunk vendors/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered] + chunk vendors/main.js (main) 147 bytes (javascript) 4.82 KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -303,7 +303,7 @@ Child vendors: ./c.js 72 bytes [built] + 4 hidden root modules + 2 hidden dependent modules - chunk vendors/a.js (a) 176 bytes (javascript) 5.95 KiB (runtime) [entry] [rendered] + chunk vendors/a.js (a) 176 bytes (javascript) 5.94 KiB (runtime) [entry] [rendered] > ./a a ./a.js + 1 modules 156 bytes [built] + 7 hidden root modules @@ -333,7 +333,7 @@ Child multiple-vendors: chunk multiple-vendors/async-g.js (async-g) 34 bytes [rendered] > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] - chunk multiple-vendors/main.js (main) 147 bytes (javascript) 4.87 KiB (runtime) [entry] [rendered] + chunk multiple-vendors/main.js (main) 147 bytes (javascript) 4.86 KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -365,7 +365,7 @@ Child multiple-vendors: > ./c ./index.js 3:0-47 > ./c c ./node_modules/z.js 20 bytes [built] - chunk multiple-vendors/a.js (a) 156 bytes (javascript) 6 KiB (runtime) [entry] [rendered] + chunk multiple-vendors/a.js (a) 156 bytes (javascript) 5.99 KiB (runtime) [entry] [rendered] > ./a a ./a.js + 1 modules 156 bytes [built] + 7 hidden root modules @@ -391,7 +391,7 @@ Child all: chunk all/async-g.js (async-g) 34 bytes [rendered] > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] - chunk all/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) [entry] [rendered] + chunk all/main.js (main) 147 bytes (javascript) 4.83 KiB (runtime) [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -431,7 +431,7 @@ Child all: > ./c ./index.js 3:0-47 > ./c c ./node_modules/z.js 20 bytes [built] - chunk all/a.js (a) 156 bytes (javascript) 5.99 KiB (runtime) [entry] [rendered] + chunk all/a.js (a) 156 bytes (javascript) 5.98 KiB (runtime) [entry] [rendered] > ./a a ./a.js + 1 modules 156 bytes [built] + 7 hidden root modules @@ -473,7 +473,7 @@ chunk main1.js (main1) 136 bytes [entry] [rendered] `; exports[`StatsTestCases should print correct stats for chunks 1`] = ` -"Hash: ceb0547564135a0a6c0c +"Hash: 02575b74aab5a2ac7302 Time: X ms Built at: 1970-04-20 12:42:42 PublicPath: (none) @@ -481,9 +481,9 @@ PublicPath: (none) 460.bundle.js 324 bytes [emitted] 524.bundle.js 210 bytes [emitted] 996.bundle.js 142 bytes [emitted] - bundle.js 7.74 KiB [emitted] [name: main] + bundle.js 7.71 KiB [emitted] [name: main] Entrypoint main = bundle.js -chunk bundle.js (main) 73 bytes (javascript) 4.2 KiB (runtime) >{460}< >{996}< [entry] [rendered] +chunk bundle.js (main) 73 bytes (javascript) 4.19 KiB (runtime) >{460}< >{996}< [entry] [rendered] > ./index main ./a.js 22 bytes [built] cjs self exports reference ./a.js 1:0-14 @@ -517,13 +517,13 @@ chunk 996.bundle.js 22 bytes <{179}> [rendered] `; exports[`StatsTestCases should print correct stats for chunks-development 1`] = ` -"Hash: 9a94c2757a36b51de23c +"Hash: 84a61a5e2153e565ad2d Time: X ms Built at: 1970-04-20 12:42:42 PublicPath: (none) Asset Size b_js.bundle.js 982 bytes [emitted] - bundle.js 8.96 KiB [emitted] [name: main] + bundle.js 8.92 KiB [emitted] [name: main] c_js.bundle.js 1.18 KiB [emitted] d_js-e_js.bundle.js 1.4 KiB [emitted] Entrypoint main = bundle.js @@ -548,7 +548,7 @@ chunk d_js-e_js.bundle.js 60 bytes <{c_js}> [rendered] require.ensure item ./e ./c.js 1:0-52 cjs self exports reference ./e.js 2:0-14 X ms -> X ms -> X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) -chunk bundle.js (main) 73 bytes (javascript) 4.2 KiB (runtime) >{b_js}< >{c_js}< [entry] [rendered] +chunk bundle.js (main) 73 bytes (javascript) 4.19 KiB (runtime) >{b_js}< >{c_js}< [entry] [rendered] > ./index main ./a.js 22 bytes [built] cjs self exports reference ./a.js 1:0-14 @@ -565,7 +565,7 @@ exports[`StatsTestCases should print correct stats for circular-correctness 1`] "Entrypoint main = bundle.js chunk 128.bundle.js (b) 49 bytes <{179}> <{459}> >{459}< [rendered] ./module-b.js 49 bytes [built] -chunk bundle.js (main) 98 bytes (javascript) 5.43 KiB (runtime) >{128}< >{786}< [entry] [rendered] +chunk bundle.js (main) 98 bytes (javascript) 5.42 KiB (runtime) >{128}< >{786}< [entry] [rendered] ./index.js 98 bytes [built] + 8 hidden chunk modules chunk 459.bundle.js (c) 98 bytes <{128}> <{786}> >{128}< >{786}< [rendered] @@ -684,52 +684,52 @@ exports[`StatsTestCases should print correct stats for concat-and-sideeffects 1` `; exports[`StatsTestCases should print correct stats for context-independence 1`] = ` -"Hash: 3c59c3d45edbe20ee0af3c59c3d45edbe20ee0af39303b7d3ef1ce28f20139303b7d3ef1ce28f201 +"Hash: cc1c058603d38f2497facc1c058603d38f2497fab87c6ae33adeba417c54b87c6ae33adeba417c54 Child - Hash: 3c59c3d45edbe20ee0af + Hash: cc1c058603d38f2497fa Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 703-35b05b4f9ece3e5b7253.js 457 bytes [emitted] [immutable] 703-35b05b4f9ece3e5b7253.js.map 344 bytes [emitted] [dev] - main-322147d992bb0a885b10.js 8.02 KiB [emitted] [immutable] [name: main] - main-322147d992bb0a885b10.js.map 7.14 KiB [emitted] [dev] [name: (main)] - Entrypoint main = main-322147d992bb0a885b10.js (main-322147d992bb0a885b10.js.map) + main-cfadecfa45a71360cb9e.js 7.98 KiB [emitted] [immutable] [name: main] + main-cfadecfa45a71360cb9e.js.map 7.11 KiB [emitted] [dev] [name: (main)] + Entrypoint main = main-cfadecfa45a71360cb9e.js (main-cfadecfa45a71360cb9e.js.map) ./a/index.js 40 bytes [built] ./a/chunk.js + 1 modules 66 bytes [built] + 6 hidden modules Child - Hash: 3c59c3d45edbe20ee0af + Hash: cc1c058603d38f2497fa Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 703-35b05b4f9ece3e5b7253.js 457 bytes [emitted] [immutable] 703-35b05b4f9ece3e5b7253.js.map 344 bytes [emitted] [dev] - main-322147d992bb0a885b10.js 8.02 KiB [emitted] [immutable] [name: main] - main-322147d992bb0a885b10.js.map 7.14 KiB [emitted] [dev] [name: (main)] - Entrypoint main = main-322147d992bb0a885b10.js (main-322147d992bb0a885b10.js.map) + main-cfadecfa45a71360cb9e.js 7.98 KiB [emitted] [immutable] [name: main] + main-cfadecfa45a71360cb9e.js.map 7.11 KiB [emitted] [dev] [name: (main)] + Entrypoint main = main-cfadecfa45a71360cb9e.js (main-cfadecfa45a71360cb9e.js.map) ./b/index.js 40 bytes [built] ./b/chunk.js + 1 modules 66 bytes [built] + 6 hidden modules Child - Hash: 39303b7d3ef1ce28f201 + Hash: b87c6ae33adeba417c54 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 703-d460da0006247c80e6fd.js 1.51 KiB [emitted] [immutable] - main-d716298143ad43b551dc.js 8.91 KiB [emitted] [immutable] [name: main] - Entrypoint main = main-d716298143ad43b551dc.js + main-cac72fdf6d5096abb062.js 8.87 KiB [emitted] [immutable] [name: main] + Entrypoint main = main-cac72fdf6d5096abb062.js ./a/index.js 40 bytes [built] ./a/chunk.js + 1 modules 66 bytes [built] + 6 hidden modules Child - Hash: 39303b7d3ef1ce28f201 + Hash: b87c6ae33adeba417c54 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 703-d460da0006247c80e6fd.js 1.51 KiB [emitted] [immutable] - main-d716298143ad43b551dc.js 8.91 KiB [emitted] [immutable] [name: main] - Entrypoint main = main-d716298143ad43b551dc.js + main-cac72fdf6d5096abb062.js 8.87 KiB [emitted] [immutable] [name: main] + Entrypoint main = main-cac72fdf6d5096abb062.js ./b/index.js 40 bytes [built] ./b/chunk.js + 1 modules 66 bytes [built] + 6 hidden modules" @@ -1096,7 +1096,7 @@ Entrypoint e2 = e2.js chunk b.js (b) 49 bytes <{786}> >{459}< [rendered] ./module-b.js 49 bytes [built] import() ./module-b ./module-a.js 1:0-47 -chunk e1.js (e1) 49 bytes (javascript) 5.46 KiB (runtime) >{786}< [entry] [rendered] +chunk e1.js (e1) 49 bytes (javascript) 5.45 KiB (runtime) >{786}< [entry] [rendered] ./e1.js 49 bytes [built] entry ./e1 e1 + 8 hidden chunk modules @@ -1104,7 +1104,7 @@ chunk c.js (c) 49 bytes <{128}> <{621}> >{786}< [rendered] ./module-c.js 49 bytes [built] import() ./module-c ./e2.js 1:0-47 import() ./module-c ./module-b.js 1:0-47 -chunk e2.js (e2) 49 bytes (javascript) 5.46 KiB (runtime) >{459}< [entry] [rendered] +chunk e2.js (e2) 49 bytes (javascript) 5.45 KiB (runtime) >{459}< [entry] [rendered] ./e2.js 49 bytes [built] entry ./e2 e2 + 8 hidden chunk modules @@ -1120,7 +1120,7 @@ Entrypoint e2 = e2.js chunk b.js (b) 179 bytes <{786}> >{459}< [rendered] ./module-b.js 179 bytes [built] import() ./module-b ./module-a.js 1:0-47 -chunk e1.js (e1) 119 bytes (javascript) 5.73 KiB (runtime) >{786}< >{892}< [entry] [rendered] +chunk e1.js (e1) 119 bytes (javascript) 5.71 KiB (runtime) >{786}< >{892}< [entry] [rendered] ./e1.js 70 bytes [built] entry ./e1 e1 ./module-x.js 49 bytes [built] @@ -1132,7 +1132,7 @@ chunk c.js (c) 49 bytes <{128}> <{621}> >{786}< [rendered] ./module-c.js 49 bytes [built] import() ./module-c ./e2.js 2:0-47 import() ./module-c ./module-b.js 1:0-47 -chunk e2.js (e2) 119 bytes (javascript) 5.73 KiB (runtime) >{459}< >{892}< [entry] [rendered] +chunk e2.js (e2) 119 bytes (javascript) 5.71 KiB (runtime) >{459}< >{892}< [entry] [rendered] ./e2.js 70 bytes [built] entry ./e2 e2 ./module-x.js 49 bytes [built] @@ -1170,7 +1170,7 @@ chunk id-equals-name_js0.js 1 bytes [rendered] ./id-equals-name.js 1 bytes [built] chunk id-equals-name_js_3.js 1 bytes [rendered] ./id-equals-name.js?3 1 bytes [built] -chunk main.js (main) 639 bytes (javascript) 5.69 KiB (runtime) [entry] [rendered] +chunk main.js (main) 639 bytes (javascript) 5.67 KiB (runtime) [entry] [rendered] ./index.js 639 bytes [built] + 9 hidden root modules chunk tree.js (tree) 43 bytes [rendered] @@ -1185,19 +1185,19 @@ chunk trees.js (trees) 71 bytes [rendered] exports[`StatsTestCases should print correct stats for immutable 1`] = ` " Asset Size -459e878fcc68e6bc31b5.js 969 bytes [emitted] [immutable] -8de1e5224fd97f952d35.js 10.3 KiB [emitted] [immutable] [name: main]" +2e5c8e7789add597f0a3.js 10.3 KiB [emitted] [immutable] [name: main] +459e878fcc68e6bc31b5.js 969 bytes [emitted] [immutable]" `; exports[`StatsTestCases should print correct stats for import-context-filter 1`] = ` -"Hash: 781698f35c52fda3a34c +"Hash: f104ca8423b75b3910da Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 398.js 484 bytes [emitted] 544.js 484 bytes [emitted] 718.js 484 bytes [emitted] -entry.js 9.44 KiB [emitted] [name: entry] +entry.js 9.41 KiB [emitted] [name: entry] Entrypoint entry = entry.js ./entry.js 450 bytes [built] ./templates lazy ^\\\\.\\\\/.*$ include: \\\\.js$ exclude: \\\\.noimport\\\\.js$ namespace object 160 bytes [optional] [built] @@ -1208,12 +1208,12 @@ Entrypoint entry = entry.js `; exports[`StatsTestCases should print correct stats for import-weak 1`] = ` -"Hash: 6dbe8fe5e0ca1a6a79c1 +"Hash: 9ca01d0b495f60b6f5d4 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 836.js 142 bytes [emitted] -entry.js 10.1 KiB [emitted] [name: entry] +entry.js 10 KiB [emitted] [name: entry] Entrypoint entry = entry.js ./entry.js 120 bytes [built] ./modules/b.js 22 bytes [built] @@ -1245,7 +1245,7 @@ Compilation error while processing magic comment(-s): /* webpackPrefetch: nope * `; exports[`StatsTestCases should print correct stats for issue-7577 1`] = ` -"Hash: 240afdff8e34e13bf7c474666e54b11156c90f600bcb051f063ea4854f5a +"Hash: 240afdff8e34e13bf7c474666e54b11156c90f60d38a80cc1def96682e31 Child Hash: 240afdff8e34e13bf7c4 Time: X ms @@ -1271,16 +1271,16 @@ Child ./node_modules/vendor.js 23 bytes [built] + 4 hidden modules Child - Hash: 0bcb051f063ea4854f5a + Hash: d38a80cc1def96682e31 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size c-all-b_js-50bf184dfe57dc2022a6.js 506 bytes [emitted] [immutable] [id hint: all] c-all-c_js-6756694a5d280748f5a3.js 397 bytes [emitted] [immutable] [id hint: all] c-main-cd09b1722e319798c3c4.js 607 bytes [emitted] [immutable] [name: main] - c-runtime~main-b1642de27efb3100d464.js 11.5 KiB [emitted] [immutable] [name: runtime~main] + c-runtime~main-22ab6f32a8e9bb9f113b.js 11.4 KiB [emitted] [immutable] [name: runtime~main] c-vendors-node_modules_vendor_js-a51f8ed2c8dc9ce97afd.js 189 bytes [emitted] [immutable] [id hint: vendors] - Entrypoint main = c-runtime~main-b1642de27efb3100d464.js c-all-c_js-6756694a5d280748f5a3.js c-main-cd09b1722e319798c3c4.js (prefetch: c-vendors-node_modules_vendor_js-a51f8ed2c8dc9ce97afd.js c-all-b_js-50bf184dfe57dc2022a6.js) + Entrypoint main = c-runtime~main-22ab6f32a8e9bb9f113b.js c-all-c_js-6756694a5d280748f5a3.js c-main-cd09b1722e319798c3c4.js (prefetch: c-vendors-node_modules_vendor_js-a51f8ed2c8dc9ce97afd.js c-all-b_js-50bf184dfe57dc2022a6.js) ./c.js 61 bytes [built] ./b.js 17 bytes [built] ./node_modules/vendor.js 23 bytes [built] @@ -1288,7 +1288,7 @@ Child `; exports[`StatsTestCases should print correct stats for limit-chunk-count-plugin 1`] = ` -"Hash: 15b4b06d5bdcf1dbb31716d26c25af9645add63bd15c4ce907e30280da1c7e365bb10ae0bcc4b7e4 +"Hash: 15b4b06d5bdcf1dbb3178839e7746418e3b43d364f987317c5f9ca9c6b86c4c3c120d98e5075e490 Child 1 chunks: Hash: 15b4b06d5bdcf1dbb317 Time: X ms @@ -1305,14 +1305,14 @@ Child 1 chunks: ./index.js 101 bytes [built] + 4 hidden chunk modules Child 2 chunks: - Hash: 16d26c25af9645add63b + Hash: 8839e7746418e3b43d36 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 459.bundle2.js 666 bytes [emitted] [name: c] - bundle2.js 9.65 KiB [emitted] [name: main] + bundle2.js 9.61 KiB [emitted] [name: main] Entrypoint main = bundle2.js - chunk bundle2.js (main) 101 bytes (javascript) 5.44 KiB (runtime) >{459}< [entry] [rendered] + chunk bundle2.js (main) 101 bytes (javascript) 5.42 KiB (runtime) >{459}< [entry] [rendered] ./index.js 101 bytes [built] + 8 hidden chunk modules chunk 459.bundle2.js (c) 118 bytes <{179}> <{459}> >{459}< [rendered] @@ -1322,15 +1322,15 @@ Child 2 chunks: ./d.js 22 bytes [built] ./e.js 22 bytes [built] Child 3 chunks: - Hash: d15c4ce907e30280da1c + Hash: 4f987317c5f9ca9c6b86 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 459.bundle3.js 530 bytes [emitted] [name: c] 524.bundle3.js 210 bytes [emitted] - bundle3.js 9.65 KiB [emitted] [name: main] + bundle3.js 9.61 KiB [emitted] [name: main] Entrypoint main = bundle3.js - chunk bundle3.js (main) 101 bytes (javascript) 5.44 KiB (runtime) >{459}< [entry] [rendered] + chunk bundle3.js (main) 101 bytes (javascript) 5.42 KiB (runtime) >{459}< [entry] [rendered] ./index.js 101 bytes [built] + 8 hidden chunk modules chunk 459.bundle3.js (c) 74 bytes <{179}> >{524}< [rendered] @@ -1341,16 +1341,16 @@ Child 3 chunks: ./d.js 22 bytes [built] ./e.js 22 bytes [built] Child 4 chunks: - Hash: 7e365bb10ae0bcc4b7e4 + Hash: c4c3c120d98e5075e490 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 394.bundle4.js 210 bytes [emitted] 459.bundle4.js 394 bytes [emitted] [name: c] 524.bundle4.js 210 bytes [emitted] - bundle4.js 9.65 KiB [emitted] [name: main] + bundle4.js 9.61 KiB [emitted] [name: main] Entrypoint main = bundle4.js - chunk bundle4.js (main) 101 bytes (javascript) 5.44 KiB (runtime) >{394}< >{459}< [entry] [rendered] + chunk bundle4.js (main) 101 bytes (javascript) 5.42 KiB (runtime) >{394}< >{459}< [entry] [rendered] ./index.js 101 bytes [built] + 8 hidden chunk modules chunk 394.bundle4.js 44 bytes <{179}> [rendered] @@ -1461,7 +1461,7 @@ Entrypoint main = main.js `; exports[`StatsTestCases should print correct stats for module-assets 1`] = ` -"Hash: a0f836f8d11fa3366e14 +"Hash: 09818c8e8ab4eb5fb372 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size @@ -1469,14 +1469,14 @@ Built at: 1970-04-20 12:42:42 2.png 21 KiB [emitted] [name: (a, b)] a.js 988 bytes [emitted] [name: a] b.js 616 bytes [emitted] [name: b] -main.js 8.98 KiB [emitted] [name: main] +main.js 8.94 KiB [emitted] [name: main] Entrypoint main = main.js Chunk Group a = a.js (1.png 2.png) Chunk Group b = b.js (2.png) chunk b.js (b) 69 bytes [rendered] ./node_modules/a/2.png 51 bytes [built] [1 asset] ./node_modules/b/index.js 18 bytes [built] -chunk main.js (main) 82 bytes (javascript) 5.04 KiB (runtime) [entry] [rendered] +chunk main.js (main) 82 bytes (javascript) 5.03 KiB (runtime) [entry] [rendered] ./index.js 82 bytes [built] + 8 hidden chunk modules chunk a.js (a) 138 bytes [rendered] @@ -1507,7 +1507,7 @@ Entrypoint e2 = e2.js Entrypoint e3 = e3.js chunk 114.js 28 bytes [rendered] ./async1.js 28 bytes [built] -chunk e3.js (e3) 152 bytes (javascript) 5.02 KiB (runtime) [entry] [rendered] +chunk e3.js (e3) 152 bytes (javascript) 5 KiB (runtime) [entry] [rendered] ./a.js 9 bytes [built] ./b.js 9 bytes [built] ./e3.js 116 bytes [built] @@ -1516,7 +1516,7 @@ chunk e3.js (e3) 152 bytes (javascript) 5.02 KiB (runtime) [entry] [rendered] + 8 hidden chunk modules chunk 172.js 28 bytes [rendered] ./async2.js 28 bytes [built] -chunk e1.js (e1) 152 bytes (javascript) 5.02 KiB (runtime) [entry] [rendered] +chunk e1.js (e1) 152 bytes (javascript) 5 KiB (runtime) [entry] [rendered] ./a.js 9 bytes [built] ./b.js 9 bytes [built] ./c.js 9 bytes [built] @@ -1528,7 +1528,7 @@ chunk 326.js 37 bytes [rendered] ./h.js 9 bytes [built] chunk 593.js 28 bytes [rendered] ./async3.js 28 bytes [built] -chunk e2.js (e2) 152 bytes (javascript) 5.02 KiB (runtime) [entry] [rendered] +chunk e2.js (e2) 152 bytes (javascript) 5 KiB (runtime) [entry] [rendered] ./a.js 9 bytes [built] ./b.js 9 bytes [built] ./e.js 9 bytes [built] @@ -1548,20 +1548,20 @@ exports[`StatsTestCases should print correct stats for module-deduplication-name async1.js 839 bytes [emitted] [name: async1] async2.js 839 bytes [emitted] [name: async2] async3.js 839 bytes [emitted] [name: async3] - e1.js 10 KiB [emitted] [name: e1] - e2.js 10 KiB [emitted] [name: e2] - e3.js 10 KiB [emitted] [name: e3] + e1.js 9.97 KiB [emitted] [name: e1] + e2.js 9.97 KiB [emitted] [name: e2] + e3.js 9.97 KiB [emitted] [name: e3] Entrypoint e1 = e1.js Entrypoint e2 = e2.js Entrypoint e3 = e3.js -chunk e3.js (e3) 144 bytes (javascript) 5.07 KiB (runtime) [entry] [rendered] +chunk e3.js (e3) 144 bytes (javascript) 5.05 KiB (runtime) [entry] [rendered] ./a.js 9 bytes [built] ./b.js 9 bytes [built] ./e3.js 108 bytes [built] ./g.js 9 bytes [built] ./h.js 9 bytes [built] + 8 hidden chunk modules -chunk e1.js (e1) 144 bytes (javascript) 5.07 KiB (runtime) [entry] [rendered] +chunk e1.js (e1) 144 bytes (javascript) 5.05 KiB (runtime) [entry] [rendered] ./a.js 9 bytes [built] ./b.js 9 bytes [built] ./c.js 9 bytes [built] @@ -1574,7 +1574,7 @@ chunk async1.js (async1) 89 bytes [rendered] chunk async3.js (async3) 89 bytes [rendered] ./async3.js 80 bytes [built] ./h.js 9 bytes [built] -chunk e2.js (e2) 144 bytes (javascript) 5.07 KiB (runtime) [entry] [rendered] +chunk e2.js (e2) 144 bytes (javascript) 5.05 KiB (runtime) [entry] [rendered] ./a.js 9 bytes [built] ./b.js 9 bytes [built] ./e.js 9 bytes [built] @@ -1687,7 +1687,7 @@ exports[`StatsTestCases should print correct stats for named-chunk-groups 1`] = > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./shared.js 133 bytes [built] - chunk a-main.js (main) 146 bytes (javascript) 5.1 KiB (runtime) [entry] [rendered] + chunk a-main.js (main) 146 bytes (javascript) 5.08 KiB (runtime) [entry] [rendered] > ./ main ./index.js 146 bytes [built] + 8 hidden root modules @@ -1713,7 +1713,7 @@ Child > ./a ./index.js 1:0-47 > ./b ./index.js 2:0-47 ./shared.js 133 bytes [built] - chunk b-main.js (main) 146 bytes (javascript) 5.1 KiB (runtime) [entry] [rendered] + chunk b-main.js (main) 146 bytes (javascript) 5.08 KiB (runtime) [entry] [rendered] > ./ main ./index.js 146 bytes [built] + 8 hidden root modules @@ -1748,11 +1748,11 @@ Entrypoint entry = vendor.js entry.js `; exports[`StatsTestCases should print correct stats for named-chunks-plugin-async 1`] = ` -"Hash: 7abbbbb49488363d0624 +"Hash: 13f3946adc937dfdcf61 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size - entry.js 9.51 KiB [emitted] [name: entry] + entry.js 9.48 KiB [emitted] [name: entry] modules_a_js.js 316 bytes [emitted] modules_b_js.js 153 bytes [emitted] Entrypoint entry = entry.js @@ -1777,7 +1777,7 @@ You can also set it to 'none' to disable any default behavior. Learn more: https `; exports[`StatsTestCases should print correct stats for optimize-chunks 1`] = ` -"Hash: 7d84007dec272e753c2e +"Hash: fa01130d44bca49cd773 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size Chunks @@ -1788,13 +1788,13 @@ Built at: 1970-04-20 12:42:42 cir1.js 334 bytes {592} [emitted] [name: cir1] cir2 from cir1.js 378 bytes {288}, {289} [emitted] [name: cir2 from cir1] cir2.js 334 bytes {289} [emitted] [name: cir2] - main.js 8.54 KiB {179} [emitted] [name: main] + main.js 8.51 KiB {179} [emitted] [name: main] Entrypoint main = main.js chunk {90} ab.js (ab) 2 bytes <{179}> >{753}< [rendered] > [10] ./index.js 1:0-6:8 [839] ./modules/a.js 1 bytes {90} {374} [built] [836] ./modules/b.js 1 bytes {90} {374} [built] -chunk {179} main.js (main) 524 bytes (javascript) 4.3 KiB (runtime) >{90}< >{289}< >{374}< >{592}< [entry] [rendered] +chunk {179} main.js (main) 524 bytes (javascript) 4.28 KiB (runtime) >{90}< >{289}< >{374}< >{592}< [entry] [rendered] > ./index main [10] ./index.js 523 bytes {179} [built] [544] ./modules/f.js 1 bytes {179} [built] @@ -2090,7 +2090,7 @@ prefetched2.js 114 bytes [emitted] [name: prefetched2] prefetched3.js 114 bytes [emitted] [name: prefetched3] Entrypoint main = main.js (prefetch: prefetched2.js prefetched.js prefetched3.js) chunk normal.js (normal) 1 bytes <{179}> [rendered] -chunk main.js (main) 436 bytes (javascript) 6.85 KiB (runtime) >{30}< >{220}< >{379}< >{505}< (prefetch: {379} {505} {220}) [entry] [rendered] +chunk main.js (main) 436 bytes (javascript) 6.84 KiB (runtime) >{30}< >{220}< >{379}< >{505}< (prefetch: {379} {505} {220}) [entry] [rendered] chunk prefetched3.js (prefetched3) 1 bytes <{179}> [rendered] chunk prefetched2.js (prefetched2) 1 bytes <{179}> [rendered] chunk prefetched.js (prefetched) 228 bytes <{179}> >{641}< >{746}< (prefetch: {641} {746}) [rendered] @@ -2105,7 +2105,7 @@ chunk c1.js (c1) 1 bytes <{459}> [rendered] chunk b.js (b) 203 bytes <{179}> >{132}< >{751}< >{978}< (prefetch: {751} {132}) (preload: {978}) [rendered] chunk b3.js (b3) 1 bytes <{128}> [rendered] chunk a2.js (a2) 1 bytes <{786}> [rendered] -chunk main.js (main) 195 bytes (javascript) 7.52 KiB (runtime) >{128}< >{459}< >{786}< (prefetch: {786} {128} {459}) [entry] [rendered] +chunk main.js (main) 195 bytes (javascript) 7.51 KiB (runtime) >{128}< >{459}< >{786}< (prefetch: {786} {128} {459}) [entry] [rendered] chunk c.js (c) 134 bytes <{179}> >{3}< >{76}< (preload: {76} {3}) [rendered] chunk b1.js (b1) 1 bytes <{128}> [rendered] chunk a.js (a) 136 bytes <{179}> >{74}< >{178}< (prefetch: {74} {178}) [rendered] @@ -2123,7 +2123,7 @@ preloaded2.js 113 bytes [emitted] [name: preloaded2] preloaded3.js 112 bytes [emitted] [name: preloaded3] Entrypoint main = main.js (preload: preloaded2.js preloaded.js preloaded3.js) chunk normal.js (normal) 1 bytes [rendered] -chunk main.js (main) 424 bytes (javascript) 6.67 KiB (runtime) (preload: {363} {851} {355}) [entry] [rendered] +chunk main.js (main) 424 bytes (javascript) 6.65 KiB (runtime) (preload: {363} {851} {355}) [entry] [rendered] chunk preloaded3.js (preloaded3) 1 bytes [rendered] chunk preloaded2.js (preloaded2) 1 bytes [rendered] chunk inner2.js (inner2) 2 bytes [rendered] @@ -2140,7 +2140,7 @@ exports[`StatsTestCases should print correct stats for preset-detailed 1`] = ` <+> [LogTestPlugin] Collaped group [LogTestPlugin] Log [LogTestPlugin] End -Hash: 024d57772fd9d4dc8f32 +Hash: 925032eb3197675c4411 Time: X ms Built at: 1970-04-20 12:42:42 PublicPath: (none) @@ -2148,9 +2148,9 @@ PublicPath: (none) 460.js 324 bytes {460} [emitted] 524.js 210 bytes {524} [emitted] 996.js 142 bytes {996} [emitted] -main.js 7.74 KiB {179} [emitted] [name: main] +main.js 7.7 KiB {179} [emitted] [name: main] Entrypoint main = main.js -chunk {179} main.js (main) 73 bytes (javascript) 4.19 KiB (runtime) >{460}< >{996}< [entry] [rendered] +chunk {179} main.js (main) 73 bytes (javascript) 4.18 KiB (runtime) >{460}< >{996}< [entry] [rendered] > ./index main chunk {460} 460.js 54 bytes <{179}> >{524}< [rendered] > ./c [10] ./index.js 3:0-16 @@ -2180,7 +2180,7 @@ webpack/runtime/get javascript chunk filename 167 bytes {179} [runtime] webpack/runtime/hasOwnProperty shorthand 86 bytes {179} [runtime] [no exports] [used exports unknown] -webpack/runtime/jsonp chunk loading 3.6 KiB {179} [runtime] +webpack/runtime/jsonp chunk loading 3.59 KiB {179} [runtime] [no exports] [used exports unknown] webpack/runtime/publicPath 27 bytes {179} [runtime] @@ -2260,14 +2260,14 @@ exports[`StatsTestCases should print correct stats for preset-normal 1`] = ` " [LogTestPlugin] Error [LogTestPlugin] Warning [LogTestPlugin] Info -Hash: 024d57772fd9d4dc8f32 +Hash: 925032eb3197675c4411 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 460.js 324 bytes [emitted] 524.js 210 bytes [emitted] 996.js 142 bytes [emitted] -main.js 7.74 KiB [emitted] [name: main] +main.js 7.7 KiB [emitted] [name: main] Entrypoint main = main.js ./index.js 51 bytes [built] ./a.js 22 bytes [built] @@ -2361,7 +2361,7 @@ exports[`StatsTestCases should print correct stats for preset-verbose 1`] = ` [LogTestPlugin] Inner inner message [LogTestPlugin] Log [LogTestPlugin] End -Hash: 024d57772fd9d4dc8f32 +Hash: 925032eb3197675c4411 Time: X ms Built at: 1970-04-20 12:42:42 PublicPath: (none) @@ -2369,9 +2369,9 @@ PublicPath: (none) 460.js 324 bytes {460} [emitted] 524.js 210 bytes {524} [emitted] 996.js 142 bytes {996} [emitted] -main.js 7.74 KiB {179} [emitted] [name: main] +main.js 7.7 KiB {179} [emitted] [name: main] Entrypoint main = main.js -chunk {179} main.js (main) 73 bytes (javascript) 4.19 KiB (runtime) >{460}< >{996}< [entry] [rendered] +chunk {179} main.js (main) 73 bytes (javascript) 4.18 KiB (runtime) >{460}< >{996}< [entry] [rendered] > ./index main [847] ./a.js 22 bytes {179} [depth 1] [built] ModuleConcatenation bailout: Module is not an ECMAScript module @@ -2392,7 +2392,7 @@ chunk {179} main.js (main) 73 bytes (javascript) 4.19 KiB (runtime) >{460}< >{99 webpack/runtime/hasOwnProperty shorthand 86 bytes {179} [runtime] [no exports] [used exports unknown] - webpack/runtime/jsonp chunk loading 3.6 KiB {179} [runtime] + webpack/runtime/jsonp chunk loading 3.59 KiB {179} [runtime] [no exports] [used exports unknown] webpack/runtime/publicPath 27 bytes {179} [runtime] @@ -2572,7 +2572,7 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration Asset Size without-505.js 1.22 KiB [emitted] without-main1.js 601 bytes [emitted] [name: main1] - without-runtime.js 10 KiB [emitted] [name: runtime] + without-runtime.js 9.96 KiB [emitted] [name: runtime] Entrypoint main1 = without-runtime.js without-main1.js ./main1.js 66 bytes [built] ./b.js 20 bytes [built] @@ -2605,7 +2605,7 @@ Entrypoint e2 = runtime.js e2.js" `; exports[`StatsTestCases should print correct stats for scope-hoisting-bailouts 1`] = ` -"Hash: 7cfe1ff84c4ec618a2da +"Hash: c710798c836957d64814 Time: X ms Built at: 1970-04-20 12:42:42 Entrypoint index = index.js @@ -2635,9 +2635,9 @@ external \\"external\\" 42 bytes [built] `; exports[`StatsTestCases should print correct stats for scope-hoisting-multi 1`] = ` -"Hash: 7cb360b116ad92cf28c7eecef53ff6803bb3e2c1 +"Hash: 0889473011d0255191769306a1593cdfa11fe6c7 Child - Hash: 7cb360b116ad92cf28c7 + Hash: 0889473011d025519176 Time: X ms Built at: 1970-04-20 12:42:42 Entrypoint first = a-vendor.js a-first.js @@ -2655,7 +2655,7 @@ Child ./common_lazy_shared.js 25 bytes [built] + 12 hidden modules Child - Hash: eecef53ff6803bb3e2c1 + Hash: 9306a1593cdfa11fe6c7 Time: X ms Built at: 1970-04-20 12:42:42 Entrypoint first = b-vendor.js b-first.js @@ -2682,12 +2682,12 @@ Child `; exports[`StatsTestCases should print correct stats for side-effects-issue-7428 1`] = ` -"Hash: 63afda29824f1a48fef1 +"Hash: 62cf5103264a5d225396 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size 1.js 642 bytes [emitted] -main.js 9.78 KiB [emitted] [name: main] +main.js 9.75 KiB [emitted] [name: main] Entrypoint main = main.js ./main.js + 1 modules 231 bytes [built] [no exports used] @@ -2802,7 +2802,7 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` chunk default/async-g.js (async-g) 34 bytes <{282}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered] > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] - chunk default/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] + chunk default/main.js (main) 147 bytes (javascript) 4.83 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -2835,7 +2835,7 @@ exports[`StatsTestCases should print correct stats for split-chunks 1`] = ` chunk default/769.js (id hint: vendors) 20 bytes <{179}> ={282}= ={383}= ={568}= ={767}= [rendered] split chunk (cache group: defaultVendors) > ./c ./index.js 3:0-47 ./node_modules/z.js 20 bytes [built] - chunk default/a.js (a) 216 bytes (javascript) 4.84 KiB (runtime) >{137}< >{568}< [entry] [rendered] + chunk default/a.js (a) 216 bytes (javascript) 4.82 KiB (runtime) >{137}< >{568}< [entry] [rendered] > ./a a ./a.js + 1 modules 156 bytes [built] + 7 hidden root modules @@ -2860,7 +2860,7 @@ Child all-chunks: chunk all-chunks/async-g.js (async-g) 34 bytes <{282}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered] > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] - chunk all-chunks/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] + chunk all-chunks/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -2900,7 +2900,7 @@ Child all-chunks: > ./c ./index.js 3:0-47 > ./c c ./node_modules/z.js 20 bytes [built] - chunk all-chunks/a.js (a) 156 bytes (javascript) 6 KiB (runtime) ={282}= ={767}= ={954}= >{137}< >{568}< [entry] [rendered] + chunk all-chunks/a.js (a) 156 bytes (javascript) 5.98 KiB (runtime) ={282}= ={767}= ={954}= >{137}< >{568}< [entry] [rendered] > ./a a ./a.js + 1 modules 156 bytes [built] + 7 hidden root modules @@ -2930,7 +2930,7 @@ Child manual: > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] + 1 hidden dependent module - chunk manual/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered] + chunk manual/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -2969,7 +2969,7 @@ Child manual: ./c.js 72 bytes [built] + 4 hidden root modules + 2 hidden dependent modules - chunk manual/a.js (a) 176 bytes (javascript) 5.99 KiB (runtime) ={216}= >{137}< [entry] [rendered] + chunk manual/a.js (a) 176 bytes (javascript) 5.98 KiB (runtime) ={216}= >{137}< [entry] [rendered] > ./a a > x a > y a @@ -2989,7 +2989,7 @@ Child name-too-long: chunk name-too-long/async-g.js (async-g) 34 bytes <{282}> <{751}> <{767}> <{794}> <{954}> ={568}= [rendered] > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] - chunk name-too-long/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] + chunk name-too-long/main.js (main) 147 bytes (javascript) 4.84 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -3019,7 +3019,7 @@ Child name-too-long: chunk name-too-long/cccccccccccccccccccccccccccccc.js (cccccccccccccccccccccccccccccc) 3.18 KiB ={282}= ={383}= ={568}= ={767}= ={769}= [entry] [rendered] > ./c cccccccccccccccccccccccccccccc 4 root modules - chunk name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 6 KiB ={282}= ={767}= ={794}= ={954}= >{137}< >{568}< [entry] [rendered] + chunk name-too-long/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.js (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) 5.98 KiB ={282}= ={767}= ={794}= ={954}= >{137}< >{568}< [entry] [rendered] > ./a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 7 root modules chunk name-too-long/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.js (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) 3.18 KiB ={282}= ={334}= ={568}= ={767}= ={954}= [entry] [rendered] @@ -3060,7 +3060,7 @@ Child custom-chunks-filter: chunk custom-chunks-filter/async-g.js (async-g) 34 bytes <{282}> <{767}> <{786}> <{794}> <{954}> ={568}= [rendered] > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] - chunk custom-chunks-filter/main.js (main) 147 bytes (javascript) 4.86 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] + chunk custom-chunks-filter/main.js (main) 147 bytes (javascript) 4.85 KiB (runtime) >{282}< >{334}< >{383}< >{568}< >{767}< >{769}< >{794}< >{954}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -3098,7 +3098,7 @@ Child custom-chunks-filter: > ./c ./index.js 3:0-47 > ./c c ./node_modules/z.js 20 bytes [built] - chunk custom-chunks-filter/a.js (a) 216 bytes (javascript) 4.85 KiB (runtime) >{137}< >{568}< [entry] [rendered] + chunk custom-chunks-filter/a.js (a) 216 bytes (javascript) 4.83 KiB (runtime) >{137}< >{568}< [entry] [rendered] > ./a a ./a.js + 1 modules 156 bytes [built] + 7 hidden root modules @@ -3128,7 +3128,7 @@ Child custom-chunks-filter-in-cache-groups: > ./g ./a.js 6:0-47 ./g.js 34 bytes [built] + 1 hidden dependent module - chunk custom-chunks-filter-in-cache-groups/main.js (main) 147 bytes (javascript) 4.88 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered] + chunk custom-chunks-filter-in-cache-groups/main.js (main) 147 bytes (javascript) 4.87 KiB (runtime) >{216}< >{334}< >{383}< >{794}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules @@ -3163,7 +3163,7 @@ Child custom-chunks-filter-in-cache-groups: ./c.js 72 bytes [built] + 4 hidden root modules + 2 hidden dependent modules - chunk custom-chunks-filter-in-cache-groups/a.js (a) 236 bytes (javascript) 4.82 KiB (runtime) >{137}< [entry] [rendered] + chunk custom-chunks-filter-in-cache-groups/a.js (a) 236 bytes (javascript) 4.8 KiB (runtime) >{137}< [entry] [rendered] > ./a a > x a > y a @@ -3210,7 +3210,7 @@ chunk common-node_modules_y_js.js (id hint: common) 20 bytes <{main}> ={async-a} chunk common-node_modules_z_js.js (id hint: common) 20 bytes <{main}> ={async-c}= ={common-d_js}= ={common-f_js}= ={common-node_modules_x_js}= [rendered] split chunk (cache group: b) > ./c ./index.js 3:0-47 ./node_modules/z.js 20 bytes [built] -chunk main.js (main) 147 bytes (javascript) 4.77 KiB (runtime) >{async-a}< >{async-b}< >{async-c}< >{common-d_js}< >{common-f_js}< >{common-node_modules_x_js}< >{common-node_modules_y_js}< >{common-node_modules_z_js}< [entry] [rendered] +chunk main.js (main) 147 bytes (javascript) 4.75 KiB (runtime) >{async-a}< >{async-b}< >{async-c}< >{common-d_js}< >{common-f_js}< >{common-node_modules_x_js}< >{common-node_modules_y_js}< >{common-node_modules_z_js}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 7 hidden root modules" @@ -3218,7 +3218,7 @@ chunk main.js (main) 147 bytes (javascript) 4.77 KiB (runtime) >{async-a}< >{asy exports[`StatsTestCases should print correct stats for split-chunks-chunk-name 1`] = ` "Entrypoint main = default/main.js -chunk default/main.js (main) 192 bytes (javascript) 4.82 KiB (runtime) >{334}< >{709}< >{794}< [entry] [rendered] +chunk default/main.js (main) 192 bytes (javascript) 4.81 KiB (runtime) >{334}< >{709}< >{794}< [entry] [rendered] > ./ main ./index.js 192 bytes [built] + 7 hidden chunk modules @@ -3244,7 +3244,7 @@ chunk async-g.js (async-g) 101 bytes <{179}> [rendered] > ./g ./index.js 7:0-47 ./g.js 34 bytes [built] + 1 hidden dependent module -chunk main.js (main) 343 bytes (javascript) 5.14 KiB (runtime) >{31}< >{137}< >{206}< >{334}< >{383}< >{449}< >{794}< >{804}< [entry] [rendered] +chunk main.js (main) 343 bytes (javascript) 5.13 KiB (runtime) >{31}< >{137}< >{206}< >{334}< >{383}< >{449}< >{794}< >{804}< [entry] [rendered] > ./ main ./index.js 343 bytes [built] + 8 hidden root modules @@ -3275,7 +3275,7 @@ chunk 804.js 134 bytes <{179}> ={334}= ={794}= [rendered] split chunk (cache gro exports[`StatsTestCases should print correct stats for split-chunks-issue-6413 1`] = ` "Entrypoint main = main.js -chunk main.js (main) 147 bytes (javascript) 4.52 KiB (runtime) >{282}< >{334}< >{383}< >{543}< >{794}< [entry] [rendered] +chunk main.js (main) 147 bytes (javascript) 4.51 KiB (runtime) >{282}< >{334}< >{383}< >{543}< >{794}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 6 hidden root modules @@ -3302,7 +3302,7 @@ chunk async-a.js (async-a) 19 bytes <{179}> ={282}= ={543}= [rendered] exports[`StatsTestCases should print correct stats for split-chunks-issue-6696 1`] = ` "Entrypoint main = vendors.js main.js -chunk main.js (main) 110 bytes (javascript) 5.67 KiB (runtime) ={216}= >{334}< >{794}< [entry] [rendered] +chunk main.js (main) 110 bytes (javascript) 5.66 KiB (runtime) ={216}= >{334}< >{794}< [entry] [rendered] > ./ main ./index.js 110 bytes [built] + 6 hidden root modules @@ -3323,7 +3323,7 @@ exports[`StatsTestCases should print correct stats for split-chunks-issue-7401 1 "Entrypoint a = 282.js a.js Entrypoint b = b.js Chunk Group c = 282.js c.js -chunk b.js (b) 43 bytes (javascript) 4.49 KiB (runtime) >{282}< >{459}< [entry] [rendered] +chunk b.js (b) 43 bytes (javascript) 4.47 KiB (runtime) >{282}< >{459}< [entry] [rendered] > ./b b ./b.js 43 bytes [built] + 6 hidden root modules @@ -3342,7 +3342,7 @@ chunk a.js (a) 12 bytes (javascript) 2.6 KiB (runtime) ={282}= [entry] [rendered exports[`StatsTestCases should print correct stats for split-chunks-keep-remaining-size 1`] = ` "Entrypoint main = default/main.js -chunk default/main.js (main) 147 bytes (javascript) 5.09 KiB (runtime) >{334}< >{383}< >{794}< >{821}< [entry] [rendered] +chunk default/main.js (main) 147 bytes (javascript) 5.08 KiB (runtime) >{334}< >{383}< >{794}< >{821}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 8 hidden chunk modules @@ -3658,7 +3658,7 @@ Child zero-min: ./node_modules/small.js?2 67 bytes [built] Child max-async-size: Entrypoint main = max-async-size-main.js - chunk max-async-size-main.js (main) 2.47 KiB (javascript) 5.13 KiB (runtime) >{342}< >{385}< >{820}< >{920}< [entry] [rendered] + chunk max-async-size-main.js (main) 2.47 KiB (javascript) 5.12 KiB (runtime) >{342}< >{385}< >{820}< >{920}< [entry] [rendered] > ./async main ./async/index.js 386 bytes [built] + 8 hidden root modules @@ -3766,7 +3766,7 @@ chunk default/118.js 110 bytes <{179}> ={334}= ={383}= [rendered] split chunk (c > ./c ./index.js 3:0-47 ./d.js 43 bytes [built] ./f.js 67 bytes [built] -chunk default/main.js (main) 147 bytes (javascript) 5.09 KiB (runtime) >{118}< >{334}< >{383}< >{794}< [entry] [rendered] +chunk default/main.js (main) 147 bytes (javascript) 5.08 KiB (runtime) >{118}< >{334}< >{383}< >{794}< [entry] [rendered] > ./ main ./index.js 147 bytes [built] + 8 hidden root modules @@ -3851,7 +3851,7 @@ WARNING in Terser Plugin: Dropping unused function someUnRemoteUsedFunction5 [we `; exports[`StatsTestCases should print correct stats for wasm-explorer-examples-sync 1`] = ` -"Hash: 6447a9fca2b71320b7dd +"Hash: 426dfe4bd9e569cd2869 Time: X ms Built at: 1970-04-20 12:42:42 Asset Size @@ -3876,7 +3876,7 @@ chunk 325.bundle.js 1.54 KiB (javascript) 274 bytes (webassembly) [rendered] ./popcnt.wasm 50 bytes (javascript) 120 bytes (webassembly) [built] ./testFunction.wasm 50 bytes (javascript) 154 bytes (webassembly) [built] ./tests.js 1.44 KiB [built] -chunk bundle.js (main-1df31ce3) 586 bytes (javascript) 5.51 KiB (runtime) [entry] [rendered] +chunk bundle.js (main-1df31ce3) 586 bytes (javascript) 5.49 KiB (runtime) [entry] [rendered] ./index.js 586 bytes [built] + 8 hidden chunk modules chunk 526.bundle.js (id hint: vendors) 34 bytes [rendered] split chunk (cache group: defaultVendors) diff --git a/test/hotCases/invalidate/conditional-accept/data.json b/test/hotCases/invalidate/conditional-accept/data.json new file mode 100644 index 000000000..a99a38c69 --- /dev/null +++ b/test/hotCases/invalidate/conditional-accept/data.json @@ -0,0 +1,7 @@ +{ "a": 1, "b": 1 } +--- +{ "a": 2, "b": 1 } +--- +{ "a": 2, "b": 2 } +--- +{ "a": 3, "b": 3 } diff --git a/test/hotCases/invalidate/conditional-accept/index.js b/test/hotCases/invalidate/conditional-accept/index.js new file mode 100644 index 000000000..e79259281 --- /dev/null +++ b/test/hotCases/invalidate/conditional-accept/index.js @@ -0,0 +1,48 @@ +import "./data.json"; +import mod1 from "./module1"; +import mod2 from "./module2"; +import { value1, value2 } from "./store"; + +it("should invalidate a self-accepted module", function(done) { + expect(mod1).toBe(1); + expect(mod2).toBe(1); + expect(value1).toBe(1); + expect(value2).toBe(1); + let step = 0; + module.hot.accept("./module1"); + module.hot.accept("./module2"); + module.hot.accept("./data.json", () => + setTimeout(() => { + switch (step) { + case 0: + step++; + expect(mod1).toBe(1); + expect(mod2).toBe(1); + expect(value1).toBe(2); + expect(value2).toBe(2); + NEXT(require("../../update")(done)); + break; + case 1: + step++; + expect(mod1).toBe(2); + expect(mod2).toBe(2); + expect(value1).toBe(2); + expect(value2).toBe(2); + NEXT(require("../../update")(done)); + break; + case 2: + step++; + expect(mod1).toBe(3); + expect(mod2).toBe(3); + expect(value1).toBe(3); + expect(value2).toBe(3); + done(); + break; + default: + done(new Error("should not happen")); + break; + } + }, 100) + ); + NEXT(require("../../update")(done)); +}); diff --git a/test/hotCases/invalidate/conditional-accept/module1.js b/test/hotCases/invalidate/conditional-accept/module1.js new file mode 100644 index 000000000..e478012e7 --- /dev/null +++ b/test/hotCases/invalidate/conditional-accept/module1.js @@ -0,0 +1,16 @@ +import data from "./data.json"; +import { setValue1 } from "./store"; + +setValue1(data.a); + +export default data.b; + +if (module.hot.data && module.hot.data.ok && module.hot.data.b !== data.b) { + module.hot.invalidate(); +} else { + module.hot.dispose(d => { + d.ok = true; + d.b = data.b; + }); + module.hot.accept(); +} diff --git a/test/hotCases/invalidate/conditional-accept/module2.js b/test/hotCases/invalidate/conditional-accept/module2.js new file mode 100644 index 000000000..0538d7e44 --- /dev/null +++ b/test/hotCases/invalidate/conditional-accept/module2.js @@ -0,0 +1,16 @@ +import data from "./data.json"; +import { setValue2 } from "./store"; + +setValue2(data.a); + +export default data.b; + +const b = data.b; + +module.hot.accept(["./data.json"], () => { + if (data.b !== b) { + module.hot.invalidate(); + return; + } + setValue2(data.a); +}); diff --git a/test/hotCases/invalidate/conditional-accept/store.js b/test/hotCases/invalidate/conditional-accept/store.js new file mode 100644 index 000000000..bc8c9c68f --- /dev/null +++ b/test/hotCases/invalidate/conditional-accept/store.js @@ -0,0 +1,9 @@ +export let value1 = 0; +export function setValue1(v) { + value1 = v; +} + +export let value2 = 0; +export function setValue2(v) { + value2 = v; +} diff --git a/test/hotCases/invalidate/during-idle/a.js b/test/hotCases/invalidate/during-idle/a.js new file mode 100644 index 000000000..df594c6c2 --- /dev/null +++ b/test/hotCases/invalidate/during-idle/a.js @@ -0,0 +1,5 @@ +export function invalidate() { + module.hot.invalidate(); +} + +export const value = {}; diff --git a/test/hotCases/invalidate/during-idle/b.js b/test/hotCases/invalidate/during-idle/b.js new file mode 100644 index 000000000..70b8f861b --- /dev/null +++ b/test/hotCases/invalidate/during-idle/b.js @@ -0,0 +1,7 @@ +export function invalidate() { + module.hot.invalidate(); +} + +export const value = {}; + +module.hot.accept(); diff --git a/test/hotCases/invalidate/during-idle/c.js b/test/hotCases/invalidate/during-idle/c.js new file mode 100644 index 000000000..424b691d9 --- /dev/null +++ b/test/hotCases/invalidate/during-idle/c.js @@ -0,0 +1,11 @@ +export function invalidate() { + module.hot.invalidate(); +} + +export const value = module.hot.data ? module.hot.data.value : {}; + +module.hot.dispose(data => { + data.value = value; +}); + +module.hot.accept(); diff --git a/test/hotCases/invalidate/during-idle/index.js b/test/hotCases/invalidate/during-idle/index.js new file mode 100644 index 000000000..1a406401b --- /dev/null +++ b/test/hotCases/invalidate/during-idle/index.js @@ -0,0 +1,19 @@ +import { a, b, c } from "./module"; + +it("should allow to invalidate and reload a file", () => { + const oldA = a.value; + const oldB = b.value; + const oldC = c.value; + expect(module.hot.status()).toBe("idle"); + a.invalidate(); + expect(module.hot.status()).toBe("ready"); + b.invalidate(); + expect(module.hot.status()).toBe("ready"); + c.invalidate(); + expect(module.hot.status()).toBe("ready"); + module.hot.apply(); + expect(module.hot.status()).toBe("idle"); + expect(a.value).not.toBe(oldA); + expect(b.value).not.toBe(oldB); + expect(c.value).toBe(oldC); +}); diff --git a/test/hotCases/invalidate/during-idle/module.js b/test/hotCases/invalidate/during-idle/module.js new file mode 100644 index 000000000..62a44c6d0 --- /dev/null +++ b/test/hotCases/invalidate/during-idle/module.js @@ -0,0 +1,7 @@ +import * as a from "./a"; +import * as b from "./b"; +import * as c from "./c"; + +export { a, b, c }; + +module.hot.accept(["./a", "./b", "./c"]); From f409088ef232106288270f3aa842b3bd742feba2 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2020 02:13:01 +0000 Subject: [PATCH 02/30] chore(deps-dev): bump style-loader from 1.1.3 to 1.1.4 Bumps [style-loader](https://github.com/webpack-contrib/style-loader) from 1.1.3 to 1.1.4. - [Release notes](https://github.com/webpack-contrib/style-loader/releases) - [Changelog](https://github.com/webpack-contrib/style-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/style-loader/compare/v1.1.3...v1.1.4) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 08ca6e364..ab68f0e50 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4382,6 +4382,15 @@ loader-utils@^1.0.0, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2 emojis-list "^3.0.0" json5 "^1.0.1" +loader-utils@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" + integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== + dependencies: + big.js "^5.2.2" + emojis-list "^3.0.0" + json5 "^2.1.2" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -6441,12 +6450,12 @@ strip-json-comments@~2.0.1: integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= style-loader@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.1.3.tgz#9e826e69c683c4d9bf9db924f85e9abb30d5e200" - integrity sha512-rlkH7X/22yuwFYK357fMN/BxYOorfnfq0eD7+vqlemSK4wEcejFF1dg4zxP0euBW8NrYx2WZzZ8PPFevr7D+Kw== + version "1.1.4" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.1.4.tgz#1ad81283cefe51096756fd62697258edad933230" + integrity sha512-SbBHRD8fwK3pX+4UDF4ETxUF0+rCvk29LWTTI7Rt0cgsDjAj3SWM76ByTe6u2+4IlJ/WwluB7wuslWETCoPQdg== dependencies: - loader-utils "^1.2.3" - schema-utils "^2.6.4" + loader-utils "^2.0.0" + schema-utils "^2.6.5" supports-color@^2.0.0: version "2.0.0" From 49a6184e2040fe37a30b360134be5978e91a46c8 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 16 Apr 2020 09:37:11 +0200 Subject: [PATCH 03/30] add tests to increase code coverage --- lib/DependencyTemplate.js | 4 +-- lib/Generator.js | 8 +++-- lib/Module.js | 10 ++++++- lib/ModuleFactory.js | 5 ++-- lib/Parser.js | 5 ++-- lib/RuntimeModule.js | 3 +- lib/library/AbstractLibraryPlugin.js | 1 + lib/serialization/SerializerMiddleware.js | 14 +++++---- lib/util/Hash.js | 4 +++ test/PersistentCaching.test.js | 30 +++++++++++++++++-- test/ProgressPlugin.test.js | 29 +++++++++++++++++- .../wasm/import-wasm-wasm/index.js | 6 ++++ .../wasm/import-wasm-wasm/test.filter.js | 5 ++++ .../wasm/import-wasm-wasm/wasm.wat | 9 ++++++ .../wasm/import-wasm-wasm/wasm2.wat | 5 ++++ .../wasm/import-wasm-wasm/webpack.config.js | 15 ++++++++++ 16 files changed, 133 insertions(+), 20 deletions(-) create mode 100644 test/configCases/wasm/import-wasm-wasm/index.js create mode 100644 test/configCases/wasm/import-wasm-wasm/test.filter.js create mode 100644 test/configCases/wasm/import-wasm-wasm/wasm.wat create mode 100644 test/configCases/wasm/import-wasm-wasm/wasm2.wat create mode 100644 test/configCases/wasm/import-wasm-wasm/webpack.config.js diff --git a/lib/DependencyTemplate.js b/lib/DependencyTemplate.js index 84a8d8287..7d04d6e3e 100644 --- a/lib/DependencyTemplate.js +++ b/lib/DependencyTemplate.js @@ -5,8 +5,6 @@ "use strict"; -const AbstractMethodError = require("./AbstractMethodError"); - /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ /** @typedef {import("./ChunkGraph")} ChunkGraph */ /** @typedef {import("./Dependency")} Dependency */ @@ -28,6 +26,7 @@ const AbstractMethodError = require("./AbstractMethodError"); */ class DependencyTemplate { + /* istanbul ignore next */ /** * @abstract * @param {Dependency} dependency the dependency for which the template should be applied @@ -36,6 +35,7 @@ class DependencyTemplate { * @returns {void} */ apply(dependency, source, templateContext) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } } diff --git a/lib/Generator.js b/lib/Generator.js index f272a4484..ddd1df573 100644 --- a/lib/Generator.js +++ b/lib/Generator.js @@ -5,8 +5,6 @@ "use strict"; -const AbstractMethodError = require("./AbstractMethodError"); - /** @typedef {import("webpack-sources").Source} Source */ /** @typedef {import("./ChunkGraph")} ChunkGraph */ /** @typedef {import("./Compilation")} Compilation */ @@ -41,15 +39,18 @@ class Generator { return new ByTypeGenerator(map); } + /* istanbul ignore next */ /** * @abstract * @param {NormalModule} module fresh module * @returns {Set} available types (do not mutate) */ getTypes(module) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } + /* istanbul ignore next */ /** * @abstract * @param {NormalModule} module the module @@ -57,9 +58,11 @@ class Generator { * @returns {number} estimate size of the module */ getSize(module, type) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } + /* istanbul ignore next */ /** * @abstract * @param {NormalModule} module module for which the code should be generated @@ -70,6 +73,7 @@ class Generator { module, { dependencyTemplates, runtimeTemplate, moduleGraph, type } ) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } diff --git a/lib/Module.js b/lib/Module.js index c12ec4b03..079f37b41 100644 --- a/lib/Module.js +++ b/lib/Module.js @@ -6,7 +6,6 @@ "use strict"; const util = require("util"); -const AbstractMethodError = require("./AbstractMethodError"); const ChunkGraph = require("./ChunkGraph"); const DependenciesBlock = require("./DependenciesBlock"); const ModuleGraph = require("./ModuleGraph"); @@ -647,23 +646,28 @@ class Module extends DependenciesBlock { // should be overridden to support this feature } + /* istanbul ignore next */ /** * @abstract * @returns {string} a unique identifier of the module */ identifier() { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } + /* istanbul ignore next */ /** * @abstract * @param {RequestShortener} requestShortener the request shortener * @returns {string} a user readable identifier of the module */ readableIdentifier(requestShortener) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } + /* istanbul ignore next */ /** * @abstract * @param {WebpackOptions} options webpack options @@ -674,6 +678,7 @@ class Module extends DependenciesBlock { * @returns {void} */ build(options, compilation, resolver, fs, callback) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } @@ -698,6 +703,7 @@ class Module extends DependenciesBlock { */ source(sourceContext) { if (this.codeGeneration === Module.prototype.codeGeneration) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } const sources = this.codeGeneration(sourceContext).sources; @@ -706,12 +712,14 @@ class Module extends DependenciesBlock { : sources.get(this.getSourceTypes().values().next().value); } + /* istanbul ignore next */ /** * @abstract * @param {string=} type the source type for which the size should be estimated * @returns {number} the estimated size of the module (must be non-zero) */ size(type) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } diff --git a/lib/ModuleFactory.js b/lib/ModuleFactory.js index 1bccd458a..92511d6f3 100644 --- a/lib/ModuleFactory.js +++ b/lib/ModuleFactory.js @@ -5,8 +5,6 @@ "use strict"; -const AbstractMethodError = require("./AbstractMethodError"); - /** @typedef {import("./Dependency")} Dependency */ /** @typedef {import("./Module")} Module */ @@ -33,12 +31,15 @@ const AbstractMethodError = require("./AbstractMethodError"); */ class ModuleFactory { + /* istanbul ignore next */ /** + * @abstract * @param {ModuleFactoryCreateData} data data object * @param {function(Error=, ModuleFactoryResult=): void} callback callback * @returns {void} */ create(data, callback) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } } diff --git a/lib/Parser.js b/lib/Parser.js index 5ec26adcc..b1c150c5a 100644 --- a/lib/Parser.js +++ b/lib/Parser.js @@ -5,8 +5,6 @@ "use strict"; -const AbstractMethodError = require("./AbstractMethodError"); - /** @typedef {import("./Compilation")} Compilation */ /** @typedef {import("./NormalModule")} NormalModule */ @@ -23,12 +21,15 @@ const AbstractMethodError = require("./AbstractMethodError"); /** @typedef {Record & ParserStateBase} ParserState */ class Parser { + /* istanbul ignore next */ /** + * @abstract * @param {string | Buffer | PreparsedAst} source the source to parse * @param {ParserState} state the parser state * @returns {ParserState} the parser state */ parse(source, state) { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } } diff --git a/lib/RuntimeModule.js b/lib/RuntimeModule.js index 1ac0fb10f..71f3a72f1 100644 --- a/lib/RuntimeModule.js +++ b/lib/RuntimeModule.js @@ -6,7 +6,6 @@ "use strict"; const OriginalSource = require("webpack-sources").OriginalSource; -const AbstractMethodError = require("./AbstractMethodError"); const Module = require("./Module"); /** @typedef {import("webpack-sources").Source} Source */ @@ -145,11 +144,13 @@ class RuntimeModule extends Module { return 0; } + /* istanbul ignore next */ /** * @abstract * @returns {string} runtime code */ generate() { + const AbstractMethodError = require("./AbstractMethodError"); throw new AbstractMethodError(); } diff --git a/lib/library/AbstractLibraryPlugin.js b/lib/library/AbstractLibraryPlugin.js index 630bec734..b0c088ba6 100644 --- a/lib/library/AbstractLibraryPlugin.js +++ b/lib/library/AbstractLibraryPlugin.js @@ -118,6 +118,7 @@ class AbstractLibraryPlugin { return result; } + /* istanbul ignore next */ /** * @abstract * @param {LibraryOptions} library normalized library option diff --git a/lib/serialization/SerializerMiddleware.js b/lib/serialization/SerializerMiddleware.js index e06e753f1..0f71d9df3 100644 --- a/lib/serialization/SerializerMiddleware.js +++ b/lib/serialization/SerializerMiddleware.js @@ -14,26 +14,28 @@ const LAZY_SERIALIZED_VALUE = Symbol("lazy serialization data"); * @template SerializedType */ class SerializerMiddleware { + /* istanbul ignore next */ /** + * @abstract * @param {DeserializedType} data data * @param {Object} context context object * @returns {SerializedType|Promise} serialized data */ serialize(data, context) { - throw new Error( - "Serializer.serialize is abstract and need to be overwritten" - ); + const AbstractMethodError = require("../AbstractMethodError"); + throw new AbstractMethodError(); } + /* istanbul ignore next */ /** + * @abstract * @param {SerializedType} data data * @param {Object} context context object * @returns {DeserializedType|Promise} deserialized data */ deserialize(data, context) { - throw new Error( - "Serializer.deserialize is abstract and need to be overwritten" - ); + const AbstractMethodError = require("../AbstractMethodError"); + throw new AbstractMethodError(); } /** diff --git a/lib/util/Hash.js b/lib/util/Hash.js index 2c257a637..1ff43a6a9 100644 --- a/lib/util/Hash.js +++ b/lib/util/Hash.js @@ -6,7 +6,9 @@ "use strict"; class Hash { + /* istanbul ignore next */ /** + * @abstract * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding} * @param {string|Buffer} data data * @param {string=} inputEncoding data encoding @@ -17,7 +19,9 @@ class Hash { throw new AbstractMethodError(); } + /* istanbul ignore next */ /** + * @abstract * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding} * @param {string=} encoding encoding of the return value * @returns {string|Buffer} digest diff --git a/test/PersistentCaching.test.js b/test/PersistentCaching.test.js index 182636ba4..04e38453c 100644 --- a/test/PersistentCaching.test.js +++ b/test/PersistentCaching.test.js @@ -38,7 +38,7 @@ describe("Persistent Caching", () => { } }; - beforeAll(done => { + beforeEach(done => { rimraf(tempPath, done); }); @@ -52,9 +52,9 @@ describe("Persistent Caching", () => { } }; - const compile = async () => { + const compile = async (configAdditions = {}) => { return new Promise((resolve, reject) => { - webpack(config, (err, stats) => { + webpack({ ...config, ...configAdditions }, (err, stats) => { if (err) return reject(err); resolve(stats); }); @@ -99,4 +99,28 @@ export default ${files.map((_, i) => `f${i}`).join(" + ")}; expect(cacheFiles.length).toBeLessThan(20); expect(cacheFiles.length).toBeGreaterThan(10); }, 60000); + + it("should optimize unused content", async () => { + const data = { + "a.js": 'import "react-dom";', + "b.js": 'import "acorn";', + "c.js": 'import "core-js";', + "d.js": 'import "date-fns";', + "e.js": 'import "lodash";' + }; + const createEntry = items => { + const entry = {}; + for (const item of items.split("")) entry[item] = `./src/${item}.js`; + return entry; + }; + await updateSrc(data); + await compile({ entry: createEntry("abcde") }); + await compile({ entry: createEntry("abc") }); + await compile({ entry: createEntry("cde") }); + await compile({ entry: createEntry("acd") }); + await compile({ entry: createEntry("bce") }); + await compile({ entry: createEntry("abcde") }); + const cacheFiles = await readdir(cachePath); + expect(cacheFiles.length).toBeGreaterThan(4); + }, 60000); }); diff --git a/test/ProgressPlugin.test.js b/test/ProgressPlugin.test.js index c22d9215f..14e825c7c 100644 --- a/test/ProgressPlugin.test.js +++ b/test/ProgressPlugin.test.js @@ -9,13 +9,16 @@ let webpack; describe("ProgressPlugin", function () { let stderr; + let stdout; beforeEach(() => { stderr = captureStdio(process.stderr, true); + stdout = captureStdio(process.stdout, true); webpack = require(".."); }); afterEach(() => { stderr && stderr.restore(); + stdout && stdout.restore(); }); it("should not contain NaN as a percentage when it is applied to MultiCompiler", () => { @@ -27,6 +30,27 @@ describe("ProgressPlugin", function () { }); }); + it("should print profile information", () => { + const compiler = createSimpleCompiler({ + profile: true + }); + + return RunCompilerAsync(compiler).then(() => { + const logs = getLogs(stderr.toString()); + + expect(logs).toContainEqual( + expect.stringMatching( + /^ {4}\[webpack\.Progress\] \d+ ms module ids DeterministicModuleIdsPlugin\n$/ + ) + ); + expect(logs).toContainEqual( + expect.stringMatching( + /^ {4}\[webpack\.Progress\] \d+ ms(?: \(-\d+ ms\))? module ids\n$/ + ) + ); + }); + }); + it("should not print lines longer than stderr.columns", () => { const compiler = createSimpleCompiler(); process.stderr.columns = 36; @@ -114,7 +138,10 @@ const createMultiCompiler = () => { const createSimpleCompiler = progressOptions => { const compiler = webpack({ context: path.join(__dirname, "fixtures"), - entry: "./a.js" + entry: "./a.js", + infrastructureLogging: { + debug: /Progress/ + } }); compiler.outputFileSystem = createFsFromVolume(new Volume()); diff --git a/test/configCases/wasm/import-wasm-wasm/index.js b/test/configCases/wasm/import-wasm-wasm/index.js new file mode 100644 index 000000000..39971c030 --- /dev/null +++ b/test/configCases/wasm/import-wasm-wasm/index.js @@ -0,0 +1,6 @@ +it("should allow to run a WebAssembly module with imports", function() { + return import("./wasm.wat").then(function(wasm) { + const result = wasm.addNumber(20); + expect(result).toEqual(42); + }); +}); diff --git a/test/configCases/wasm/import-wasm-wasm/test.filter.js b/test/configCases/wasm/import-wasm-wasm/test.filter.js new file mode 100644 index 000000000..231773496 --- /dev/null +++ b/test/configCases/wasm/import-wasm-wasm/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function(config) { + return supportsWebAssembly(); +}; diff --git a/test/configCases/wasm/import-wasm-wasm/wasm.wat b/test/configCases/wasm/import-wasm-wasm/wasm.wat new file mode 100644 index 000000000..3c9f7ca0f --- /dev/null +++ b/test/configCases/wasm/import-wasm-wasm/wasm.wat @@ -0,0 +1,9 @@ +(module + (type $t0 (func (result i32))) + (type $t1 (func (param i32) (result i32))) + (import "./wasm2.wat" "getNumber" (func $./wasm2.wasm.getNumber (type $t0))) + (func $addNumber (export "addNumber") (type $t1) (param $p0 i32) (result i32) + (i32.add + (get_local $p0) + (call $./wasm2.wasm.getNumber)))) + diff --git a/test/configCases/wasm/import-wasm-wasm/wasm2.wat b/test/configCases/wasm/import-wasm-wasm/wasm2.wat new file mode 100644 index 000000000..0331fb4fc --- /dev/null +++ b/test/configCases/wasm/import-wasm-wasm/wasm2.wat @@ -0,0 +1,5 @@ +(module + (type $t0 (func (result i32))) + (func $getNumber (export "getNumber") (type $t0) (result i32) + (i32.const 22))) + diff --git a/test/configCases/wasm/import-wasm-wasm/webpack.config.js b/test/configCases/wasm/import-wasm-wasm/webpack.config.js new file mode 100644 index 000000000..7ac4a3ab7 --- /dev/null +++ b/test/configCases/wasm/import-wasm-wasm/webpack.config.js @@ -0,0 +1,15 @@ +module.exports = { + entry: "./index", + module: { + rules: [ + { + test: /\.wat$/, + loader: "wast-loader", + type: "webassembly/sync" + } + ] + }, + experiments: { + syncWebAssembly: true + } +}; From 61e2c22c687c7fbd9adcd408c5c3390c838108fe Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 09:41:40 +0200 Subject: [PATCH 04/30] tests for array to set deprecation --- .../deprecations/chunk-files/deprecations.js | 6 ++++++ .../deprecations/chunk-files/index.js | 1 + .../deprecations/chunk-files/webpack.config.js | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 test/configCases/deprecations/chunk-files/deprecations.js create mode 100644 test/configCases/deprecations/chunk-files/index.js create mode 100644 test/configCases/deprecations/chunk-files/webpack.config.js diff --git a/test/configCases/deprecations/chunk-files/deprecations.js b/test/configCases/deprecations/chunk-files/deprecations.js new file mode 100644 index 000000000..99016892f --- /dev/null +++ b/test/configCases/deprecations/chunk-files/deprecations.js @@ -0,0 +1,6 @@ +module.exports = [ + { code: /DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET/ }, + { code: /DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_INDEXER/ }, + { code: /DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_LENGTH/ }, + { code: /DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_PUSH/ } +]; diff --git a/test/configCases/deprecations/chunk-files/index.js b/test/configCases/deprecations/chunk-files/index.js new file mode 100644 index 000000000..a2db56a05 --- /dev/null +++ b/test/configCases/deprecations/chunk-files/index.js @@ -0,0 +1 @@ +it("should compile with deprecations", () => {}); diff --git a/test/configCases/deprecations/chunk-files/webpack.config.js b/test/configCases/deprecations/chunk-files/webpack.config.js new file mode 100644 index 000000000..bca499c60 --- /dev/null +++ b/test/configCases/deprecations/chunk-files/webpack.config.js @@ -0,0 +1,18 @@ +module.exports = { + plugins: [ + compiler => { + compiler.hooks.done.tap("Test", ({ compilation }) => { + for (const chunk of compilation.chunks) { + expect(chunk.files.length).toBe(chunk.files.size); + expect(chunk.files[0]).toBe(Array.from(chunk.files)[0]); + expect(chunk.files.join(",")).toBe(Array.from(chunk.files).join(",")); + expect(() => (chunk.files.length = 0)).toThrow(); + expect(() => chunk.files.pop()).toThrow(); + chunk.files.push("test.js"); + expect(chunk.files).toContain("test.js"); + chunk.files.delete("test.js"); + } + }); + } + ] +}; From e80bcac1b5cac99cf003c3236490bf35bc350bed Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 09:42:09 +0200 Subject: [PATCH 05/30] ignore coverage for toStringTag --- lib/util/LazySet.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/util/LazySet.js b/lib/util/LazySet.js index 1f317efa0..e87cbd0e0 100644 --- a/lib/util/LazySet.js +++ b/lib/util/LazySet.js @@ -173,6 +173,7 @@ class LazySet { return this._set[Symbol.iterator](); } + /* istanbul ignore next */ get [Symbol.toStringTag]() { return "LazySet"; } From 373d5133bf15c7d69eb5ec18423bf25ce5db8cd5 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 09:42:46 +0200 Subject: [PATCH 06/30] test deep path for ProfilingPlugin --- .../plugins/profiling-plugin/index.js | 17 ++++++++--------- .../plugins/profiling-plugin/webpack.config.js | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/test/configCases/plugins/profiling-plugin/index.js b/test/configCases/plugins/profiling-plugin/index.js index 0e6426628..1ffa3aa96 100644 --- a/test/configCases/plugins/profiling-plugin/index.js +++ b/test/configCases/plugins/profiling-plugin/index.js @@ -1,21 +1,20 @@ import "./test.json"; it("should generate a events.json file", () => { - var fs = require("fs"), - path = require("path"), - os = require("os"); + var fs = require("fs"); + var path = require("path"); - expect(fs.existsSync(path.join(__dirname, "events.json"))).toBe(true); + expect(fs.existsSync(path.join(__dirname, "in/directory/events.json"))).toBe( + true + ); }); it("should have proper setup record inside of the json stream", () => { - var fs = require("fs"), - path = require("path"), - os = require("os"); + var fs = require("fs"); + var path = require("path"); - // convert json stream to valid var source = JSON.parse( - fs.readFileSync(path.join(__dirname, "events.json"), "utf-8") + fs.readFileSync(path.join(__dirname, "in/directory/events.json"), "utf-8") ); expect(source[0].id).toEqual(1); }); diff --git a/test/configCases/plugins/profiling-plugin/webpack.config.js b/test/configCases/plugins/profiling-plugin/webpack.config.js index 1d0eb54fb..ded70bfb0 100644 --- a/test/configCases/plugins/profiling-plugin/webpack.config.js +++ b/test/configCases/plugins/profiling-plugin/webpack.config.js @@ -5,7 +5,7 @@ var path = require("path"); module.exports = (env, { testPath }) => ({ plugins: [ new webpack.debug.ProfilingPlugin({ - outputPath: path.join(testPath, "events.json") + outputPath: path.join(testPath, "in/directory/events.json") }) ], node: { From 0f47a1d27db31026c842cc728bad741697ce502d Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 10:47:15 +0200 Subject: [PATCH 07/30] test lazy set behavior --- test/configCases/utils/lazy-set/index.js | 1 + .../utils/lazy-set/webpack.config.js | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/configCases/utils/lazy-set/index.js create mode 100644 test/configCases/utils/lazy-set/webpack.config.js diff --git a/test/configCases/utils/lazy-set/index.js b/test/configCases/utils/lazy-set/index.js new file mode 100644 index 000000000..8797cd2b6 --- /dev/null +++ b/test/configCases/utils/lazy-set/index.js @@ -0,0 +1 @@ +it("should behave like a Set", () => {}); diff --git a/test/configCases/utils/lazy-set/webpack.config.js b/test/configCases/utils/lazy-set/webpack.config.js new file mode 100644 index 000000000..39ff2ee83 --- /dev/null +++ b/test/configCases/utils/lazy-set/webpack.config.js @@ -0,0 +1,23 @@ +module.exports = { + plugins: [ + compiler => { + compiler.hooks.done.tap("Test", ({ compilation }) => { + const items1 = Array.from(compilation.fileDependencies); + const items2 = new Set(compilation.fileDependencies.keys()); + const items3 = new Set(compilation.fileDependencies.values()); + const items4 = new Set(compilation.fileDependencies.entries()); + expect(compilation.fileDependencies.has(items1[0])).toBe(true); + compilation.fileDependencies.delete(items1[0]); + expect(compilation.fileDependencies.has(items1[0])).toBe(false); + compilation.fileDependencies.add(items1[0]); + expect(compilation.fileDependencies.has(items1[0])).toBe(true); + compilation.fileDependencies.add(items1[0]); + expect(compilation.fileDependencies.size).toBe(items1.length); + const items1Set = new Set(items1); + expect(items2).toEqual(items1Set); + expect(items3).toEqual(items1Set); + expect(items4).toEqual(new Set(items1.map(x => [x, x]))); + }); + } + ] +}; From 618960469d91cf8fa7787e5ec1f5a7fbfabd5ccb Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 10:53:30 +0200 Subject: [PATCH 08/30] ignore DebugHash class --- lib/util/createHash.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/util/createHash.js b/lib/util/createHash.js index 60f26ef08..9d37229b9 100644 --- a/lib/util/createHash.js +++ b/lib/util/createHash.js @@ -85,9 +85,7 @@ class BulkUpdateDecorator extends Hash { } } -/** - * istanbul ignore next - */ +/* istanbul ignore next */ class DebugHash extends Hash { constructor() { super(); From 8509a225e9ab7dcfbabe44f45a79897d3541d48f Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 10:54:27 +0200 Subject: [PATCH 09/30] use bindContextCache more often --- lib/RecordIdsPlugin.js | 48 +++++++++-------------- lib/SourceMapDevToolPlugin.js | 3 +- lib/optimize/AggressiveSplittingPlugin.js | 10 ++--- lib/stats/DefaultStatsFactoryPlugin.js | 8 ++-- 4 files changed, 31 insertions(+), 38 deletions(-) diff --git a/lib/RecordIdsPlugin.js b/lib/RecordIdsPlugin.js index ed9f94d4a..b8bf66b9c 100644 --- a/lib/RecordIdsPlugin.js +++ b/lib/RecordIdsPlugin.js @@ -47,6 +47,23 @@ class RecordIdsPlugin { */ apply(compiler) { const portableIds = this.options.portableIds; + + const makePathsRelative = identifierUtils.makePathsRelative.bindContextCache( + compiler.context, + compiler.root + ); + + /** + * @param {Module} module the module + * @returns {string} the (portable) identifier + */ + const getModuleIdentifier = module => { + if (portableIds) { + return makePathsRelative(module.identifier()); + } + return module.identifier(); + }; + compiler.hooks.compilation.tap("RecordIdsPlugin", compilation => { compilation.hooks.recordModules.tap( "RecordIdsPlugin", @@ -64,13 +81,7 @@ class RecordIdsPlugin { for (const module of modules) { const moduleId = chunkGraph.getModuleId(module); if (typeof moduleId !== "number") continue; - const identifier = portableIds - ? identifierUtils.makePathsRelative( - compiler.context, - module.identifier(), - compiler.root - ) - : module.identifier(); + const identifier = getModuleIdentifier(module); records.modules.byIdentifier[identifier] = moduleId; usedIds.add(moduleId); } @@ -93,13 +104,7 @@ class RecordIdsPlugin { for (const module of modules) { const moduleId = chunkGraph.getModuleId(module); if (moduleId !== null) continue; - const identifier = portableIds - ? identifierUtils.makePathsRelative( - compiler.context, - module.identifier(), - compiler.root - ) - : module.identifier(); + const identifier = getModuleIdentifier(module); const id = records.modules.byIdentifier[identifier]; if (id === undefined) continue; if (usedIds.has(id)) continue; @@ -113,21 +118,6 @@ class RecordIdsPlugin { } ); - /** - * @param {Module} module the module - * @returns {string} the (portable) identifier - */ - const getModuleIdentifier = module => { - if (portableIds) { - return identifierUtils.makePathsRelative( - compiler.context, - module.identifier(), - compiler.root - ); - } - return module.identifier(); - }; - /** * @param {Chunk} chunk the chunk * @returns {string[]} sources of the chunk diff --git a/lib/SourceMapDevToolPlugin.js b/lib/SourceMapDevToolPlugin.js index 7a7038eb3..db2668578 100644 --- a/lib/SourceMapDevToolPlugin.js +++ b/lib/SourceMapDevToolPlugin.js @@ -74,9 +74,10 @@ const getTaskForFile = ( if (!sourceMap || typeof source !== "string") return; const context = compilation.options.context; const root = compilation.compiler.root; + const cachedAbsolutify = absolutify.bindContextCache(context, root); const modules = sourceMap.sources.map(source => { if (!source.startsWith("webpack://")) return source; - source = absolutify(context, source.slice(10), root); + source = cachedAbsolutify(source.slice(10)); const module = compilation.findModule(source); return module || source; }); diff --git a/lib/optimize/AggressiveSplittingPlugin.js b/lib/optimize/AggressiveSplittingPlugin.js index 817fca8f2..b839150c7 100644 --- a/lib/optimize/AggressiveSplittingPlugin.js +++ b/lib/optimize/AggressiveSplittingPlugin.js @@ -102,12 +102,12 @@ class AggressiveSplittingPlugin { // Precompute stuff const nameToModuleMap = new Map(); const moduleToNameMap = new Map(); + const makePathsRelative = identifierUtils.makePathsRelative.bindContextCache( + compiler.context, + compiler.root + ); for (const m of compilation.modules) { - const name = identifierUtils.makePathsRelative( - compiler.context, - m.identifier(), - compiler.root - ); + const name = makePathsRelative(m.identifier()); nameToModuleMap.set(name, m); moduleToNameMap.set(m, name); } diff --git a/lib/stats/DefaultStatsFactoryPlugin.js b/lib/stats/DefaultStatsFactoryPlugin.js index 82db5daad..7940444f7 100644 --- a/lib/stats/DefaultStatsFactoryPlugin.js +++ b/lib/stats/DefaultStatsFactoryPlugin.js @@ -404,6 +404,10 @@ const SIMPLE_EXTRACTORS = { collapsedGroups = true; break; } + const makePathsRelative = identifierUtils.makePathsRelative.bindContextCache( + context, + compilation.compiler.root + ); let depthInCollapsedGroup = 0; for (const [origin, logEntries] of compilation.logging) { const debugMode = loggingDebug.some(fn => fn(origin)); @@ -462,9 +466,7 @@ const SIMPLE_EXTRACTORS = { } } } - let name = identifierUtils - .makePathsRelative(context, origin, compilation.cache) - .replace(/\|/g, " "); + let name = makePathsRelative(origin).replace(/\|/g, " "); if (name in object.logging) { let i = 1; while (`${name}#${i}` in object.logging) { From d14948ee95b4fb64cbf0f4754c59cf0f506da58f Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 11:25:01 +0200 Subject: [PATCH 10/30] add tests for deprecated methods in Chunk and Module --- .../chunk-and-module/deprecations.js | 31 ++++++++++ .../deprecations/chunk-and-module/index.js | 7 +++ .../chunk-and-module/webpack.config.js | 61 +++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 test/configCases/deprecations/chunk-and-module/deprecations.js create mode 100644 test/configCases/deprecations/chunk-and-module/index.js create mode 100644 test/configCases/deprecations/chunk-and-module/webpack.config.js diff --git a/test/configCases/deprecations/chunk-and-module/deprecations.js b/test/configCases/deprecations/chunk-and-module/deprecations.js new file mode 100644 index 000000000..c2f19a93a --- /dev/null +++ b/test/configCases/deprecations/chunk-and-module/deprecations.js @@ -0,0 +1,31 @@ +module.exports = [ + { code: /DEP_WEBPACK_CHUNK_ADD_MODULE/ }, + { code: /DEP_WEBPACK_CHUNK_CONTAINS_MODULE/ }, + { code: /DEP_WEBPACK_CHUNK_ENTRY_MODULE/ }, + { code: /DEP_WEBPACK_CHUNK_GET_MODULES/ }, + { code: /DEP_WEBPACK_CHUNK_GET_NUMBER_OF_MODULES/ }, + { code: /DEP_WEBPACK_CHUNK_HAS_ENTRY_MODULE/ }, + { code: /DEP_WEBPACK_CHUNK_HAS_MODULE_IN_GRAPH/ }, + { code: /DEP_WEBPACK_CHUNK_IS_EMPTY/ }, + { code: /DEP_WEBPACK_CHUNK_MODULES_ITERABLE/ }, + { code: /DEP_WEBPACK_CHUNK_MODULES_SIZE/ }, + { code: /DEP_WEBPACK_CHUNK_REMOVE_MODULE/ }, + { code: /DEP_WEBPACK_CHUNK_SIZE/ }, + { code: /DEP_WEBPACK_MODULE_ADD_CHUNK/ }, + { code: /DEP_WEBPACK_MODULE_CHUNKS_ITERABLE/ }, + { code: /DEP_WEBPACK_MODULE_DEPTH/ }, + { code: /DEP_WEBPACK_MODULE_GET_CHUNKS/ }, + { code: /DEP_WEBPACK_MODULE_GET_NUMBER_OF_CHUNKS/ }, + { code: /DEP_WEBPACK_MODULE_HASH/ }, + { code: /DEP_WEBPACK_MODULE_INDEX2/ }, + { code: /DEP_WEBPACK_MODULE_INDEX/ }, + { code: /DEP_WEBPACK_MODULE_ISSUER/ }, + { code: /DEP_WEBPACK_MODULE_IS_ENTRY_MODULE/ }, + { code: /DEP_WEBPACK_MODULE_IS_IN_CHUNK/ }, + { code: /DEP_WEBPACK_MODULE_OPTIMIZATION_BAILOUT/ }, + { code: /DEP_WEBPACK_MODULE_OPTIONAL/ }, + { code: /DEP_WEBPACK_MODULE_PROFILE/ }, + { code: /DEP_WEBPACK_MODULE_REMOVE_CHUNK/ }, + { code: /DEP_WEBPACK_MODULE_RENDERED_HASHED/ }, + { code: /DEP_WEBPACK_MODULE_USED_EXPORTS/ } +]; diff --git a/test/configCases/deprecations/chunk-and-module/index.js b/test/configCases/deprecations/chunk-and-module/index.js new file mode 100644 index 000000000..493d4ee53 --- /dev/null +++ b/test/configCases/deprecations/chunk-and-module/index.js @@ -0,0 +1,7 @@ +import { testExport as importedTestExport } from "./index"; + +export const testExport = 42; + +it("should compile with deprecations", () => { + expect(importedTestExport).toBe(42); +}); diff --git a/test/configCases/deprecations/chunk-and-module/webpack.config.js b/test/configCases/deprecations/chunk-and-module/webpack.config.js new file mode 100644 index 000000000..45e183027 --- /dev/null +++ b/test/configCases/deprecations/chunk-and-module/webpack.config.js @@ -0,0 +1,61 @@ +const ExternalModule = require("../../../../lib/ExternalModule"); +const ChunkGraph = require("../../../../lib/ChunkGraph"); +module.exports = { + plugins: [ + compiler => { + compiler.hooks.done.tap("Test", ({ compilation }) => { + const { chunkGraph } = compilation; + for (const chunk of compilation.chunks) { + expect(chunk.entryModule).toBe( + [...chunkGraph.getChunkEntryModulesIterable(chunk)][0] + ); + expect(chunk.hasEntryModule()).toBe(true); + expect(chunk.getNumberOfModules()).toBe(3); + const module = new ExternalModule("external", "var", "external"); + ChunkGraph.setChunkGraphForModule(module, chunkGraph); + chunk.addModule(module); + module.addChunk(chunk); + expect(chunk.getNumberOfModules()).toBe(4); + expect(new Set(chunk.modulesIterable)).toContain(module); + expect(new Set(chunk.getModules())).toContain(chunk.entryModule); + expect(chunk.hasModuleInGraph(m => m === module)).toBe(true); + expect(chunk.containsModule(module)).toBe(true); + chunk.removeModule(module); + module.removeChunk(chunk); + expect(chunk.getNumberOfModules()).toBe(3); + expect(chunk.containsModule(module)).toBe(false); + expect(chunk.isEmpty()).toBe(false); + expect(chunk.modulesSize()).toBeTypeOf("number"); + expect(chunk.size()).toBe(chunk.modulesSize() * 10 + 10000); + + const m = chunk.entryModule; + expect(m.hash).toMatch(/^[0-9a-f]{32}$/); + expect(m.renderedHash).toMatch(/^[0-9a-f]{20}$/); + expect(m.profile).toBe(undefined); + expect(m.index).toBe(0); + m.index = 1000; + expect(m.index).toBe(1000); + expect(m.index2).toBe(0); + m.index2 = 1000; + expect(m.index2).toBe(1000); + expect(m.depth).toBe(0); + m.depth = 1000; + expect(m.depth).toBe(1000); + expect(m.issuer).toBe(null); + m.issuer = module; + expect(m.issuer).toBe(module); + expect([...m.usedExports]).toEqual(["testExport"]); + expect(m.optimizationBailout).toEqual([]); + expect(m.optional).toBe(false); + expect(m.isInChunk(chunk)).toBe(true); + expect(m.isEntryModule()).toBe(true); + expect(m.getChunks()).toEqual([chunk]); + expect(m.getNumberOfChunks()).toBe(1); + expect(Array.from(m.chunksIterable)).toEqual([chunk]); + expect(m.isProvided("testExport")).toBe(true); + expect(m.isProvided("otherExport")).toBe(false); + } + }); + } + ] +}; From dc743d2197f35f1d50bc453a24d69d5f4af5ffcc Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 11:52:08 +0200 Subject: [PATCH 11/30] ignore debug code --- lib/ChunkGroup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ChunkGroup.js b/lib/ChunkGroup.js index fd1bc3c1a..df71873d3 100644 --- a/lib/ChunkGroup.js +++ b/lib/ChunkGroup.js @@ -135,6 +135,7 @@ class ChunkGroup { this.options.name = value; } + /* istanbul ignore next */ /** * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's * @returns {string} a unique concatenation of chunk debugId's @@ -529,6 +530,7 @@ class ChunkGroup { return this._modulePostOrderIndices.get(module); } + /* istanbul ignore next */ checkConstraints() { const chunk = this; for (const child of chunk._children) { From 5eed9a60945443af2b0b6799fe61729145839757 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Fri, 17 Apr 2020 11:52:33 +0200 Subject: [PATCH 12/30] add coverage for async wasm code --- .../wasm/export-imported-global/env.js | 2 ++ .../wasm/export-imported-global/index.js | 18 ++++++++++++++++++ .../wasm/export-imported-global/module.js | 1 + .../wasm/export-imported-global/module.wat | 17 +++++++++++++++++ .../wasm/export-imported-global/test.filter.js | 5 +++++ .../export-imported-global/webpack.config.js | 15 +++++++++++++++ 6 files changed, 58 insertions(+) create mode 100644 test/configCases/wasm/export-imported-global/env.js create mode 100644 test/configCases/wasm/export-imported-global/index.js create mode 100644 test/configCases/wasm/export-imported-global/module.js create mode 100644 test/configCases/wasm/export-imported-global/module.wat create mode 100644 test/configCases/wasm/export-imported-global/test.filter.js create mode 100644 test/configCases/wasm/export-imported-global/webpack.config.js diff --git a/test/configCases/wasm/export-imported-global/env.js b/test/configCases/wasm/export-imported-global/env.js new file mode 100644 index 000000000..baa331714 --- /dev/null +++ b/test/configCases/wasm/export-imported-global/env.js @@ -0,0 +1,2 @@ +export const n = 1; +export const m = 1.25 diff --git a/test/configCases/wasm/export-imported-global/index.js b/test/configCases/wasm/export-imported-global/index.js new file mode 100644 index 000000000..48b56ba42 --- /dev/null +++ b/test/configCases/wasm/export-imported-global/index.js @@ -0,0 +1,18 @@ +it("should export imported global", function() { + return import("./module").then(function({ v, w, x, test }) { + if (WebAssembly.Global) { + expect(v.constructor).toBe(WebAssembly.Global); + expect(w.constructor).toBe(WebAssembly.Global); + expect(x.constructor).toBe(WebAssembly.Global); + + expect(+v).toBe(1); + expect(+w).toBe(1); + expect(+x).toBe(1.25); + } else { + expect(v).toBe(1); + expect(w).toBe(1); + expect(x).toBe(1.25); + } + expect(test()).toBe(2); + }); +}); diff --git a/test/configCases/wasm/export-imported-global/module.js b/test/configCases/wasm/export-imported-global/module.js new file mode 100644 index 000000000..bd82c8f8b --- /dev/null +++ b/test/configCases/wasm/export-imported-global/module.js @@ -0,0 +1 @@ +export * from "./module.wat"; diff --git a/test/configCases/wasm/export-imported-global/module.wat b/test/configCases/wasm/export-imported-global/module.wat new file mode 100644 index 000000000..c20daa398 --- /dev/null +++ b/test/configCases/wasm/export-imported-global/module.wat @@ -0,0 +1,17 @@ +(module + (import "./env.js" "n" (global i32)) + (import "./env.js" "m" (global $g2 f64)) + (export "v" (global 0)) + (global $g i32 (get_global 0)) + (export "w" (global $g)) + (export "x" (global $g2)) + (func (export "test") (result i32) + get_global $g2 + get_global $g2 + f64.add + drop + get_global 0 + get_global $g + i32.add + ) +) diff --git a/test/configCases/wasm/export-imported-global/test.filter.js b/test/configCases/wasm/export-imported-global/test.filter.js new file mode 100644 index 000000000..231773496 --- /dev/null +++ b/test/configCases/wasm/export-imported-global/test.filter.js @@ -0,0 +1,5 @@ +var supportsWebAssembly = require("../../../helpers/supportsWebAssembly"); + +module.exports = function(config) { + return supportsWebAssembly(); +}; diff --git a/test/configCases/wasm/export-imported-global/webpack.config.js b/test/configCases/wasm/export-imported-global/webpack.config.js new file mode 100644 index 000000000..7ac4a3ab7 --- /dev/null +++ b/test/configCases/wasm/export-imported-global/webpack.config.js @@ -0,0 +1,15 @@ +module.exports = { + entry: "./index", + module: { + rules: [ + { + test: /\.wat$/, + loader: "wast-loader", + type: "webassembly/sync" + } + ] + }, + experiments: { + syncWebAssembly: true + } +}; From cda553a099b8a5f01fdfa7294721f5fc825efd9d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2020 14:39:25 +0000 Subject: [PATCH 13/30] chore(deps-dev): bump lint-staged from 10.1.3 to 10.1.4 Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.1.3 to 10.1.4. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Commits](https://github.com/okonet/lint-staged/compare/v10.1.3...v10.1.4) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ab68f0e50..53302c847 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4296,9 +4296,9 @@ lines-and-columns@^1.1.6: integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= lint-staged@^10.0.8: - version "10.1.3" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.1.3.tgz#da27713d3ac519da305381b4de87d5f866b1d2f1" - integrity sha512-o2OkLxgVns5RwSC5QF7waeAjJA5nz5gnUfqL311LkZcFipKV7TztrSlhNUK5nQX9H0E5NELAdduMQ+M/JPT7RQ== + version "10.1.4" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.1.4.tgz#c0e0930ed5568ada2a7fbd9d300318c87803a4b0" + integrity sha512-bFfQE6U8LASGKANl+JSN8nfL9Id6vq2YmWMgkynvmicMVQFR11OFU8lqcnI1y0fsPr3PwHa6xeMCh+SWB8TPkg== dependencies: chalk "^3.0.0" commander "^4.0.1" From 6917b4be7dfdbdad46f33c6f7be03a2b2caa3b76 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2020 15:46:45 +0000 Subject: [PATCH 14/30] chore(deps): bump schema-utils from 2.6.5 to 2.6.6 Bumps [schema-utils](https://github.com/webpack/schema-utils) from 2.6.5 to 2.6.6. - [Release notes](https://github.com/webpack/schema-utils/releases) - [Changelog](https://github.com/webpack/schema-utils/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/schema-utils/compare/v2.6.5...v2.6.6) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ab68f0e50..8281fcd16 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6017,9 +6017,9 @@ schema-utils@^1.0.0: ajv-keywords "^3.1.0" schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6.4, schema-utils@^2.6.5: - version "2.6.5" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.5.tgz#c758f0a7e624263073d396e29cd40aa101152d8a" - integrity sha512-5KXuwKziQrTVHh8j/Uxz+QUbxkaLW9X/86NBlx/gnKgtsZA2GIVMUn17qWhRFwF8jdYb3Dig5hRO/W5mZqy6SQ== + version "2.6.6" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.6.6.tgz#299fe6bd4a3365dc23d99fd446caff8f1d6c330c" + integrity sha512-wHutF/WPSbIi9x6ctjGGk2Hvl0VOz5l3EKEuKbjPlB30mKZUzb9A5k9yEXRX3pwyqVLPvpfZZEllaFq/M718hA== dependencies: ajv "^6.12.0" ajv-keywords "^3.4.1" From eaf21bbd28e1b01599e868c32dd55b902d336ed7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2020 21:45:28 +0000 Subject: [PATCH 15/30] chore(deps-dev): bump @types/node from 12.12.35 to 12.12.36 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.12.35 to 12.12.36. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 53302c847..60516dc6c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -569,9 +569,9 @@ integrity sha512-E6M6N0blf/jiZx8Q3nb0vNaswQeEyn0XlupO+xN6DtJ6r6IT4nXrTry7zhIfYvFCl3/8Cu6WIysmUBKiqV0bqQ== "@types/node@^12.6.9": - version "12.12.35" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.35.tgz#1e61b226c14380f4384f70cfe49a65c2c553ad2b" - integrity sha512-ASYsaKecA7TUsDrqIGPNk3JeEox0z/0XR/WsJJ8BIX/9+SkMSImQXKWfU/yBrSyc7ZSE/NPqLu36Nur0miCFfQ== + version "12.12.36" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.36.tgz#162c8c2a2e659da480049df0e19ae128ad3a1527" + integrity sha512-hmmypvyO/uTLFYCYu6Hlb3ydeJ11vXRxg8/WJ0E3wvwmPO0y47VqnfmXFVuWlysO0Zyj+je1Y33rQeuYkZ51GQ== "@types/parse-json@^4.0.0": version "4.0.0" From 2f6912011f1a4463d93b0fbb3c658b6f6a9bf04c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2020 09:50:28 +0000 Subject: [PATCH 16/30] chore(deps-dev): bump lint-staged from 10.1.4 to 10.1.6 Bumps [lint-staged](https://github.com/okonet/lint-staged) from 10.1.4 to 10.1.6. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Commits](https://github.com/okonet/lint-staged/compare/v10.1.4...v10.1.6) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/yarn.lock b/yarn.lock index 53302c847..11a9d77e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1621,10 +1621,10 @@ commander@^2.20.0, commander@^2.20.3, commander@~2.20.3: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" - integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-5.0.0.tgz#dbf1909b49e5044f8fdaf0adc809f0c0722bdfd0" + integrity sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ== comment-json@^1.1.3: version "1.1.3" @@ -2568,7 +2568,7 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^3.2.0, execa@^3.4.0: +execa@^3.2.0: version "3.4.0" resolved "https://registry.yarnpkg.com/execa/-/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89" integrity sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g== @@ -2584,6 +2584,21 @@ execa@^3.2.0, execa@^3.4.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" +execa@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.0.tgz#7f37d6ec17f09e6b8fc53288611695b6d12b9daf" + integrity sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -4296,16 +4311,16 @@ lines-and-columns@^1.1.6: integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= lint-staged@^10.0.8: - version "10.1.4" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.1.4.tgz#c0e0930ed5568ada2a7fbd9d300318c87803a4b0" - integrity sha512-bFfQE6U8LASGKANl+JSN8nfL9Id6vq2YmWMgkynvmicMVQFR11OFU8lqcnI1y0fsPr3PwHa6xeMCh+SWB8TPkg== + version "10.1.6" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.1.6.tgz#086db5e4f5906642ccf648e9b54375d794a9be81" + integrity sha512-45zaGxf4XZuwdUk87yRFE/1b4vTZmH2UnYmUPmindsgdAljOFpWWb0yEjxngmqERUS/MGauJexFF6BjLVg9VMA== dependencies: - chalk "^3.0.0" - commander "^4.0.1" + chalk "^4.0.0" + commander "^5.0.0" cosmiconfig "^6.0.0" debug "^4.1.1" dedent "^0.7.0" - execa "^3.4.0" + execa "^4.0.0" listr "^0.14.3" log-symbols "^3.0.0" micromatch "^4.0.2" From 462ecf1af06bfeba56a67c91b8d23b7141febf2f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2020 09:56:37 +0000 Subject: [PATCH 17/30] chore(deps-dev): bump cspell from 4.0.56 to 4.0.57 Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 4.0.56 to 4.0.57. - [Release notes](https://github.com/streetsidesoftware/cspell/releases) - [Commits](https://github.com/streetsidesoftware/cspell/compare/cspell@4.0.56...cspell@4.0.57) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 101 +++++++++++++++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/yarn.lock b/yarn.lock index 53302c847..847be71e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1773,10 +1773,10 @@ cspell-dict-bash@^1.0.3: dependencies: configstore "^5.0.0" -cspell-dict-companies@^1.0.20: - version "1.0.20" - resolved "https://registry.yarnpkg.com/cspell-dict-companies/-/cspell-dict-companies-1.0.20.tgz#75c76f6128cebdcfd8c89a0d62e37635f4a1cefe" - integrity sha512-LpDV5YMNV0vG8/LA4S8bbHNwaxI3gHTsCe0XZSGMRFlxO3bWWhi3Il3KB3pdDArDaopTGZKCMXDQsYFy5WHhQA== +cspell-dict-companies@^1.0.21: + version "1.0.22" + resolved "https://registry.yarnpkg.com/cspell-dict-companies/-/cspell-dict-companies-1.0.22.tgz#a30983605888ce530e5c7c2ad1b2b9e33c20fcae" + integrity sha512-P7ziSCteONYjlPHFFqZTnisSEJr9h9FXTJh0t9QQIoKcaNR4wij5GiZDv4p4YubCf0z3GeJ7Uao+99RGeHakRQ== dependencies: configstore "^5.0.0" @@ -1920,44 +1920,44 @@ cspell-dict-scala@^1.0.11: dependencies: configstore "^5.0.0" -cspell-dict-software-terms@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cspell-dict-software-terms/-/cspell-dict-software-terms-1.0.6.tgz#ecbf6d1f0c8b3f987e69a60a77fca07ad5d7225c" - integrity sha512-W9ugGS5dNMWDV27gY5qC+RlckP340q5vzrf6xTzlJ9ikh4c3PymAHne23FH7WwjMbFW7eSbQFddIcRgjXcxbdA== +cspell-dict-software-terms@^1.0.7: + version "1.0.8" + resolved "https://registry.yarnpkg.com/cspell-dict-software-terms/-/cspell-dict-software-terms-1.0.8.tgz#14ac832dc3ca1c5ac15ff51ba0f85e5c5111019d" + integrity sha512-a8JkYf1pG5xUTKRPFp+7t4Gn7fhH9M5E94LXVuPPSQrns18pE0DGV0OEK/VbZUagsyRaDaHiZFqedIQ83M2Mpw== dependencies: configstore "^5.0.0" -cspell-dict-typescript@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/cspell-dict-typescript/-/cspell-dict-typescript-1.0.3.tgz#89d540fdca9c5e22416b42084f737ffe169eaf42" - integrity sha512-j6sVvLUuPCTw5Iqc1D1zB3mWJQTMNshEOmChJfz8vFeBMbu7oj61rLbnhnn2x8kXguKmWN5jhhKnsBIp++jRZA== +cspell-dict-typescript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cspell-dict-typescript/-/cspell-dict-typescript-1.0.4.tgz#95ca26adf15c5e31cda2506e03ce7b7c18e9fbb0" + integrity sha512-cniGSmTohYriEgGJ0PgcQP2GCGP+PH/0WZ2N7BTTemQr/mHTU6bKWy8DVK63YEtYPEmhZv+G2xPBgBD41QQypQ== dependencies: configstore "^5.0.0" -cspell-glob@^0.1.17: - version "0.1.17" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-0.1.17.tgz#e8dad6eedc23bc3e98175f2077df25e7e3212a8a" - integrity sha512-gAiKakWJbHay6cobcJnX1+XhNCFYqR7CJM5GPiEpRZ5RFXYR46fYbkVwTdg3sqbFLErJtghQj/0s5Xa0q9NJpQ== +cspell-glob@^0.1.18: + version "0.1.18" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-0.1.18.tgz#6762774f58d2fe176b6d9ed347a9e5862dc551a8" + integrity sha512-j7XDtSRUgHZNLcnFNI2ngTvkAlC7AI43LAuOYTCgU3+zKMdwzq6C7m/a1c9tWjnPYJiIPf+OEkE9bAhIufzk3Q== dependencies: micromatch "^4.0.2" -cspell-io@^4.0.20: - version "4.0.20" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-4.0.20.tgz#4aecc054852c712e96e075eb270dbbbc4482fca1" - integrity sha512-fomz1P308XgyyxaOEKdNbh82Ac4AKaz26p4JszV7YkJrGDsXMoByTQjVqdDloNN8FchogSEpLPeQoIg648exBA== +cspell-io@^4.0.21: + version "4.0.21" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-4.0.21.tgz#f3c051294b5229f67caa17e3b4946985ec8f39c4" + integrity sha512-dht81s3CMPQTqtYqcJ/imEbE7WoYgGR4F52Fotgvd7Kky+H8GgSBnJYLJNk/PuT2xJ/8ebhx7v464v9cD73Okw== dependencies: iconv-lite "^0.4.24" iterable-to-stream "^1.0.1" -cspell-lib@^4.1.22: - version "4.1.22" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-4.1.22.tgz#86437fa61687fbd18932348a92c05e2c2bd7f214" - integrity sha512-O+BcCLYce9mKKgzp49cE4hHvIDb3w9GJ0FcoFrERNfxKt0ciPLmNdflnxjEo/lXr9s+aXmjRVFm+BI6sDpDZvw== +cspell-lib@^4.1.23: + version "4.1.23" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-4.1.23.tgz#8d74bcb14f604c9d8eb44ddc3d713d59c331ab42" + integrity sha512-UNLsOEq12xbL8o4SWGsDl1xAwyR8BUlGkwI3uv5Acc7noolObMXOJLp/TLE36PrMKWVmbg8s/9pnUKwrcwTC3w== dependencies: comment-json "^1.1.3" configstore "^5.0.1" cspell-dict-bash "^1.0.3" - cspell-dict-companies "^1.0.20" + cspell-dict-companies "^1.0.21" cspell-dict-cpp "^1.1.26" cspell-dict-django "^1.0.15" cspell-dict-dotnet "^1.0.14" @@ -1978,39 +1978,40 @@ cspell-lib@^4.1.22: cspell-dict-ruby "^1.0.3" cspell-dict-rust "^1.0.12" cspell-dict-scala "^1.0.11" - cspell-dict-software-terms "^1.0.6" - cspell-dict-typescript "^1.0.3" - cspell-io "^4.0.20" - cspell-trie-lib "^4.1.8" - cspell-util-bundle "^4.0.10" + cspell-dict-software-terms "^1.0.7" + cspell-dict-typescript "^1.0.4" + cspell-io "^4.0.21" + cspell-trie-lib "^4.1.9" + cspell-util-bundle "^4.0.11" fs-extra "^8.1.0" - gensequence "^3.0.3" + gensequence "^3.1.1" + minimatch "^3.0.4" vscode-uri "^2.1.1" -cspell-trie-lib@^4.1.8: - version "4.1.8" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-4.1.8.tgz#cc40c863c8c03920c61e5330c3acfcaf9871e40f" - integrity sha512-G0Jpybwxyl7rG3c4tzrROEVmiKAsyIjaDdnGxkzOFkl4tjcZeCh7GIVrqLyyk3VWslrWMVvmQi1/eLDccagepw== +cspell-trie-lib@^4.1.9: + version "4.1.9" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-4.1.9.tgz#ebf38b5affd9a35289e945c7482b112152e5102f" + integrity sha512-Qf/bnXwEwm6oRaZPvELuIva6iJfCr+4WDbcNaNZUd+J3snanMpzp+TsqHyH3p1dPxnvO8eAEnU9RWVUdbXXnfA== dependencies: - gensequence "^3.0.3" + gensequence "^3.1.1" -cspell-util-bundle@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/cspell-util-bundle/-/cspell-util-bundle-4.0.10.tgz#22aa483645dc92abbec8829cb5cf20017898cc97" - integrity sha512-XpBNIwVfJz9OVLR/ztW4BG75UbqmlBh31R5CpmNFxNF7QeiQwIrU8QMYzjtSnIwmOe6t0Hsx+X1UC2KUqMhRtA== +cspell-util-bundle@^4.0.11: + version "4.0.11" + resolved "https://registry.yarnpkg.com/cspell-util-bundle/-/cspell-util-bundle-4.0.11.tgz#838e493a33a063e2f28df0bd81bcf86c3cf15385" + integrity sha512-6AJRN0KbeTJB+IPpwKb11zFUVz2Q8Rgm4qmy/wsbhw6ICFfmgWG5Fr2OzJpZBCm8GJJg1Tjs/VZimSvCdnRj7g== cspell@^4.0.55: - version "4.0.56" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-4.0.56.tgz#d26b7da80ff01ee3c8b6fb15d79765fdff302931" - integrity sha512-5lbuNnXOdh06+Zi1+p/iZLQDECtC/T4Kr/La3NSWdGIOLKDExA7/g0T6YHlGZnVwdNozo5Dvm0hbiC9qxmSGMQ== + version "4.0.57" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-4.0.57.tgz#8323c9d198cbc6dc90bb3ce42f2e5a9585bc0f6d" + integrity sha512-iKQ6iWP4nhMiuu1PnbcVGfZ0tE/NXRqRjYA1Kq/UW35a90WLSecIq8YgJn2J48FtnfWujPzXl/U7Tj4WqleGXg== dependencies: chalk "^2.4.2" commander "^2.20.3" comment-json "^1.1.3" - cspell-glob "^0.1.17" - cspell-lib "^4.1.22" + cspell-glob "^0.1.18" + cspell-lib "^4.1.23" fs-extra "^8.1.0" - gensequence "^3.0.3" + gensequence "^3.1.1" get-stdin "^7.0.0" glob "^7.1.6" minimatch "^3.0.4" @@ -2944,10 +2945,10 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -gensequence@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/gensequence/-/gensequence-3.0.3.tgz#5e76326bb893147e80d6f2ae495c7e9a2795f7cc" - integrity sha512-KM4L8AfWAfjIvdnBhl7erj35iBNf75pP0+8Ww3BKssVEBv95Dqu40cG62kAyVXtuLplb96wh/GUr+GhM6YG9gQ== +gensequence@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/gensequence/-/gensequence-3.1.1.tgz#95c1afc7c0680f92942c17f2d6f83f3d26ea97af" + integrity sha512-ys3h0hiteRwmY6BsvSttPmkhC0vEQHPJduANBRtH/dlDPZ0UBIb/dXy80IcckXyuQ6LKg+PloRqvGER9IS7F7g== gensync@^1.0.0-beta.1: version "1.0.0-beta.1" From cb0d11ef28932b3d3577695edbde130c02b8ac55 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2020 22:42:22 +0000 Subject: [PATCH 18/30] chore(deps-dev): bump jest from 25.3.0 to 25.4.0 Bumps [jest](https://github.com/facebook/jest) from 25.3.0 to 25.4.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v25.3.0...v25.4.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 632 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 347 insertions(+), 285 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e322d8c1..5aa42910c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -292,43 +292,44 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@jest/console@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.3.0.tgz#33b56b81238427bf3ebe3f7b3378d2f79cdbd409" - integrity sha512-LvSDNqpmZIZyweFaEQ6wKY7CbexPitlsLHGJtcooNECo0An/w49rFhjCJzu6efeb6+a3ee946xss1Jcd9r03UQ== +"@jest/console@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.4.0.tgz#e2760b532701137801ba824dcff6bc822c961bac" + integrity sha512-CfE0erx4hdJ6t7RzAcE1wLG6ZzsHSmybvIBQDoCkDM1QaSeWL9wJMzID/2BbHHa7ll9SsbbK43HjbERbBaFX2A== dependencies: - "@jest/source-map" "^25.2.6" + "@jest/types" "^25.4.0" chalk "^3.0.0" - jest-util "^25.3.0" + jest-message-util "^25.4.0" + jest-util "^25.4.0" slash "^3.0.0" -"@jest/core@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.3.0.tgz#80f97a7a8b59dde741a24f30871cc26d0197d426" - integrity sha512-+D5a/tFf6pA/Gqft2DLBp/yeSRgXhlJ+Wpst0X/ZkfTRP54qDR3C61VfHwaex+GzZBiTcE9vQeoZ2v5T10+Mqw== +"@jest/core@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-25.4.0.tgz#cc1fe078df69b8f0fbb023bb0bcee23ef3b89411" + integrity sha512-h1x9WSVV0+TKVtATGjyQIMJENs8aF6eUjnCoi4jyRemYZmekLr8EJOGQqTWEX8W6SbZ6Skesy9pGXrKeAolUJw== dependencies: - "@jest/console" "^25.3.0" - "@jest/reporters" "^25.3.0" - "@jest/test-result" "^25.3.0" - "@jest/transform" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/console" "^25.4.0" + "@jest/reporters" "^25.4.0" + "@jest/test-result" "^25.4.0" + "@jest/transform" "^25.4.0" + "@jest/types" "^25.4.0" ansi-escapes "^4.2.1" chalk "^3.0.0" exit "^0.1.2" graceful-fs "^4.2.3" - jest-changed-files "^25.3.0" - jest-config "^25.3.0" - jest-haste-map "^25.3.0" - jest-message-util "^25.3.0" + jest-changed-files "^25.4.0" + jest-config "^25.4.0" + jest-haste-map "^25.4.0" + jest-message-util "^25.4.0" jest-regex-util "^25.2.6" - jest-resolve "^25.3.0" - jest-resolve-dependencies "^25.3.0" - jest-runner "^25.3.0" - jest-runtime "^25.3.0" - jest-snapshot "^25.3.0" - jest-util "^25.3.0" - jest-validate "^25.3.0" - jest-watcher "^25.3.0" + jest-resolve "^25.4.0" + jest-resolve-dependencies "^25.4.0" + jest-runner "^25.4.0" + jest-runtime "^25.4.0" + jest-snapshot "^25.4.0" + jest-util "^25.4.0" + jest-validate "^25.4.0" + jest-watcher "^25.4.0" micromatch "^4.0.2" p-each-series "^2.1.0" realpath-native "^2.0.0" @@ -336,36 +337,36 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.3.0.tgz#587f28ddb4b0dfe97404d3d4a4c9dbfa0245fb2e" - integrity sha512-vgooqwJTHLLak4fE+TaCGeYP7Tz1Y3CKOsNxR1sE0V3nx3KRUHn3NUnt+wbcfd5yQWKZQKAfW6wqbuwQLrXo3g== +"@jest/environment@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-25.4.0.tgz#45071f525f0d8c5a51ed2b04fd42b55a8f0c7cb3" + integrity sha512-KDctiak4mu7b4J6BIoN/+LUL3pscBzoUCP+EtSPd2tK9fqyDY5OF+CmkBywkFWezS9tyH5ACOQNtpjtueEDH6Q== dependencies: - "@jest/fake-timers" "^25.3.0" - "@jest/types" "^25.3.0" - jest-mock "^25.3.0" + "@jest/fake-timers" "^25.4.0" + "@jest/types" "^25.4.0" + jest-mock "^25.4.0" -"@jest/fake-timers@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.3.0.tgz#995aad36d5c8984165ca5db12e740ab8dbf7042a" - integrity sha512-NHAj7WbsyR3qBJPpBwSwqaq2WluIvUQsyzpJTN7XDVk7VnlC/y1BAnaYZL3vbPIP8Nhm0Ae5DJe0KExr/SdMJQ== +"@jest/fake-timers@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.4.0.tgz#3a9a4289ba836abd084953dca406389a57e00fbd" + integrity sha512-lI9z+VOmVX4dPPFzyj0vm+UtaB8dCJJ852lcDnY0uCPRvZAaVGnMwBBc1wxtf+h7Vz6KszoOvKAt4QijDnHDkg== dependencies: - "@jest/types" "^25.3.0" - jest-message-util "^25.3.0" - jest-mock "^25.3.0" - jest-util "^25.3.0" + "@jest/types" "^25.4.0" + jest-message-util "^25.4.0" + jest-mock "^25.4.0" + jest-util "^25.4.0" lolex "^5.0.0" -"@jest/reporters@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.3.0.tgz#7f39f0e6911561cc5112a1b54656de18faee269b" - integrity sha512-1u0ZBygs0C9DhdYgLCrRfZfNKQa+9+J7Uo+Z9z0RWLHzgsxhoG32lrmMOtUw48yR6bLNELdvzormwUqSk4H4Vg== +"@jest/reporters@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-25.4.0.tgz#836093433b32ce4e866298af2d6fcf6ed351b0b0" + integrity sha512-bhx/buYbZgLZm4JWLcRJ/q9Gvmd3oUh7k2V7gA4ZYBx6J28pIuykIouclRdiAC6eGVX1uRZT+GK4CQJLd/PwPg== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^25.3.0" - "@jest/test-result" "^25.3.0" - "@jest/transform" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/console" "^25.4.0" + "@jest/test-result" "^25.4.0" + "@jest/transform" "^25.4.0" + "@jest/types" "^25.4.0" chalk "^3.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -375,15 +376,15 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^25.3.0" - jest-resolve "^25.3.0" - jest-util "^25.3.0" - jest-worker "^25.2.6" + jest-haste-map "^25.4.0" + jest-resolve "^25.4.0" + jest-util "^25.4.0" + jest-worker "^25.4.0" slash "^3.0.0" source-map "^0.6.0" string-length "^3.1.0" terminal-link "^2.0.0" - v8-to-istanbul "^4.0.1" + v8-to-istanbul "^4.1.3" optionalDependencies: node-notifier "^6.0.0" @@ -396,41 +397,41 @@ graceful-fs "^4.2.3" source-map "^0.6.0" -"@jest/test-result@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.3.0.tgz#137fab5e5c6fed36e5d40735d1eb029325e3bf06" - integrity sha512-mqrGuiiPXl1ap09Mydg4O782F3ouDQfsKqtQzIjitpwv3t1cHDwCto21jThw6WRRE+dKcWQvLG70GpyLJICfGw== +"@jest/test-result@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.4.0.tgz#6f2ec2c8da9981ef013ad8651c1c6f0cb20c6324" + integrity sha512-8BAKPaMCHlL941eyfqhWbmp3MebtzywlxzV+qtngQ3FH+RBqnoSAhNEPj4MG7d2NVUrMOVfrwuzGpVIK+QnMAA== dependencies: - "@jest/console" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/console" "^25.4.0" + "@jest/types" "^25.4.0" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.3.0.tgz#271ad5f2b8f8137d092ccedc87e16a50f8676209" - integrity sha512-Xvns3xbji7JCvVcDGvqJ/pf4IpmohPODumoPEZJ0/VgC5gI4XaNVIBET2Dq5Czu6Gk3xFcmhtthh/MBOTljdNg== +"@jest/test-sequencer@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-25.4.0.tgz#2b96f9d37f18dc3336b28e3c8070f97f9f55f43b" + integrity sha512-240cI+nsM3attx2bMp9uGjjHrwrpvxxrZi8Tyqp/cfOzl98oZXVakXBgxODGyBYAy/UGXPKXLvNc2GaqItrsJg== dependencies: - "@jest/test-result" "^25.3.0" - jest-haste-map "^25.3.0" - jest-runner "^25.3.0" - jest-runtime "^25.3.0" + "@jest/test-result" "^25.4.0" + jest-haste-map "^25.4.0" + jest-runner "^25.4.0" + jest-runtime "^25.4.0" -"@jest/transform@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.3.0.tgz#083c5447d5307d9b9494d6968115b647460e71f1" - integrity sha512-W01p8kTDvvEX6kd0tJc7Y5VdYyFaKwNWy1HQz6Jqlhu48z/8Gxp+yFCDVj+H8Rc7ezl3Mg0hDaGuFVkmHOqirg== +"@jest/transform@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.4.0.tgz#eef36f0367d639e2fd93dccd758550377fbb9962" + integrity sha512-t1w2S6V1sk++1HHsxboWxPEuSpN8pxEvNrZN+Ud/knkROWtf8LeUmz73A4ezE8476a5AM00IZr9a8FO9x1+j3g== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" babel-plugin-istanbul "^6.0.0" chalk "^3.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.3" - jest-haste-map "^25.3.0" + jest-haste-map "^25.4.0" jest-regex-util "^25.2.6" - jest-util "^25.3.0" + jest-util "^25.4.0" micromatch "^4.0.2" pirates "^4.0.1" realpath-native "^2.0.0" @@ -457,6 +458,16 @@ "@types/yargs" "^15.0.0" chalk "^3.0.0" +"@jest/types@^25.4.0": + version "25.4.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.4.0.tgz#5afeb8f7e1cba153a28e5ac3c9fe3eede7206d59" + integrity sha512-XBeaWNzw2PPnGW5aXvZt3+VO60M+34RY3XDsCK5tW7kyj3RK0XClRutCfjqcBuaR2aBQTbluEDME9b5MB9UAPw== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^15.0.0" + chalk "^3.0.0" + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" @@ -573,6 +584,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.36.tgz#162c8c2a2e659da480049df0e19ae128ad3a1527" integrity sha512-hmmypvyO/uTLFYCYu6Hlb3ydeJ11vXRxg8/WJ0E3wvwmPO0y47VqnfmXFVuWlysO0Zyj+je1Y33rQeuYkZ51GQ== +"@types/normalize-package-data@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" + integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -1095,16 +1111,16 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-jest@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.3.0.tgz#999d0c19e8427f66b796bf9ea233eedf087b957c" - integrity sha512-qiXeX1Cmw4JZ5yQ4H57WpkO0MZ61Qj+YnsVUwAMnDV5ls+yHon11XjarDdgP7H8lTmiEi6biiZA8y3Tmvx6pCg== +babel-jest@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.4.0.tgz#409eb3e2ddc2ad9a92afdbb00991f1633f8018d0" + integrity sha512-p+epx4K0ypmHuCnd8BapfyOwWwosNCYhedetQey1awddtfmEX0MmdxctGl956uwUmjwXR5VSS5xJcGX9DvdIog== dependencies: - "@jest/transform" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/transform" "^25.4.0" + "@jest/types" "^25.4.0" "@types/babel__core" "^7.1.7" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^25.3.0" + babel-preset-jest "^25.4.0" chalk "^3.0.0" slash "^3.0.0" @@ -1130,10 +1146,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.2.6.tgz#2af07632b8ac7aad7d414c1e58425d5fc8e84909" - integrity sha512-qE2xjMathybYxjiGFJg0mLFrz0qNp83aNZycWDY/SuHiZNq+vQfRQtuINqyXyue1ELd8Rd+1OhFSLjms8msMbw== +babel-plugin-jest-hoist@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.4.0.tgz#0c122c1b93fb76f52d2465be2e8069e798e9d442" + integrity sha512-M3a10JCtTyKevb0MjuH6tU+cP/NVQZ82QPADqI1RQYY1OphztsCeIeQmTsHmF/NS6m0E51Zl4QNsI3odXSQF5w== dependencies: "@types/babel__traverse" "^7.0.6" @@ -1153,12 +1169,12 @@ babel-preset-current-node-syntax@^0.1.2: "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -babel-preset-jest@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.3.0.tgz#9ab40aee52a19bdc52b8b1ec2403d5914ac3d86b" - integrity sha512-tjdvLKNMwDI9r+QWz9sZUQGTq1dpoxjUqFUpEasAc7MOtHg9XuLT2fx0udFG+k1nvMV0WvHHVAN7VmCZ+1Zxbw== +babel-preset-jest@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.4.0.tgz#10037cc32b751b994b260964629e49dc479abf4c" + integrity sha512-PwFiEWflHdu3JCeTr0Pb9NcHHE34qWFnPQRVPvqQITx4CsDCzs6o05923I10XvLvn9nNsRHuiVgB72wG/90ZHQ== dependencies: - babel-plugin-jest-hoist "^25.2.6" + babel-plugin-jest-hoist "^25.4.0" babel-preset-current-node-syntax "^0.1.2" babel-runtime@^6.26.0: @@ -2618,16 +2634,16 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-25.3.0.tgz#5fd36e51befd05afb7184bc954f8a4792d184c71" - integrity sha512-buboTXML2h/L0Kh44Ys2Cx49mX20ISc5KDirkxIs3Q9AJv0kazweUAbukegr+nHDOvFRKmxdojjIHCjqAceYfg== +expect@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-25.4.0.tgz#0b16c17401906d1679d173e59f0d4580b22f8dc8" + integrity sha512-7BDIX99BTi12/sNGJXA9KMRcby4iAmu1xccBOhyKCyEhjcVKS3hPmHdA/4nSI9QGIOkUropKqr3vv7WMDM5lvQ== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" ansi-styles "^4.0.0" jest-get-type "^25.2.6" - jest-matcher-utils "^25.3.0" - jest-message-util "^25.3.0" + jest-matcher-utils "^25.4.0" + jest-message-util "^25.4.0" jest-regex-util "^25.2.6" extend-shallow@^2.0.1: @@ -3664,59 +3680,59 @@ iterable-to-stream@^1.0.1: resolved "https://registry.yarnpkg.com/iterable-to-stream/-/iterable-to-stream-1.0.1.tgz#37e86baacf6b1a0e9233dad4eb526d0423d08bf3" integrity sha512-O62gD5ADMUGtJoOoM9U6LQ7i4byPXUNoHJ6mqsmkQJcom331ZJGDApWgDESWyBMEHEJRjtHozgIiTzYo9RU4UA== -jest-changed-files@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.3.0.tgz#85d8de6f4bd13dafda9d7f1e3f2565fc0e183c78" - integrity sha512-eqd5hyLbUjIVvLlJ3vQ/MoPxsxfESVXG9gvU19XXjKzxr+dXmZIqCXiY0OiYaibwlHZBJl2Vebkc0ADEMzCXew== +jest-changed-files@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-25.4.0.tgz#e573db32c2fd47d2b90357ea2eda0622c5c5cbd6" + integrity sha512-VR/rfJsEs4BVMkwOTuStRyS630fidFVekdw/lBaBQjx9KK3VZFOZ2c0fsom2fRp8pMCrCTP6LGna00o/DXGlqA== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" execa "^3.2.0" throat "^5.0.0" -jest-cli@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.3.0.tgz#d9e11f5700cc5946583cf0d01a9bdebceed448d2" - integrity sha512-XpNQPlW1tzpP7RGG8dxpkRegYDuLjzSiENu92+CYM87nEbmEPb3b4+yo8xcsHOnj0AG7DUt9b3uG8LuHI3MDzw== +jest-cli@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-25.4.0.tgz#5dac8be0fece6ce39f0d671395a61d1357322bab" + integrity sha512-usyrj1lzCJZMRN1r3QEdnn8e6E6yCx/QN7+B1sLoA68V7f3WlsxSSQfy0+BAwRiF4Hz2eHauf11GZG3PIfWTXQ== dependencies: - "@jest/core" "^25.3.0" - "@jest/test-result" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/core" "^25.4.0" + "@jest/test-result" "^25.4.0" + "@jest/types" "^25.4.0" chalk "^3.0.0" exit "^0.1.2" import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^25.3.0" - jest-util "^25.3.0" - jest-validate "^25.3.0" + jest-config "^25.4.0" + jest-util "^25.4.0" + jest-validate "^25.4.0" prompts "^2.0.1" realpath-native "^2.0.0" yargs "^15.3.1" -jest-config@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.3.0.tgz#112b5e2f2e57dec4501dd2fe979044c06fb1317e" - integrity sha512-CmF1JnNWFmoCSPC4tnU52wnVBpuxHjilA40qH/03IHxIevkjUInSMwaDeE6ACfxMPTLidBGBCO3EbxvzPbo8wA== +jest-config@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-25.4.0.tgz#56e5df3679a96ff132114b44fb147389c8c0a774" + integrity sha512-egT9aKYxMyMSQV1aqTgam0SkI5/I2P9qrKexN5r2uuM2+68ypnc+zPGmfUxK7p1UhE7dYH9SLBS7yb+TtmT1AA== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^25.3.0" - "@jest/types" "^25.3.0" - babel-jest "^25.3.0" + "@jest/test-sequencer" "^25.4.0" + "@jest/types" "^25.4.0" + babel-jest "^25.4.0" chalk "^3.0.0" deepmerge "^4.2.2" glob "^7.1.1" - jest-environment-jsdom "^25.3.0" - jest-environment-node "^25.3.0" + jest-environment-jsdom "^25.4.0" + jest-environment-node "^25.4.0" jest-get-type "^25.2.6" - jest-jasmine2 "^25.3.0" + jest-jasmine2 "^25.4.0" jest-regex-util "^25.2.6" - jest-resolve "^25.3.0" - jest-util "^25.3.0" - jest-validate "^25.3.0" + jest-resolve "^25.4.0" + jest-util "^25.4.0" + jest-validate "^25.4.0" micromatch "^4.0.2" - pretty-format "^25.3.0" + pretty-format "^25.4.0" realpath-native "^2.0.0" -jest-diff@^25.1.0, jest-diff@^25.3.0: +jest-diff@^25.1.0: version "25.3.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.3.0.tgz#0d7d6f5d6171e5dacde9e05be47b3615e147c26f" integrity sha512-vyvs6RPoVdiwARwY4kqFWd4PirPLm2dmmkNzKqo38uZOzJvLee87yzDjIZLmY1SjM3XR5DwsUH+cdQ12vgqi1w== @@ -3726,6 +3742,16 @@ jest-diff@^25.1.0, jest-diff@^25.3.0: jest-get-type "^25.2.6" pretty-format "^25.3.0" +jest-diff@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.4.0.tgz#260b70f19a46c283adcad7f081cae71eb784a634" + integrity sha512-kklLbJVXW0y8UKOWOdYhI6TH5MG6QAxrWiBMgQaPIuhj3dNFGirKCd+/xfplBXICQ7fI+3QcqHm9p9lWu1N6ug== + dependencies: + chalk "^3.0.0" + diff-sequences "^25.2.6" + jest-get-type "^25.2.6" + pretty-format "^25.4.0" + jest-docblock@^25.3.0: version "25.3.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-25.3.0.tgz#8b777a27e3477cd77a168c05290c471a575623ef" @@ -3733,39 +3759,39 @@ jest-docblock@^25.3.0: dependencies: detect-newline "^3.0.0" -jest-each@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.3.0.tgz#a319eecf1f6076164ab86f99ca166a55b96c0bd4" - integrity sha512-aBfS4VOf/Qs95yUlX6d6WBv0szvOcTkTTyCIaLuQGj4bSHsT+Wd9dDngVHrCe5uytxpN8VM+NAloI6nbPjXfXw== +jest-each@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-25.4.0.tgz#ad4e46164764e8e77058f169a0076a7f86f6b7d4" + integrity sha512-lwRIJ8/vQU/6vq3nnSSUw1Y3nz5tkYSFIywGCZpUBd6WcRgpn8NmJoQICojbpZmsJOJNHm0BKdyuJ6Xdx+eDQQ== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" chalk "^3.0.0" jest-get-type "^25.2.6" - jest-util "^25.3.0" - pretty-format "^25.3.0" + jest-util "^25.4.0" + pretty-format "^25.4.0" -jest-environment-jsdom@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.3.0.tgz#c493ab8c41f28001520c70ef67dd88b88be6af05" - integrity sha512-jdE4bQN+k2QEZ9sWOxsqDJvMzbdFSCN/4tw8X0TQaCqyzKz58PyEf41oIr4WO7ERdp7WaJGBSUKF7imR3UW1lg== +jest-environment-jsdom@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-25.4.0.tgz#bbfc7f85bb6ade99089062a830c79cb454565cf0" + integrity sha512-KTitVGMDrn2+pt7aZ8/yUTuS333w3pWt1Mf88vMntw7ZSBNDkRS6/4XLbFpWXYfWfp1FjcjQTOKzbK20oIehWQ== dependencies: - "@jest/environment" "^25.3.0" - "@jest/fake-timers" "^25.3.0" - "@jest/types" "^25.3.0" - jest-mock "^25.3.0" - jest-util "^25.3.0" + "@jest/environment" "^25.4.0" + "@jest/fake-timers" "^25.4.0" + "@jest/types" "^25.4.0" + jest-mock "^25.4.0" + jest-util "^25.4.0" jsdom "^15.2.1" -jest-environment-node@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.3.0.tgz#9845f0e63991e8498448cb0ae804935689533db9" - integrity sha512-XO09S29Nx1NU7TiMPHMoDIkxoGBuKSTbE+sHp0gXbeLDXhIdhysUI25kOqFFSD9AuDgvPvxWCXrvNqiFsOH33g== +jest-environment-node@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-25.4.0.tgz#188aef01ae6418e001c03fdd1c299961e1439082" + integrity sha512-wryZ18vsxEAKFH7Z74zi/y/SyI1j6UkVZ6QsllBuT/bWlahNfQjLNwFsgh/5u7O957dYFoXj4yfma4n4X6kU9A== dependencies: - "@jest/environment" "^25.3.0" - "@jest/fake-timers" "^25.3.0" - "@jest/types" "^25.3.0" - jest-mock "^25.3.0" - jest-util "^25.3.0" + "@jest/environment" "^25.4.0" + "@jest/fake-timers" "^25.4.0" + "@jest/types" "^25.4.0" + jest-mock "^25.4.0" + jest-util "^25.4.0" semver "^6.3.0" jest-get-type@^24.9.0: @@ -3778,18 +3804,18 @@ jest-get-type@^25.2.6: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== -jest-haste-map@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.3.0.tgz#b7683031c9c9ddc0521d311564108b244b11e4c6" - integrity sha512-LjXaRa+F8wwtSxo9G+hHD/Cp63PPQzvaBL9XCVoJD2rrcJO0Zr2+YYzAFWWYJ5GlPUkoaJFJtOuk0sL6MJY80A== +jest-haste-map@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.4.0.tgz#da7c309dd7071e0a80c953ba10a0ec397efb1ae2" + integrity sha512-5EoCe1gXfGC7jmXbKzqxESrgRcaO3SzWXGCnvp9BcT0CFMyrB1Q6LIsjl9RmvmJGQgW297TCfrdgiy574Rl9HQ== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.3" jest-serializer "^25.2.6" - jest-util "^25.3.0" - jest-worker "^25.2.6" + jest-util "^25.4.0" + jest-worker "^25.4.0" micromatch "^4.0.2" sane "^4.0.3" walker "^1.0.7" @@ -3797,27 +3823,27 @@ jest-haste-map@^25.3.0: optionalDependencies: fsevents "^2.1.2" -jest-jasmine2@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.3.0.tgz#16ae4f68adef65fb45001b26c864bcbcbf972830" - integrity sha512-NCYOGE6+HNzYFSui52SefgpsnIzvxjn6KAgqw66BdRp37xpMD/4kujDHLNW5bS5i53os5TcMn6jYrzQRO8VPrQ== +jest-jasmine2@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-25.4.0.tgz#3d3d19514022e2326e836c2b66d68b4cb63c5861" + integrity sha512-QccxnozujVKYNEhMQ1vREiz859fPN/XklOzfQjm2j9IGytAkUbSwjFRBtQbHaNZ88cItMpw02JnHGsIdfdpwxQ== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^25.3.0" + "@jest/environment" "^25.4.0" "@jest/source-map" "^25.2.6" - "@jest/test-result" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/test-result" "^25.4.0" + "@jest/types" "^25.4.0" chalk "^3.0.0" co "^4.6.0" - expect "^25.3.0" + expect "^25.4.0" is-generator-fn "^2.0.0" - jest-each "^25.3.0" - jest-matcher-utils "^25.3.0" - jest-message-util "^25.3.0" - jest-runtime "^25.3.0" - jest-snapshot "^25.3.0" - jest-util "^25.3.0" - pretty-format "^25.3.0" + jest-each "^25.4.0" + jest-matcher-utils "^25.4.0" + jest-message-util "^25.4.0" + jest-runtime "^25.4.0" + jest-snapshot "^25.4.0" + jest-util "^25.4.0" + pretty-format "^25.4.0" throat "^5.0.0" jest-junit@^10.0.0: @@ -3831,43 +3857,43 @@ jest-junit@^10.0.0: uuid "^3.3.3" xml "^1.0.1" -jest-leak-detector@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.3.0.tgz#5b6bf04903b35be56038915a55f47291771f769f" - integrity sha512-jk7k24dMIfk8LUSQQGN8PyOy9+J0NAfHZWiDmUDYVMctY8FLJQ1eQ8+PjMoN8PgwhLIggUqgYJnyRFvUz3jLRw== +jest-leak-detector@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-25.4.0.tgz#cf94a160c78e53d810e7b2f40b5fd7ee263375b3" + integrity sha512-7Y6Bqfv2xWsB+7w44dvZuLs5SQ//fzhETgOGG7Gq3TTGFdYvAgXGwV8z159RFZ6fXiCPm/szQ90CyfVos9JIFQ== dependencies: jest-get-type "^25.2.6" - pretty-format "^25.3.0" + pretty-format "^25.4.0" -jest-matcher-utils@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.3.0.tgz#76765788a26edaa8bc5f0100aea52ae383559648" - integrity sha512-ZBUJ2fchNIZt+fyzkuCFBb8SKaU//Rln45augfUtbHaGyVxCO++ANARdBK9oPGXU3hEDgyy7UHnOP/qNOJXFUg== +jest-matcher-utils@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-25.4.0.tgz#dc3e7aec402a1e567ed80b572b9ad285878895e6" + integrity sha512-yPMdtj7YDgXhnGbc66bowk8AkQ0YwClbbwk3Kzhn5GVDrciiCr27U4NJRbrqXbTdtxjImONITg2LiRIw650k5A== dependencies: chalk "^3.0.0" - jest-diff "^25.3.0" + jest-diff "^25.4.0" jest-get-type "^25.2.6" - pretty-format "^25.3.0" + pretty-format "^25.4.0" -jest-message-util@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.3.0.tgz#e3836826fe5ca538a337b87d9bd2648190867f85" - integrity sha512-5QNy9Id4WxJbRITEbA1T1kem9bk7y2fD0updZMSTNHtbEDnYOGLDPAuFBhFgVmOZpv0n6OMdVkK+WhyXEPCcOw== +jest-message-util@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.4.0.tgz#2899e8bc43f5317acf8dfdfe89ea237d354fcdab" + integrity sha512-LYY9hRcVGgMeMwmdfh9tTjeux1OjZHMusq/E5f3tJN+dAoVVkJtq5ZUEPIcB7bpxDUt2zjUsrwg0EGgPQ+OhXQ== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" "@types/stack-utils" "^1.0.1" chalk "^3.0.0" micromatch "^4.0.2" slash "^3.0.0" stack-utils "^1.0.1" -jest-mock@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.3.0.tgz#d72644509e40987a732a9a2534a1054f4649402c" - integrity sha512-yRn6GbuqB4j3aYu+Z1ezwRiZfp0o9om5uOcBovVtkcRLeBCNP5mT0ysdenUsxAHnQUgGwPOE1wwhtQYe6NKirQ== +jest-mock@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.4.0.tgz#ded7d64b5328d81d78d2138c825d3a45e30ec8ca" + integrity sha512-MdazSfcYAUjJjuVTTnusLPzE0pE4VXpOUzWdj8sbM+q6abUjm3bATVPXFqTXrxSieR8ocpvQ9v/QaQCftioQFg== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" jest-pnp-resolver@^1.2.1: version "1.2.1" @@ -3879,78 +3905,80 @@ jest-regex-util@^25.2.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.2.6.tgz#d847d38ba15d2118d3b06390056028d0f2fd3964" integrity sha512-KQqf7a0NrtCkYmZZzodPftn7fL1cq3GQAFVMn5Hg8uKx/fIenLEobNanUxb7abQ1sjADHBseG/2FGpsv/wr+Qw== -jest-resolve-dependencies@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.3.0.tgz#b0e4ae053dd44ddacc18c6ee12b5b7c28e445a90" - integrity sha512-bDUlLYmHW+f7J7KgcY2lkq8EMRqKonRl0XoD4Wp5SJkgAxKJnsaIOlrrVNTfXYf+YOu3VCjm/Ac2hPF2nfsCIA== +jest-resolve-dependencies@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-25.4.0.tgz#783937544cfc40afcc7c569aa54748c4b3f83f5a" + integrity sha512-A0eoZXx6kLiuG1Ui7wITQPl04HwjLErKIJTt8GR3c7UoDAtzW84JtCrgrJ6Tkw6c6MwHEyAaLk7dEPml5pf48A== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" jest-regex-util "^25.2.6" - jest-snapshot "^25.3.0" + jest-snapshot "^25.4.0" -jest-resolve@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.3.0.tgz#cb90a5bbea54a02eccdbbf4126a819595dcf91d6" - integrity sha512-IHoQAAybulsJ+ZgWis+ekYKDAoFkVH5Nx/znpb41zRtpxj4fr2WNV9iDqavdSm8GIpMlsfZxbC/fV9DhW0q9VQ== +jest-resolve@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-25.4.0.tgz#6f4540ce0d419c4c720e791e871da32ba4da7a60" + integrity sha512-wOsKqVDFWUiv8BtLMCC6uAJ/pHZkfFgoBTgPtmYlsprAjkxrr2U++ZnB3l5ykBMd2O24lXvf30SMAjJIW6k2aA== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" browser-resolve "^1.11.3" chalk "^3.0.0" jest-pnp-resolver "^1.2.1" + read-pkg-up "^7.0.1" realpath-native "^2.0.0" resolve "^1.15.1" + slash "^3.0.0" -jest-runner@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.3.0.tgz#673ef2ac79d2810eb6b2c1a3f82398375a3d1174" - integrity sha512-csDqSC9qGHYWDrzrElzEgFbteztFeZJmKhSgY5jlCIcN0+PhActzRNku0DA1Xa1HxGOb0/AfbP1EGJlP4fGPtA== +jest-runner@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-25.4.0.tgz#6ca4a3d52e692bbc081228fa68f750012f1f29e5" + integrity sha512-wWQSbVgj2e/1chFdMRKZdvlmA6p1IPujhpLT7TKNtCSl1B0PGBGvJjCaiBal/twaU2yfk8VKezHWexM8IliBfA== dependencies: - "@jest/console" "^25.3.0" - "@jest/environment" "^25.3.0" - "@jest/test-result" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/console" "^25.4.0" + "@jest/environment" "^25.4.0" + "@jest/test-result" "^25.4.0" + "@jest/types" "^25.4.0" chalk "^3.0.0" exit "^0.1.2" graceful-fs "^4.2.3" - jest-config "^25.3.0" + jest-config "^25.4.0" jest-docblock "^25.3.0" - jest-haste-map "^25.3.0" - jest-jasmine2 "^25.3.0" - jest-leak-detector "^25.3.0" - jest-message-util "^25.3.0" - jest-resolve "^25.3.0" - jest-runtime "^25.3.0" - jest-util "^25.3.0" - jest-worker "^25.2.6" + jest-haste-map "^25.4.0" + jest-jasmine2 "^25.4.0" + jest-leak-detector "^25.4.0" + jest-message-util "^25.4.0" + jest-resolve "^25.4.0" + jest-runtime "^25.4.0" + jest-util "^25.4.0" + jest-worker "^25.4.0" source-map-support "^0.5.6" throat "^5.0.0" -jest-runtime@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.3.0.tgz#af4d40dbcc590fa5de9910cb6a120a13d131050b" - integrity sha512-gn5KYB1wxXRM3nfw8fVpthFu60vxQUCr+ShGq41+ZBFF3DRHZRKj3HDWVAVB4iTNBj2y04QeAo5cZ/boYaPg0w== +jest-runtime@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-25.4.0.tgz#1e5227a9e2159d26ae27dcd426ca6bc041983439" + integrity sha512-lgNJlCDULtXu9FumnwCyWlOub8iytijwsPNa30BKrSNtgoT6NUMXOPrZvsH06U6v0wgD/Igwz13nKA2wEKU2VA== dependencies: - "@jest/console" "^25.3.0" - "@jest/environment" "^25.3.0" + "@jest/console" "^25.4.0" + "@jest/environment" "^25.4.0" "@jest/source-map" "^25.2.6" - "@jest/test-result" "^25.3.0" - "@jest/transform" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/test-result" "^25.4.0" + "@jest/transform" "^25.4.0" + "@jest/types" "^25.4.0" "@types/yargs" "^15.0.0" chalk "^3.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.3" - jest-config "^25.3.0" - jest-haste-map "^25.3.0" - jest-message-util "^25.3.0" - jest-mock "^25.3.0" + jest-config "^25.4.0" + jest-haste-map "^25.4.0" + jest-message-util "^25.4.0" + jest-mock "^25.4.0" jest-regex-util "^25.2.6" - jest-resolve "^25.3.0" - jest-snapshot "^25.3.0" - jest-util "^25.3.0" - jest-validate "^25.3.0" + jest-resolve "^25.4.0" + jest-snapshot "^25.4.0" + jest-util "^25.4.0" + jest-validate "^25.4.0" realpath-native "^2.0.0" slash "^3.0.0" strip-bom "^4.0.0" @@ -3961,32 +3989,32 @@ jest-serializer@^25.2.6: resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.2.6.tgz#3bb4cc14fe0d8358489dbbefbb8a4e708ce039b7" integrity sha512-RMVCfZsezQS2Ww4kB5HJTMaMJ0asmC0BHlnobQC6yEtxiFKIxohFA4QSXSabKwSggaNkqxn6Z2VwdFCjhUWuiQ== -jest-snapshot@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.3.0.tgz#d4feb457494f4aaedcc83fbbf1ca21808fc3df71" - integrity sha512-GGpR6Oro2htJPKh5RX4PR1xwo5jCEjtvSPLW1IS7N85y+2bWKbiknHpJJRKSdGXghElb5hWaeQASJI4IiRayGg== +jest-snapshot@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-25.4.0.tgz#e0b26375e2101413fd2ccb4278a5711b1922545c" + integrity sha512-J4CJ0X2SaGheYRZdLz9CRHn9jUknVmlks4UBeu270hPAvdsauFXOhx9SQP2JtRzhnR3cvro/9N9KP83/uvFfRg== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" "@types/prettier" "^1.19.0" chalk "^3.0.0" - expect "^25.3.0" - jest-diff "^25.3.0" + expect "^25.4.0" + jest-diff "^25.4.0" jest-get-type "^25.2.6" - jest-matcher-utils "^25.3.0" - jest-message-util "^25.3.0" - jest-resolve "^25.3.0" + jest-matcher-utils "^25.4.0" + jest-message-util "^25.4.0" + jest-resolve "^25.4.0" make-dir "^3.0.0" natural-compare "^1.4.0" - pretty-format "^25.3.0" + pretty-format "^25.4.0" semver "^6.3.0" -jest-util@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.3.0.tgz#e3b0064165818f10d78514696fd25efba82cf049" - integrity sha512-dc625P/KS/CpWTJJJxKc4bA3A6c+PJGBAqS8JTJqx4HqPoKNqXg/Ec8biL2Z1TabwK7E7Ilf0/ukSEXM1VwzNA== +jest-util@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.4.0.tgz#6a093d09d86d2b41ef583e5fe7dd3976346e1acd" + integrity sha512-WSZD59sBtAUjLv1hMeKbNZXmMcrLRWcYqpO8Dz8b4CeCTZpfNQw2q9uwrYAD+BbJoLJlu4ezVPwtAmM/9/SlZA== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" chalk "^3.0.0" is-ci "^2.0.0" make-dir "^3.0.0" @@ -4003,28 +4031,28 @@ jest-validate@^24.9.0: leven "^3.1.0" pretty-format "^24.9.0" -jest-validate@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.3.0.tgz#eb95fdee0039647bcd5d4be641b21e4a142a880c" - integrity sha512-3WuXgIZ4HXUvW6gk9twFFkT9j6zUorKnF2oEY8VEsHb7x5LGvVlN3WUsbqazVKuyXwvikO2zFJ/YTySMsMje2w== +jest-validate@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-25.4.0.tgz#2e177a93b716a137110eaf2768f3d9095abd3f38" + integrity sha512-hvjmes/EFVJSoeP1yOl8qR8mAtMR3ToBkZeXrD/ZS9VxRyWDqQ/E1C5ucMTeSmEOGLipvdlyipiGbHJ+R1MQ0g== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" camelcase "^5.3.1" chalk "^3.0.0" jest-get-type "^25.2.6" leven "^3.1.0" - pretty-format "^25.3.0" + pretty-format "^25.4.0" -jest-watcher@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.3.0.tgz#fd03fd5ca52f02bd3161ab177466bf1bfdd34e5c" - integrity sha512-dtFkfidFCS9Ucv8azOg2hkiY3sgJEHeTLtGFHS+jfBEE7eRtrO6+2r1BokyDkaG2FOD7485r/SgpC1MFAENfeA== +jest-watcher@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-25.4.0.tgz#63ec0cd5c83bb9c9d1ac95be7558dd61c995ff05" + integrity sha512-36IUfOSRELsKLB7k25j/wutx0aVuHFN6wO94gPNjQtQqFPa2rkOymmx9rM5EzbF3XBZZ2oqD9xbRVoYa2w86gw== dependencies: - "@jest/test-result" "^25.3.0" - "@jest/types" "^25.3.0" + "@jest/test-result" "^25.4.0" + "@jest/types" "^25.4.0" ansi-escapes "^4.2.1" chalk "^3.0.0" - jest-util "^25.3.0" + jest-util "^25.4.0" string-length "^3.1.0" jest-worker@^25.1.0: @@ -4035,22 +4063,22 @@ jest-worker@^25.1.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.2.6.tgz#d1292625326794ce187c38f51109faced3846c58" - integrity sha512-FJn9XDUSxcOR4cwDzRfL1z56rUofNTFs539FGASpd50RHdb6EVkhxQqktodW2mI49l+W3H+tFJDotCHUQF6dmA== +jest-worker@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.4.0.tgz#ee0e2ceee5a36ecddf5172d6d7e0ab00df157384" + integrity sha512-ghAs/1FtfYpMmYQ0AHqxV62XPvKdUDIBBApMZfly+E9JEmYh2K45G0R5dWxx986RN12pRCxsViwQVtGl+N4whw== dependencies: merge-stream "^2.0.0" supports-color "^7.0.0" jest@^25.1.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-25.3.0.tgz#7a5e59741d94b8662664c77a9f346246d6bf228b" - integrity sha512-iKd5ShQSHzFT5IL/6h5RZJhApgqXSoPxhp5HEi94v6OAw9QkF8T7X+liEU2eEHJ1eMFYTHmeWLrpBWulsDpaUg== + version "25.4.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-25.4.0.tgz#fb96892c5c4e4a6b9bcb12068849cddf4c5f8cc7" + integrity sha512-XWipOheGB4wai5JfCYXd6vwsWNwM/dirjRoZgAa7H2wd8ODWbli2AiKjqG8AYhyx+8+5FBEdpO92VhGlBydzbw== dependencies: - "@jest/core" "^25.3.0" + "@jest/core" "^25.4.0" import-local "^3.0.2" - jest-cli "^25.3.0" + jest-cli "^25.4.0" js-stringify@^1.0.1: version "1.0.2" @@ -4920,7 +4948,7 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== @@ -5446,6 +5474,16 @@ pretty-format@^25.1.0, pretty-format@^25.3.0: ansi-styles "^4.0.0" react-is "^16.12.0" +pretty-format@^25.4.0: + version "25.4.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.4.0.tgz#c58801bb5c4926ff4a677fe43f9b8b99812c7830" + integrity sha512-PI/2dpGjXK5HyXexLPZU/jw5T9Q6S1YVXxxVxco+LIqzUFHXIbKZKdUVt7GcX7QUCr31+3fzhi4gN4/wUYPVxQ== + dependencies: + "@jest/types" "^25.4.0" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -5705,6 +5743,15 @@ read-pkg-up@^3.0.0: find-up "^2.0.0" read-pkg "^3.0.0" +read-pkg-up@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" + integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== + dependencies: + find-up "^4.1.0" + read-pkg "^5.2.0" + type-fest "^0.8.1" + read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" @@ -5714,6 +5761,16 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" +read-pkg@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + dependencies: + "@types/normalize-package-data" "^2.4.0" + normalize-package-data "^2.5.0" + parse-json "^5.0.0" + type-fest "^0.6.0" + "readable-stream@1 || 2", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -6809,6 +6866,11 @@ type-fest@^0.5.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.5.2.tgz#d6ef42a0356c6cd45f49485c3b6281fc148e48a2" integrity sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw== +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== + type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" @@ -6954,10 +7016,10 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== -v8-to-istanbul@^4.0.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.2.tgz#387d173be5383dbec209d21af033dcb892e3ac82" - integrity sha512-G9R+Hpw0ITAmPSr47lSlc5A1uekSYzXxTMlFxso2xoffwo4jQnzbv1p9yXIinO8UMZKfAFewaCHwWvnH4Jb4Ug== +v8-to-istanbul@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.3.tgz#22fe35709a64955f49a08a7c7c959f6520ad6f20" + integrity sha512-sAjOC+Kki6aJVbUOXJbcR0MnbfjvBzwKZazEJymA2IX49uoOdEdk+4fBq5cXgYgiyKtAyrrJNtBZdOeDIF+Fng== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" From 74246ea8b88fe6bf723a582a8edd485425673a46 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2020 21:12:54 +0000 Subject: [PATCH 19/30] chore(deps-dev): bump pretty-format from 25.3.0 to 25.4.0 Bumps [pretty-format](https://github.com/facebook/jest/tree/HEAD/packages/pretty-format) from 25.3.0 to 25.4.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v25.4.0/packages/pretty-format) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5aa42910c..3192e0e7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -448,16 +448,6 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" -"@jest/types@^25.3.0": - version "25.3.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.3.0.tgz#88f94b277a1d028fd7117bc1f74451e0fc2131e7" - integrity sha512-UkaDNewdqXAmCDbN2GlUM6amDKS78eCqiw/UmF5nE0mmLTd6moJkiZJML/X52Ke3LH7Swhw883IRXq8o9nWjVw== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^15.0.0" - chalk "^3.0.0" - "@jest/types@^25.4.0": version "25.4.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.4.0.tgz#5afeb8f7e1cba153a28e5ac3c9fe3eede7206d59" @@ -5464,17 +5454,7 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -pretty-format@^25.1.0, pretty-format@^25.3.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.3.0.tgz#d0a4f988ff4a6cd350342fdabbb809aeb4d49ad5" - integrity sha512-wToHwF8bkQknIcFkBqNfKu4+UZqnrLn/Vr+wwKQwwvPzkBfDDKp/qIabFqdgtoi5PEnM8LFByVsOrHoa3SpTVA== - dependencies: - "@jest/types" "^25.3.0" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^16.12.0" - -pretty-format@^25.4.0: +pretty-format@^25.1.0, pretty-format@^25.3.0, pretty-format@^25.4.0: version "25.4.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.4.0.tgz#c58801bb5c4926ff4a677fe43f9b8b99812c7830" integrity sha512-PI/2dpGjXK5HyXexLPZU/jw5T9Q6S1YVXxxVxco+LIqzUFHXIbKZKdUVt7GcX7QUCr31+3fzhi4gN4/wUYPVxQ== @@ -5716,16 +5696,11 @@ react-dom@^16.8.0: prop-types "^15.6.2" scheduler "^0.19.1" -react-is@^16.12.0: +react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4: version "16.13.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.0.tgz#0f37c3613c34fe6b37cd7f763a0d6293ab15c527" integrity sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA== -react-is@^16.8.1, react-is@^16.8.4: - version "16.10.2" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.10.2.tgz#984120fd4d16800e9a738208ab1fba422d23b5ab" - integrity sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA== - react@^16.8.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e" From 027a55088fa37b64d691a5e9e46aed7619eed6a6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2020 22:04:03 +0000 Subject: [PATCH 20/30] chore(deps-dev): bump jest-diff from 25.3.0 to 25.4.0 Bumps [jest-diff](https://github.com/facebook/jest/tree/HEAD/packages/jest-diff) from 25.3.0 to 25.4.0. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v25.4.0/packages/jest-diff) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3192e0e7c..62f228fb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3722,17 +3722,7 @@ jest-config@^25.4.0: pretty-format "^25.4.0" realpath-native "^2.0.0" -jest-diff@^25.1.0: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.3.0.tgz#0d7d6f5d6171e5dacde9e05be47b3615e147c26f" - integrity sha512-vyvs6RPoVdiwARwY4kqFWd4PirPLm2dmmkNzKqo38uZOzJvLee87yzDjIZLmY1SjM3XR5DwsUH+cdQ12vgqi1w== - dependencies: - chalk "^3.0.0" - diff-sequences "^25.2.6" - jest-get-type "^25.2.6" - pretty-format "^25.3.0" - -jest-diff@^25.4.0: +jest-diff@^25.1.0, jest-diff@^25.4.0: version "25.4.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.4.0.tgz#260b70f19a46c283adcad7f081cae71eb784a634" integrity sha512-kklLbJVXW0y8UKOWOdYhI6TH5MG6QAxrWiBMgQaPIuhj3dNFGirKCd+/xfplBXICQ7fI+3QcqHm9p9lWu1N6ug== @@ -5454,7 +5444,7 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -pretty-format@^25.1.0, pretty-format@^25.3.0, pretty-format@^25.4.0: +pretty-format@^25.1.0, pretty-format@^25.4.0: version "25.4.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.4.0.tgz#c58801bb5c4926ff4a677fe43f9b8b99812c7830" integrity sha512-PI/2dpGjXK5HyXexLPZU/jw5T9Q6S1YVXxxVxco+LIqzUFHXIbKZKdUVt7GcX7QUCr31+3fzhi4gN4/wUYPVxQ== From 3f9e6d5ec6df3385eabbcc1cb7730b8b949c68de Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Sat, 21 Mar 2020 14:01:38 +0100 Subject: [PATCH 21/30] move tooling into separate repo, add type generation and test types --- .prettierignore | 2 + .prettierrc.js | 7 + declarations.d.ts | 5 + declarations/WebpackOptions.d.ts | 23 +- generate-types-config.js | 5 + lib/DefinePlugin.js | 4 +- lib/cli.js | 8 +- lib/config/defaults.js | 8 +- lib/dependencies/AMDPlugin.js | 2 +- lib/index.js | 476 +- lib/util/fs.js | 4 +- package.json | 21 +- schemas/WebpackOptions.json | 64 +- test/Dependencies.lint.js | 27 - test/Schemas.lint.js | 209 - .../custom-condition/webpack.config.js | 2 +- .../order-multiple-entries/webpack.config.js | 4 +- .../localization/webpack.config.js | 2 +- .../webpack.config.js | 2 +- .../remove-export/webpack.config.js | 2 +- .../depend-on-advanced/webpack.config.js | 8 + .../entry/depend-on-simple/webpack.config.js | 6 + .../finish-modules/simple/webpack.config.js | 3 + .../optimization/minimizer/webpack.config.js | 7 + .../library/webpack.config.js | 1 + .../wasm/identical/webpack.config.js | 28 +- tooling/compile-to-definitions.js | 142 - tooling/format-file-header.js | 212 - tooling/format-schemas.js | 174 - tooling/inherit-types.js | 176 - tooling/type-coverage.js | 132 - tooling/typescript-program.js | 17 - tsconfig.test.json | 16 + tsconfig.types.json | 16 + types.d.ts | 9627 +++++++++++++++++ yarn.lock | 46 +- 36 files changed, 10154 insertions(+), 1334 deletions(-) create mode 100644 generate-types-config.js delete mode 100644 test/Dependencies.lint.js delete mode 100644 test/Schemas.lint.js delete mode 100644 tooling/compile-to-definitions.js delete mode 100644 tooling/format-file-header.js delete mode 100644 tooling/format-schemas.js delete mode 100644 tooling/inherit-types.js delete mode 100644 tooling/type-coverage.js delete mode 100644 tooling/typescript-program.js create mode 100644 tsconfig.test.json create mode 100644 tsconfig.types.json create mode 100644 types.d.ts diff --git a/.prettierignore b/.prettierignore index decfb8994..dceadd34a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,5 @@ +package.json + # Ignore test fixtures test/*.* !test/*.js diff --git a/.prettierrc.js b/.prettierrc.js index 9e0d1ed1e..2ddbbf13d 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -8,8 +8,15 @@ module.exports = { { files: "*.json", options: { + parser: "json", useTabs: false } + }, + { + files: "*.ts", + options: { + parser: "typescript" + } } ] }; diff --git a/declarations.d.ts b/declarations.d.ts index 09759d094..6365e70d5 100644 --- a/declarations.d.ts +++ b/declarations.d.ts @@ -385,3 +385,8 @@ declare module "enhanced-resolve" { } type TODO = any; + +type RecursiveArrayOrRecord = + | { [index: string]: RecursiveArrayOrRecord } + | Array> + | T; diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 88059862b..ee4bfdd40 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -19,11 +19,14 @@ export type Bail = boolean; /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ -export type Cache = true | CacheNormalized; +export type CacheOptions = true | CacheOptionsNormalized; /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ -export type CacheNormalized = false | MemoryCacheOptions | FileCacheOptions; +export type CacheOptionsNormalized = + | false + | MemoryCacheOptions + | FileCacheOptions; /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. */ @@ -489,7 +492,7 @@ export type ResolveLoader = ResolveOptions; /** * Stats options object or preset name. */ -export type Stats = +export type StatsValue = | ( | "none" | "errors-only" @@ -555,7 +558,7 @@ export interface WebpackOptions { /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ - cache?: Cache; + cache?: CacheOptions; /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. */ @@ -603,7 +606,7 @@ export interface WebpackOptions { /** * Options affecting the normal modules (`NormalModuleFactory`). */ - module?: Module; + module?: ModuleOptions; /** * Name of the configuration. Used when loading multiple configurations. */ @@ -659,7 +662,7 @@ export interface WebpackOptions { /** * Stats options object or preset name. */ - stats?: Stats; + stats?: StatsValue; /** * Environment to build for. */ @@ -906,7 +909,7 @@ export interface Loader { /** * Options affecting the normal modules (`NormalModuleFactory`). */ -export interface Module { +export interface ModuleOptions { /** * An array of rules applied by default for modules. */ @@ -2096,7 +2099,7 @@ export interface WebpackOptionsNormalized { /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ - cache: CacheNormalized; + cache: CacheOptionsNormalized; /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. */ @@ -2144,7 +2147,7 @@ export interface WebpackOptionsNormalized { /** * Options affecting the normal modules (`NormalModuleFactory`). */ - module: Module; + module: ModuleOptions; /** * Name of the configuration. Used when loading multiple configurations. */ @@ -2196,7 +2199,7 @@ export interface WebpackOptionsNormalized { /** * Stats options object or preset name. */ - stats: Stats; + stats: StatsValue; /** * Environment to build for. */ diff --git a/generate-types-config.js b/generate-types-config.js new file mode 100644 index 000000000..2af0bdcbf --- /dev/null +++ b/generate-types-config.js @@ -0,0 +1,5 @@ +module.exports = { + nameMapping: { + FsStats: /^Stats Import fs/ + } +}; diff --git a/lib/DefinePlugin.js b/lib/DefinePlugin.js index caaff2b08..2572a21c1 100644 --- a/lib/DefinePlugin.js +++ b/lib/DefinePlugin.js @@ -16,8 +16,8 @@ const { /** @typedef {import("./Compiler")} Compiler */ /** @typedef {import("./javascript/JavascriptParser")} JavascriptParser */ -/** @typedef {null|undefined|RegExp|Function|string|number} CodeValuePrimitive */ -/** @typedef {CodeValuePrimitive|Record|RuntimeValue} CodeValue */ +/** @typedef {null|undefined|RegExp|Function|string|number|boolean|bigint|undefined} CodeValuePrimitive */ +/** @typedef {RecursiveArrayOrRecord} CodeValue */ class RuntimeValue { constructor(fn, fileDependencies) { diff --git a/lib/cli.js b/lib/cli.js index f3ad360ea..0fc9ae5af 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -15,9 +15,11 @@ const webpackSchema = require("../schemas/WebpackOptions.json"); * @property {string} path the path in the config */ +/** @typedef {"unknown-argument" | "unexpected-non-array-in-path" | "unexpected-non-object-in-path" | "multiple-values-unexpected" | "invalid-value"} ProblemType */ + /** * @typedef {Object} Problem - * @property {string} type + * @property {ProblemType} type * @property {string} path * @property {string} argument * @property {any=} value @@ -27,7 +29,7 @@ const webpackSchema = require("../schemas/WebpackOptions.json"); /** * @typedef {Object} LocalProblem - * @property {string} type + * @property {ProblemType} type * @property {string} path * @property {string=} expected */ @@ -563,7 +565,7 @@ const parseValueForArgumentConfig = (argConfig, value) => { /** * @param {Record} args object of arguments * @param {any} config configuration - * @param {Record} values object with values + * @param {Record} values object with values * @returns {Problem[] | null} problems or null for success */ const processArguments = (args, config, values) => { diff --git a/lib/config/defaults.js b/lib/config/defaults.js index 60703ad72..14fb73ab4 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -8,13 +8,13 @@ const path = require("path"); const Template = require("../Template"); -/** @typedef {import("../../declarations/WebpackOptions").CacheNormalized} WebpackCache */ +/** @typedef {import("../../declarations/WebpackOptions").CacheOptionsNormalized} CacheOptions */ /** @typedef {import("../../declarations/WebpackOptions").Experiments} Experiments */ /** @typedef {import("../../declarations/WebpackOptions").InfrastructureLogging} InfrastructureLogging */ /** @typedef {import("../../declarations/WebpackOptions").Library} Library */ /** @typedef {import("../../declarations/WebpackOptions").LibraryName} LibraryName */ /** @typedef {import("../../declarations/WebpackOptions").LibraryOptions} LibraryOptions */ -/** @typedef {import("../../declarations/WebpackOptions").Module} WebpackModule */ +/** @typedef {import("../../declarations/WebpackOptions").ModuleOptions} ModuleOptions */ /** @typedef {import("../../declarations/WebpackOptions").Node} WebpackNode */ /** @typedef {import("../../declarations/WebpackOptions").Optimization} Optimization */ /** @typedef {import("../../declarations/WebpackOptions").Output} Output */ @@ -178,7 +178,7 @@ const applyExperimentsDefaults = experiments => { }; /** - * @param {WebpackCache} cache options + * @param {CacheOptions} cache options * @param {Object} options options * @param {string} options.name name * @param {string} options.mode mode @@ -256,7 +256,7 @@ const applyCacheDefaults = (cache, { name, mode }) => { }; /** - * @param {WebpackModule} module options + * @param {ModuleOptions} module options * @param {Object} options options * @param {boolean} options.cache is caching enabled * @param {boolean} options.mjs is mjs enabled diff --git a/lib/dependencies/AMDPlugin.js b/lib/dependencies/AMDPlugin.js index 6d2dec9a4..4d6952b42 100644 --- a/lib/dependencies/AMDPlugin.js +++ b/lib/dependencies/AMDPlugin.js @@ -28,7 +28,7 @@ const ConstDependency = require("./ConstDependency"); const LocalModuleDependency = require("./LocalModuleDependency"); const UnsupportedDependency = require("./UnsupportedDependency"); -/** @typedef {import("../../declarations/WebpackOptions").Module} ModuleOptions */ +/** @typedef {import("../../declarations/WebpackOptions").ModuleOptions} ModuleOptions */ /** @typedef {import("../Compiler")} Compiler */ class AMDPlugin { diff --git a/lib/index.js b/lib/index.js index f6a3e65a1..9185a72b6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -14,163 +14,327 @@ const memorize = require("./util/memorize"); const validateSchema = require("./validateSchema"); const webpack = require("./webpack"); -module.exports = webpack; -module.exports.WebpackOptionsApply = WebpackOptionsApply; -module.exports.validate = validateSchema.bind(null, webpackOptionsSchema); -module.exports.validateSchema = validateSchema; -module.exports.version = version; +/** @typedef {import("../declarations/WebpackOptions").WebpackOptions} Configuration */ -const exportPlugins = (obj, mappings) => { - for (const name of Object.keys(mappings)) { - Object.defineProperty(obj, name, { - configurable: false, - enumerable: true, - get: memorize(mappings[name]) - }); +module.exports = Object.assign(webpack, { + webpack, + WebpackOptionsApply, + validate: validateSchema.bind(null, webpackOptionsSchema), + validateSchema, + version, + + get cli() { + return require("./cli"); + }, + get AutomaticPrefetchPlugin() { + return require("./AutomaticPrefetchPlugin"); + }, + get BannerPlugin() { + return require("./BannerPlugin"); + }, + get Cache() { + return require("./Cache"); + }, + get Compilation() { + return require("./Compilation"); + }, + get Compiler() { + return require("./Compiler"); + }, + get ContextExclusionPlugin() { + return require("./ContextExclusionPlugin"); + }, + get ContextReplacementPlugin() { + return require("./ContextReplacementPlugin"); + }, + get DefinePlugin() { + return require("./DefinePlugin"); + }, + get DelegatedPlugin() { + return require("./DelegatedPlugin"); + }, + get Dependency() { + return require("./Dependency"); + }, + get DllPlugin() { + return require("./DllPlugin"); + }, + get DllReferencePlugin() { + return require("./DllReferencePlugin"); + }, + get EntryPlugin() { + return require("./EntryPlugin"); + }, + get EnvironmentPlugin() { + return require("./EnvironmentPlugin"); + }, + get EvalDevToolModulePlugin() { + return require("./EvalDevToolModulePlugin"); + }, + get EvalSourceMapDevToolPlugin() { + return require("./EvalSourceMapDevToolPlugin"); + }, + get ExternalsPlugin() { + return require("./ExternalsPlugin"); + }, + get Generator() { + return require("./Generator"); + }, + get HotModuleReplacementPlugin() { + return require("./HotModuleReplacementPlugin"); + }, + get IgnorePlugin() { + return require("./IgnorePlugin"); + }, + get JavascriptModulesPlugin() { + return util.deprecate( + () => require("./javascript/JavascriptModulesPlugin"), + "webpack.JavascriptModulesPlugin has moved to webpack.javascript.JavascriptModulesPlugin", + "DEP_WEBPACK_JAVASCRIPT_MODULES_PLUGIN" + )(); + }, + get LibManifestPlugin() { + return require("./LibManifestPlugin"); + }, + get LibraryTemplatePlugin() { + return util.deprecate( + () => require("./LibraryTemplatePlugin"), + "webpack.LibraryTemplatePlugin is deprecated and has been replaced by compilation.outputOptions.library or compilation.addEntry + passing a library option", + "DEP_WEBPACK_LIBRARY_TEMPLATE_PLUGIN" + )(); + }, + get LoaderOptionsPlugin() { + return require("./LoaderOptionsPlugin"); + }, + get LoaderTargetPlugin() { + return require("./LoaderTargetPlugin"); + }, + get Module() { + return require("./Module"); + }, + get ModuleFilenameHelpers() { + return require("./ModuleFilenameHelpers"); + }, + get NoEmitOnErrorsPlugin() { + return require("./NoEmitOnErrorsPlugin"); + }, + get NormalModule() { + return require("./NormalModule"); + }, + get NormalModuleReplacementPlugin() { + return require("./NormalModuleReplacementPlugin"); + }, + get MultiCompiler() { + return require("./MultiCompiler"); + }, + get Parser() { + return require("./Parser"); + }, + get PrefetchPlugin() { + return require("./PrefetchPlugin"); + }, + get ProgressPlugin() { + return require("./ProgressPlugin"); + }, + get ProvidePlugin() { + return require("./ProvidePlugin"); + }, + get RuntimeGlobals() { + return require("./RuntimeGlobals"); + }, + get RuntimeModule() { + return require("./RuntimeModule"); + }, + get SingleEntryPlugin() { + return util.deprecate( + () => require("./EntryPlugin"), + "SingleEntryPlugin was renamed to EntryPlugin", + "DEP_WEBPACK_SINGLE_ENTRY_PLUGIN" + )(); + }, + get SourceMapDevToolPlugin() { + return require("./SourceMapDevToolPlugin"); + }, + get Stats() { + return require("./Stats"); + }, + get Template() { + return require("./Template"); + }, + get WatchIgnorePlugin() { + return require("./WatchIgnorePlugin"); + }, + get WebpackOptionsDefaulter() { + return util.deprecate( + () => require("./WebpackOptionsDefaulter"), + "webpack.WebpackOptionsDefaulter is deprecated and has been replaced by webpack.config.getNormalizedWebpackOptions and webpack.config.applyWebpackOptionsDefaults", + "DEP_WEBPACK_OPTIONS_DEFAULTER" + )(); + }, + // TODO webpack 6 deprecate + get WebpackOptionsValidationError() { + return validate.ValidationError; + }, + get ValidationError() { + return validate.ValidationError; + }, + + cache: { + get MemoryCachePlugin() { + return require("./cache/MemoryCachePlugin"); + } + }, + + config: { + get getNormalizedWebpackOptions() { + return require("./config/normalization").getNormalizedWebpackOptions; + }, + get applyWebpackOptionsDefaults() { + return require("./config/defaults").applyWebpackOptionsDefaults; + } + }, + + ids: { + get ChunkModuleIdRangePlugin() { + return require("./ids/ChunkModuleIdRangePlugin"); + }, + get NaturalModuleIdsPlugin() { + return require("./ids/NaturalModuleIdsPlugin"); + }, + get OccurrenceModuleIdsPlugin() { + return require("./ids/OccurrenceModuleIdsPlugin"); + }, + get NamedModuleIdsPlugin() { + return require("./ids/NamedModuleIdsPlugin"); + }, + get DeterministicModuleIdsPlugin() { + return require("./ids/DeterministicModuleIdsPlugin"); + }, + get NamedChunkIdsPlugin() { + return require("./ids/NamedChunkIdsPlugin"); + }, + get OccurrenceChunkIdsPlugin() { + return require("./ids/OccurrenceChunkIdsPlugin"); + }, + get HashedModuleIdsPlugin() { + return require("./ids/HashedModuleIdsPlugin"); + } + }, + + javascript: { + get JavascriptModulesPlugin() { + return require("./javascript/JavascriptModulesPlugin"); + } + }, + + optimize: { + get AggressiveMergingPlugin() { + return require("./optimize/AggressiveMergingPlugin"); + }, + get AggressiveSplittingPlugin() { + return util.deprecate( + () => require("./optimize/AggressiveSplittingPlugin"), + "AggressiveSplittingPlugin is deprecated in favor of SplitChunksPlugin", + "DEP_WEBPACK_AGGRESSIVE_SPLITTING_PLUGIN" + )(); + }, + get LimitChunkCountPlugin() { + return require("./optimize/LimitChunkCountPlugin"); + }, + get MinChunkSizePlugin() { + return require("./optimize/MinChunkSizePlugin"); + }, + get ModuleConcatenationPlugin() { + return require("./optimize/ModuleConcatenationPlugin"); + }, + get RuntimeChunkPlugin() { + return require("./optimize/RuntimeChunkPlugin"); + }, + get SideEffectsFlagPlugin() { + return require("./optimize/SideEffectsFlagPlugin"); + }, + get SplitChunksPlugin() { + return require("./optimize/SplitChunksPlugin"); + } + }, + + web: { + get FetchCompileWasmPlugin() { + return require("./web/FetchCompileWasmPlugin"); + }, + get JsonpTemplatePlugin() { + return require("./web/JsonpTemplatePlugin"); + } + }, + + webworker: { + get WebWorkerTemplatePlugin() { + return require("./webworker/WebWorkerTemplatePlugin"); + } + }, + + node: { + get NodeEnvironmentPlugin() { + return require("./node/NodeEnvironmentPlugin"); + }, + get NodeTemplatePlugin() { + return require("./node/NodeTemplatePlugin"); + }, + get ReadFileCompileWasmPlugin() { + return require("./node/ReadFileCompileWasmPlugin"); + } + }, + + wasm: { + get AsyncWebAssemblyModulesPlugin() { + return require("./wasm-async/AsyncWebAssemblyModulesPlugin"); + } + }, + + library: { + get AbstractLibraryPlugin() { + return require("./library/AbstractLibraryPlugin"); + }, + get EnableLibraryPlugin() { + return require("./library/EnableLibraryPlugin"); + } + }, + + debug: { + get ProfilingPlugin() { + return require("./debug/ProfilingPlugin"); + } + }, + + util: { + get createHash() { + return require("./util/createHash"); + }, + get comparators() { + return require("./util/comparators"); + }, + get serialization() { + return require("./util/serialization"); + } } +}); + +const finishExports = obj => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + for (const name of Object.keys(descriptors)) { + const descriptor = descriptors[name]; + if (descriptor.get) { + const fn = descriptor.get; + Object.defineProperty(obj, name, { + configurable: false, + enumerable: true, + get: memorize(fn) + }); + } else if (typeof descriptor.value === "object") { + finishExports(descriptor.value); + } + } + Object.freeze(obj); }; -exportPlugins(module.exports, { - cli: () => require("./cli"), - AutomaticPrefetchPlugin: () => require("./AutomaticPrefetchPlugin"), - BannerPlugin: () => require("./BannerPlugin"), - Cache: () => require("./Cache"), - Compilation: () => require("./Compilation"), - Compiler: () => require("./Compiler"), - ContextExclusionPlugin: () => require("./ContextExclusionPlugin"), - ContextReplacementPlugin: () => require("./ContextReplacementPlugin"), - DefinePlugin: () => require("./DefinePlugin"), - DelegatedPlugin: () => require("./DelegatedPlugin"), - Dependency: () => require("./Dependency"), - DllPlugin: () => require("./DllPlugin"), - DllReferencePlugin: () => require("./DllReferencePlugin"), - EntryPlugin: () => require("./EntryPlugin"), - EnvironmentPlugin: () => require("./EnvironmentPlugin"), - EvalDevToolModulePlugin: () => require("./EvalDevToolModulePlugin"), - EvalSourceMapDevToolPlugin: () => require("./EvalSourceMapDevToolPlugin"), - ExternalsPlugin: () => require("./ExternalsPlugin"), - Generator: () => require("./Generator"), - HotModuleReplacementPlugin: () => require("./HotModuleReplacementPlugin"), - IgnorePlugin: () => require("./IgnorePlugin"), - JavascriptModulesPlugin: util.deprecate( - () => require("./javascript/JavascriptModulesPlugin"), - "webpack.JavascriptModulesPlugin has moved to webpack.javascript.JavascriptModulesPlugin", - "DEP_WEBPACK_JAVASCRIPT_MODULES_PLUGIN" - ), - LibManifestPlugin: () => require("./LibManifestPlugin"), - LibraryTemplatePlugin: util.deprecate( - () => require("./LibraryTemplatePlugin"), - "webpack.LibraryTemplatePlugin is deprecated and has been replaced by compilation.outputOptions.library or compilation.addEntry + passing a library option", - "DEP_WEBPACK_LIBRARY_TEMPLATE_PLUGIN" - ), - LoaderOptionsPlugin: () => require("./LoaderOptionsPlugin"), - LoaderTargetPlugin: () => require("./LoaderTargetPlugin"), - Module: () => require("./Module"), - ModuleFilenameHelpers: () => require("./ModuleFilenameHelpers"), - NoEmitOnErrorsPlugin: () => require("./NoEmitOnErrorsPlugin"), - NormalModule: () => require("./NormalModule"), - NormalModuleReplacementPlugin: () => - require("./NormalModuleReplacementPlugin"), - MultiCompiler: () => require("./MultiCompiler"), - Parser: () => require("./Parser"), - PrefetchPlugin: () => require("./PrefetchPlugin"), - ProgressPlugin: () => require("./ProgressPlugin"), - ProvidePlugin: () => require("./ProvidePlugin"), - RuntimeGlobals: () => require("./RuntimeGlobals"), - RuntimeModule: () => require("./RuntimeModule"), - SingleEntryPlugin: util.deprecate( - () => require("./EntryPlugin"), - "SingleEntryPlugin was renamed to EntryPlugin", - "DEP_WEBPACK_SINGLE_ENTRY_PLUGIN" - ), - SourceMapDevToolPlugin: () => require("./SourceMapDevToolPlugin"), - Stats: () => require("./Stats"), - Template: () => require("./Template"), - WatchIgnorePlugin: () => require("./WatchIgnorePlugin"), - WebpackOptionsDefaulter: util.deprecate( - () => require("./WebpackOptionsDefaulter"), - "webpack.WebpackOptionsDefaulter is deprecated and has been replaced by webpack.config.getNormalizedWebpackOptions and webpack.config.applyWebpackOptionsDefaults", - "DEP_WEBPACK_OPTIONS_DEFAULTER" - ), - // TODO webpack 6 deprecate - WebpackOptionsValidationError: () => validate.ValidationError, - ValidationError: () => validate.ValidationError -}); - -exportPlugins((module.exports.cache = {}), { - MemoryCachePlugin: () => require("./cache/MemoryCachePlugin") -}); - -exportPlugins((module.exports.config = {}), { - getNormalizedWebpackOptions: () => - require("./config/normalization").getNormalizedWebpackOptions, - applyWebpackOptionsDefaults: () => - require("./config/defaults").applyWebpackOptionsDefaults -}); - -exportPlugins((module.exports.ids = {}), { - ChunkModuleIdRangePlugin: () => require("./ids/ChunkModuleIdRangePlugin"), - NaturalModuleIdsPlugin: () => require("./ids/NaturalModuleIdsPlugin"), - OccurrenceModuleIdsPlugin: () => require("./ids/OccurrenceModuleIdsPlugin"), - NamedModuleIdsPlugin: () => require("./ids/NamedModuleIdsPlugin"), - DeterministicModuleIdsPlugin: () => - require("./ids/DeterministicModuleIdsPlugin"), - NamedChunkIdsPlugin: () => require("./ids/NamedChunkIdsPlugin"), - OccurrenceChunkIdsPlugin: () => require("./ids/OccurrenceChunkIdsPlugin"), - HashedModuleIdsPlugin: () => require("./ids/HashedModuleIdsPlugin") -}); - -exportPlugins((module.exports.javascript = {}), { - JavascriptModulesPlugin: () => require("./javascript/JavascriptModulesPlugin") -}); - -exportPlugins((module.exports.optimize = {}), { - AggressiveMergingPlugin: () => require("./optimize/AggressiveMergingPlugin"), - AggressiveSplittingPlugin: util.deprecate( - () => require("./optimize/AggressiveSplittingPlugin"), - "AggressiveSplittingPlugin is deprecated in favor of SplitChunksPlugin", - "DEP_WEBPACK_AGGRESSIVE_SPLITTING_PLUGIN" - ), - LimitChunkCountPlugin: () => require("./optimize/LimitChunkCountPlugin"), - MinChunkSizePlugin: () => require("./optimize/MinChunkSizePlugin"), - ModuleConcatenationPlugin: () => - require("./optimize/ModuleConcatenationPlugin"), - RuntimeChunkPlugin: () => require("./optimize/RuntimeChunkPlugin"), - SideEffectsFlagPlugin: () => require("./optimize/SideEffectsFlagPlugin"), - SplitChunksPlugin: () => require("./optimize/SplitChunksPlugin") -}); - -exportPlugins((module.exports.web = {}), { - FetchCompileWasmPlugin: () => require("./web/FetchCompileWasmPlugin"), - JsonpTemplatePlugin: () => require("./web/JsonpTemplatePlugin") -}); - -exportPlugins((module.exports.webworker = {}), { - WebWorkerTemplatePlugin: () => require("./webworker/WebWorkerTemplatePlugin") -}); - -exportPlugins((module.exports.node = {}), { - NodeEnvironmentPlugin: () => require("./node/NodeEnvironmentPlugin"), - NodeTemplatePlugin: () => require("./node/NodeTemplatePlugin"), - ReadFileCompileWasmPlugin: () => require("./node/ReadFileCompileWasmPlugin") -}); - -exportPlugins((module.exports.wasm = {}), { - AsyncWebAssemblyModulesPlugin: () => - require("./wasm-async/AsyncWebAssemblyModulesPlugin") -}); - -exportPlugins((module.exports.library = {}), { - AbstractLibraryPlugin: () => require("./library/AbstractLibraryPlugin"), - EnableLibraryPlugin: () => require("./library/EnableLibraryPlugin") -}); - -exportPlugins((module.exports.debug = {}), { - ProfilingPlugin: () => require("./debug/ProfilingPlugin") -}); - -exportPlugins((module.exports.util = {}), { - createHash: () => require("./util/createHash"), - comparators: () => require("./util/comparators"), - serialization: () => require("./util/serialization") -}); +finishExports(module.exports); diff --git a/lib/util/fs.js b/lib/util/fs.js index e122d566e..2f944559f 100644 --- a/lib/util/fs.js +++ b/lib/util/fs.js @@ -7,11 +7,13 @@ const path = require("path"); +/** @typedef {import("fs").Stats} NodeFsStats */ + /** @typedef {function(NodeJS.ErrnoException=): void} Callback */ /** @typedef {function(NodeJS.ErrnoException=, Buffer=): void} BufferCallback */ /** @typedef {function(NodeJS.ErrnoException=, string[]=): void} StringArrayCallback */ /** @typedef {function(NodeJS.ErrnoException=, string=): void} StringCallback */ -/** @typedef {function(NodeJS.ErrnoException=, import("fs").Stats=): void} StatsCallback */ +/** @typedef {function(NodeJS.ErrnoException=, NodeFsStats=): void} StatsCallback */ /** * @typedef {Object} OutputFileSystem diff --git a/package.json b/package.json index 6bcb14eeb..abe73b2fb 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "devDependencies": { "@babel/core": "^7.7.2", "@types/estree": "0.0.42", + "@types/jest": "^25.1.5", "@types/node": "^12.6.9", - "@yarnpkg/lockfile": "^1.1.0", "babel-loader": "^8.0.6", "benchmark": "^2.1.1", "bundle-loader": "~0.5.0", @@ -50,14 +50,12 @@ "eslint-plugin-prettier": "^3.1.0", "file-loader": "^4.1.0", "fork-ts-checker-webpack-plugin": "^1.5.0", - "glob": "^7.1.3", "husky": "^4.2.3", "istanbul": "^0.4.5", "jest": "^25.1.0", "jest-diff": "^25.1.0", "jest-junit": "^10.0.0", "json-loader": "^0.5.7", - "json-schema-to-typescript": "^8.1.0", "json5": "^2.1.1", "less": "^3.9.0", "less-loader": "^5.0.0", @@ -81,6 +79,7 @@ "strip-ansi": "^6.0.0", "style-loader": "^1.0.0", "toml": "^3.0.0", + "tooling": "webpack/tooling", "ts-loader": "^6.0.4", "typescript": "^3.6.4", "url-loader": "^2.1.0", @@ -104,13 +103,15 @@ "homepage": "https://github.com/webpack/webpack", "main": "lib/index.js", "bin": "./bin/webpack.js", + "types": "types.d.ts", "files": [ "lib/", "bin/", "declarations/", "hot/", "schemas/", - "SECURITY.md" + "SECURITY.md", + "types.d.ts" ], "scripts": { "setup": "node ./setup/setup.js", @@ -130,25 +131,25 @@ "type-report": "rimraf coverage && yarn cover:types && yarn cover:report && open-cli coverage/lcov-report/index.html", "pretest": "yarn lint", "prelint": "yarn setup", - "lint": "yarn code-lint && yarn jest-lint && yarn type-lint && yarn special-lint && yarn pretty-lint && yarn spellcheck", + "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn pretty-lint && yarn spellcheck", "code-lint": "eslint . --ext '.js' --cache", - "type-lint": "tsc --pretty", + "type-lint": "tsc", + "test:types": "tsc -p tsconfig.test.json", "spellcheck": "cspell \"{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}\" \"*.md\"", - "special-lint": "node tooling/inherit-types && node tooling/format-schemas && node tooling/format-file-header && node tooling/compile-to-definitions", - "special-lint-fix": "node tooling/inherit-types --write --override && node tooling/format-schemas --write && node tooling/format-file-header --write && node tooling/compile-to-definitions --write", + "special-lint": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/generate-types", + "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/generate-types --write", "fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix", "pretty-lint-base": "prettier \"*.{ts,json,yml,yaml,md}\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.json\" \"examples/*.md\"", "pretty-lint-base-all": "yarn pretty-lint-base \"*.js\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.js\" \"test/*.js\" \"test/helpers/*.js\" \"test/{configCases,watchCases,statsCases,hotCases,benchmarkCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"", "pretty-lint-fix": "yarn pretty-lint-base-all --loglevel warn --write", "pretty-lint": "yarn pretty-lint-base --check", - "jest-lint": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/test/*.lint.js\" --no-verbose", "benchmark": "node --max-old-space-size=4096 --trace-deprecation node_modules/jest-cli/bin/jest --testMatch \"/test/*.benchmark.js\" --runInBand", "cover": "yarn cover:all && yarn cover:report", "cover:all": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --coverage", "cover:basic": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/te{st/TestCasesNormal,st/StatsTestCases,st/ConfigTestCases}.test.js\" --coverage", "cover:integration": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/test/*.test.js\" --coverage", "cover:unit": "node --max-old-space-size=4096 node_modules/jest-cli/bin/jest --testMatch \"/test/*.unittest.js\" --coverage", - "cover:types": "node tooling/type-coverage.js", + "cover:types": "node node_modules/tooling/type-coverage", "cover:report": "istanbul report" }, "husky": { diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 50084948f..9f6dfcb0d 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -42,7 +42,7 @@ "description": "Report the first error as a hard error instead of tolerating it.", "type": "boolean" }, - "Cache": { + "CacheOptions": { "description": "Cache generated modules and chunks to improve performance for multiple incremental builds.", "anyOf": [ { @@ -50,11 +50,11 @@ "enum": [true] }, { - "$ref": "#/definitions/CacheNormalized" + "$ref": "#/definitions/CacheOptionsNormalized" } ] }, - "CacheNormalized": { + "CacheOptionsNormalized": { "description": "Cache generated modules and chunks to improve performance for multiple incremental builds.", "anyOf": [ { @@ -878,7 +878,7 @@ "description": "Enable production optimizations or development hints.", "enum": ["development", "production", "none"] }, - "Module": { + "ModuleOptions": { "description": "Options affecting the normal modules (`NormalModuleFactory`).", "type": "object", "additionalProperties": false, @@ -2626,28 +2626,6 @@ "description": "Prefixes every line of the source in the bundle with this string.", "type": "string" }, - "Stats": { - "description": "Stats options object or preset name.", - "anyOf": [ - { - "enum": [ - "none", - "errors-only", - "minimal", - "normal", - "detailed", - "verbose", - "errors-warnings" - ] - }, - { - "type": "boolean" - }, - { - "$ref": "#/definitions/StatsOptions" - } - ] - }, "StatsOptions": { "description": "Stats options object.", "type": "object", @@ -2944,6 +2922,28 @@ } } }, + "StatsValue": { + "description": "Stats options object or preset name.", + "anyOf": [ + { + "enum": [ + "none", + "errors-only", + "minimal", + "normal", + "detailed", + "verbose", + "errors-warnings" + ] + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/StatsOptions" + } + ] + }, "StrictModuleExceptionHandling": { "description": "Handles exceptions in module loading correctly at a performance cost.", "type": "boolean" @@ -3045,7 +3045,7 @@ "$ref": "#/definitions/Bail" }, "cache": { - "$ref": "#/definitions/CacheNormalized" + "$ref": "#/definitions/CacheOptionsNormalized" }, "context": { "$ref": "#/definitions/Context" @@ -3081,7 +3081,7 @@ "$ref": "#/definitions/Mode" }, "module": { - "$ref": "#/definitions/Module" + "$ref": "#/definitions/ModuleOptions" }, "name": { "$ref": "#/definitions/Name" @@ -3120,7 +3120,7 @@ "$ref": "#/definitions/ResolveLoader" }, "stats": { - "$ref": "#/definitions/Stats" + "$ref": "#/definitions/StatsValue" }, "target": { "$ref": "#/definitions/Target" @@ -3179,7 +3179,7 @@ "$ref": "#/definitions/Bail" }, "cache": { - "$ref": "#/definitions/Cache" + "$ref": "#/definitions/CacheOptions" }, "context": { "$ref": "#/definitions/Context" @@ -3215,7 +3215,7 @@ "$ref": "#/definitions/Mode" }, "module": { - "$ref": "#/definitions/Module" + "$ref": "#/definitions/ModuleOptions" }, "name": { "$ref": "#/definitions/Name" @@ -3257,7 +3257,7 @@ "$ref": "#/definitions/ResolveLoader" }, "stats": { - "$ref": "#/definitions/Stats" + "$ref": "#/definitions/StatsValue" }, "target": { "$ref": "#/definitions/Target" diff --git a/test/Dependencies.lint.js b/test/Dependencies.lint.js deleted file mode 100644 index 4723a8d00..000000000 --- a/test/Dependencies.lint.js +++ /dev/null @@ -1,27 +0,0 @@ -const fs = require("graceful-fs"); -const path = require("path"); -const lockfile = require("@yarnpkg/lockfile"); - -const file = fs.readFileSync(path.resolve(__dirname, "../yarn.lock"), "utf-8"); -const result = lockfile.parse(file); - -describe("Dependencies", () => { - it("should parse fine", () => { - expect(result.type).toBe("success"); - }); - - if (result.type === "success") { - const content = result.object; - for (const dep of Object.keys(content)) { - describe(dep, () => { - const info = content[dep]; - it("should resolve to an npm package", () => { - expect(info.resolved).toMatch(/^https:\/\/registry\.yarnpkg\.com\//); - }); - it("should have an integrity hash", () => { - expect(info.integrity).toMatch(/^(sha1|sha512)-/); - }); - }); - } - } -}); diff --git a/test/Schemas.lint.js b/test/Schemas.lint.js deleted file mode 100644 index ad5aed119..000000000 --- a/test/Schemas.lint.js +++ /dev/null @@ -1,209 +0,0 @@ -"use strict"; - -const fs = require("graceful-fs"); -const path = require("path"); -const glob = require("glob"); -const rootDir = path.resolve(__dirname, ".."); - -describe("Schemas", () => { - const schemas = glob.sync("schemas/**/*.json", { - cwd: rootDir - }); - - schemas.forEach(filename => { - describe(filename, () => { - let content; - let fileContent; - let errorWhileParsing; - - try { - fileContent = fs.readFileSync(path.resolve(rootDir, filename), "utf-8"); - content = JSON.parse(fileContent); - } catch (e) { - errorWhileParsing = e; - } - - it("should be parse-able", () => { - if (errorWhileParsing) throw errorWhileParsing; - }); - - if (content) { - const arrayProperties = ["oneOf", "anyOf", "allOf"]; - const allowedProperties = [ - "definitions", - "$ref", - "$id", - "title", - "cli", - "items", - "properties", - "additionalProperties", - "type", - "oneOf", - "anyOf", - "absolutePath", - "description", - "enum", - "minLength", - "pattern", - "minimum", - "maximum", - "required", - "uniqueItems", - "minItems", - "minProperties", - "instanceof", - "tsType", - "not" - ]; - - const isReference = schema => { - return ( - "$ref" in schema || - ("oneOf" in schema && - schema.oneOf.length === 1 && - "$ref" in schema.oneOf[0]) - ); - }; - - const validateProperty = property => { - if (isReference(property)) return; - it("should have description set", () => { - expect(typeof property.description).toBe("string"); - expect(property.description.length).toBeGreaterThan(1); - expect(property.description).toMatch(/^[A-Z`]/); - expect(property.description).toEndWith("."); - expect(property.description).not.toEndWith(".."); - }); - }; - - const walker = item => { - it("should only use allowed schema properties", () => { - const otherProperties = Object.keys(item).filter( - p => allowedProperties.indexOf(p) < 0 - ); - if (otherProperties.length > 0) { - throw new Error( - `The properties ${otherProperties.join( - ", " - )} are not allowed to use` - ); - // When allowing more properties make sure to add nice error messages for them in WebpackOptionsValidationError - } - }); - - if ("$ref" in item) { - it("should not have other properties next to $ref", () => { - const otherProperties = Object.keys(item).filter( - p => p !== "$ref" - ); - if (otherProperties.length > 0) { - throw new Error( - `When using $ref other properties are not possible (${otherProperties.join( - ", " - )})` - ); - } - }); - } - - if ("type" in item) { - it("should have a single type", () => { - expect(item.type).toBeTypeOf("string"); - }); - } - - if ("instanceof" in item) { - it("should have tsType specified when using instanceof", () => { - if (!("tsType" in item)) { - throw new Error("When using instanceof, tsType is required"); - } - }); - } - - if ("absolutePath" in item) { - it("should have type: 'string' specified when using absolutePath", () => { - if (item.type !== "string") { - throw new Error( - "When using absolutePath, type must be 'string'" - ); - } - }); - } - - if ("properties" in item || "additionalProperties" in item) { - it("should have type: 'object' specified when using properties or additionalProperties", () => { - if (item.type !== "object") { - throw new Error( - "When using properties or additionalProperties, type must be 'object'" - ); - } - }); - } - - arrayProperties.forEach(prop => { - if (prop in item) { - describe(prop, () => { - it("should not double nest array properties", () => { - for (const nestedProp of arrayProperties) { - for (const value of item[prop]) - expect(value).not.toHaveProperty(nestedProp); - } - }); - if (prop === "oneOf") { - it("should have only one item which is a $ref", () => { - expect(item[prop].length).toBe(1); - expect(Object.keys(item[prop][0])).toEqual(["$ref"]); - }); - } else { - it("should have multiple items", () => { - expect(item[prop].length).toBeGreaterThan(1); - }); - } - item[prop].forEach(walker); - }); - } - }); - if ("items" in item) { - describe("items", () => { - validateProperty(item.items); - walker(item.items); - }); - } - if ("definitions" in item) { - Object.keys(item.definitions).forEach(name => { - describe(`#${name}`, () => { - const def = item.definitions[name]; - it("should have description set", () => { - expect(typeof def.description).toBe("string"); - expect(def.description.length).toBeGreaterThan(1); - }); - walker(def); - }); - }); - } - if ("properties" in item) { - it("should have additionalProperties set to some value when describing properties", () => { - expect(item.additionalProperties).toBeDefined(); - }); - Object.keys(item.properties).forEach(name => { - describe(`> '${name}'`, () => { - const property = item.properties[name]; - validateProperty(property); - walker(property); - }); - }); - } - if (typeof item.additionalProperties === "object") { - describe("properties", () => { - validateProperty(item.additionalProperties); - walker(item.additionalProperties); - }); - } - }; - - walker(content); - } - }); - }); -}); diff --git a/test/configCases/asset-modules/custom-condition/webpack.config.js b/test/configCases/asset-modules/custom-condition/webpack.config.js index 33cb85d7c..58310ed1b 100644 --- a/test/configCases/asset-modules/custom-condition/webpack.config.js +++ b/test/configCases/asset-modules/custom-condition/webpack.config.js @@ -1,5 +1,5 @@ const path = require("path"); -const NormalModule = require("../../../../lib/NormalModule"); +const NormalModule = require("../../../../").NormalModule; module.exports = { mode: "development", diff --git a/test/configCases/chunk-index/order-multiple-entries/webpack.config.js b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js index 625dccf25..b0dc1d869 100644 --- a/test/configCases/chunk-index/order-multiple-entries/webpack.config.js +++ b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js @@ -1,5 +1,5 @@ -/** @typedef {import("../../../../lib/Compilation")} Compilation */ -/** @typedef {import("../../../../lib/Module")} Module */ +/** @typedef {import("../../../../").Compilation} Compilation */ +/** @typedef {import("../../../../").Module} Module */ module.exports = { entry: { diff --git a/test/configCases/custom-source-type/localization/webpack.config.js b/test/configCases/custom-source-type/localization/webpack.config.js index b853c09f7..cc2718da7 100644 --- a/test/configCases/custom-source-type/localization/webpack.config.js +++ b/test/configCases/custom-source-type/localization/webpack.config.js @@ -5,7 +5,7 @@ const RuntimeGlobals = require("../../../../").RuntimeGlobals; const Parser = require("../../../../").Parser; const webpack = require("../../../../"); -/** @typedef {import("../../../../lib/Compiler")} Compiler */ +/** @typedef {import("../../../../").Compiler} Compiler */ class LocalizationParser extends Parser { parse(source, { module }) { diff --git a/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js b/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js index 59c95f6e3..7255f049c 100644 --- a/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js +++ b/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js @@ -1,4 +1,4 @@ -/** @typedef {import("../../../../lib/Compilation")} Compilation */ +/** @typedef {import("../../../../").Compilation} Compilation */ module.exports = { optimization: { diff --git a/test/configCases/deep-scope-analysis/remove-export/webpack.config.js b/test/configCases/deep-scope-analysis/remove-export/webpack.config.js index 973fbcdc6..b47212d58 100644 --- a/test/configCases/deep-scope-analysis/remove-export/webpack.config.js +++ b/test/configCases/deep-scope-analysis/remove-export/webpack.config.js @@ -1,4 +1,4 @@ -/** @typedef {import("../../../../lib/Compilation")} Compilation */ +/** @typedef {import("../../../../").Compilation} Compilation */ module.exports = { optimization: { diff --git a/test/configCases/entry/depend-on-advanced/webpack.config.js b/test/configCases/entry/depend-on-advanced/webpack.config.js index 6f304e92c..ac0c0bdca 100644 --- a/test/configCases/entry/depend-on-advanced/webpack.config.js +++ b/test/configCases/entry/depend-on-advanced/webpack.config.js @@ -1,3 +1,8 @@ +/** @typedef {import("../../../../").Compiler} Compiler */ +/** @typedef {import("../../../../").Compilation} Compilation */ +/** @typedef {import("../../../../").Configuration} Configuration */ + +/** @type {Configuration} */ module.exports = { entry() { return Promise.resolve({ @@ -15,6 +20,9 @@ module.exports = { filename: "[name].js" }, plugins: [ + /** + * @this {Compiler} compiler + */ function () { /** * @param {Compilation} compilation compilation diff --git a/test/configCases/entry/depend-on-simple/webpack.config.js b/test/configCases/entry/depend-on-simple/webpack.config.js index 81a62c28c..ba29edb8e 100644 --- a/test/configCases/entry/depend-on-simple/webpack.config.js +++ b/test/configCases/entry/depend-on-simple/webpack.config.js @@ -1,3 +1,6 @@ +/** @typedef {import("../../../../").Compiler} Compiler */ +/** @typedef {import("../../../../").Compilation} Compilation */ + module.exports = { entry: { app: { import: "./app.js", dependOn: "react-vendors" }, @@ -8,6 +11,9 @@ module.exports = { filename: "[name].js" }, plugins: [ + /** + * @this {Compiler} compiler + */ function () { /** * @param {Compilation} compilation compilation diff --git a/test/configCases/finish-modules/simple/webpack.config.js b/test/configCases/finish-modules/simple/webpack.config.js index 1da810870..c0a1e91e6 100644 --- a/test/configCases/finish-modules/simple/webpack.config.js +++ b/test/configCases/finish-modules/simple/webpack.config.js @@ -1,3 +1,6 @@ +/** + * @this {import("../../../../").Compiler} the compiler + */ var testPlugin = function () { this.hooks.compilation.tap("TestPlugin", compilation => { compilation.hooks.finishModules.tapAsync("TestPlugin", function ( diff --git a/test/configCases/optimization/minimizer/webpack.config.js b/test/configCases/optimization/minimizer/webpack.config.js index 100986ba0..06ee86158 100644 --- a/test/configCases/optimization/minimizer/webpack.config.js +++ b/test/configCases/optimization/minimizer/webpack.config.js @@ -5,10 +5,17 @@ module.exports = { minimize: true, minimizer: [ { + /** + * @param {Compiler} compiler the compiler + */ apply(compiler) { expect(compiler).toBeInstanceOf(Compiler); } }, + /** + * @this {Compiler} the compiler + * @param {Compiler} compiler the compiler + */ function (compiler) { expect(compiler).toBe(this); expect(compiler).toBeInstanceOf(Compiler); diff --git a/test/configCases/split-chunks-common/library/webpack.config.js b/test/configCases/split-chunks-common/library/webpack.config.js index 56df641cf..74eda62c3 100644 --- a/test/configCases/split-chunks-common/library/webpack.config.js +++ b/test/configCases/split-chunks-common/library/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["external0", "./a"], diff --git a/test/configCases/wasm/identical/webpack.config.js b/test/configCases/wasm/identical/webpack.config.js index 3901206b1..614dd5574 100644 --- a/test/configCases/wasm/identical/webpack.config.js +++ b/test/configCases/wasm/identical/webpack.config.js @@ -1,7 +1,7 @@ const { CachedSource } = require("webpack-sources"); const { AsyncWebAssemblyModulesPlugin } = require("../../../../").wasm; -/** @typedef {import("../../../../lib/Compilation")} Compilation */ +/** @typedef {import("../../../../").Compiler} Compiler */ module.exports = { module: { @@ -18,22 +18,18 @@ module.exports = { importAwait: true }, plugins: [ + /** + * @this {Compiler} compiler + */ function () { - this.hooks.compilation.tap( - "Test", - /** - * @param {Compilation} compilation Compilation - * @returns {void} - */ - compilation => { - AsyncWebAssemblyModulesPlugin.getCompilationHooks( - compilation - ).renderModuleContent.tap("Test", source => { - // this is important to make each returned value a new instance - return new CachedSource(source); - }); - } - ); + this.hooks.compilation.tap("Test", compilation => { + AsyncWebAssemblyModulesPlugin.getCompilationHooks( + compilation + ).renderModuleContent.tap("Test", source => { + // this is important to make each returned value a new instance + return new CachedSource(source); + }); + }); } ] }; diff --git a/tooling/compile-to-definitions.js b/tooling/compile-to-definitions.js deleted file mode 100644 index 7b67ea495..000000000 --- a/tooling/compile-to-definitions.js +++ /dev/null @@ -1,142 +0,0 @@ -const fs = require("fs"); -const path = require("path"); -const prettierrc = require("../.prettierrc.js"); // eslint-disable-line -const { compile } = require("json-schema-to-typescript"); - -const schemasDir = path.resolve(__dirname, "../schemas"); -const style = { - printWidth: prettierrc.printWidth, - useTabs: prettierrc.useTabs, - tabWidth: prettierrc.tabWidth -}; - -// When --write is set, files will be written in place -// Otherwise it only prints outdated files -const doWrite = process.argv.includes("--write"); - -const makeSchemas = () => { - // include the top level folder "./schemas" by default - const dirs = new Set([schemasDir]); - - // search for all nestedDirs inside of this folder - for (let dirWithSchemas of dirs) { - for (let item of fs.readdirSync(dirWithSchemas)) { - const absPath = path.resolve(dirWithSchemas, item); - if (fs.statSync(absPath).isDirectory()) { - dirs.add(absPath); - } else if (item.endsWith(".json")) { - makeDefinitionsForSchema(absPath); - } - } - } -}; - -const makeDefinitionsForSchema = absSchemaPath => { - const relPath = path - .relative(schemasDir, absSchemaPath) - .replace(/\.json$/i, ""); - const basename = path.basename(relPath); - const filename = path.resolve(__dirname, `../declarations/${relPath}.d.ts`); - const schema = JSON.parse(fs.readFileSync(absSchemaPath, "utf-8")); - preprocessSchema(schema); - compile(schema, basename, { - bannerComment: - "/**\n * This file was automatically generated.\n * DO NOT MODIFY BY HAND.\n * Run `yarn special-lint-fix` to update\n */", - unreachableDefinitions: true, - style - }).then( - ts => { - ts = ts.replace( - /\s+\*\s+\* This interface was referenced by `.+`'s JSON-Schema\s+\* via the `definition` ".+"\./g, - "" - ); - let normalizedContent = ""; - try { - const content = fs.readFileSync(filename, "utf-8"); - normalizedContent = content.replace(/\r\n?/g, "\n"); - } catch (e) { - // ignore - } - if (normalizedContent.trim() !== ts.trim()) { - if (doWrite) { - fs.mkdirSync(path.dirname(filename), { recursive: true }); - fs.writeFileSync(filename, ts, "utf-8"); - console.error( - `declarations/${relPath.replace(/\\/g, "/")}.d.ts updated` - ); - } else { - console.error( - `declarations/${relPath.replace( - /\\/g, - "/" - )}.d.ts need to be updated` - ); - process.exitCode = 1; - } - } - }, - err => { - console.error(err); - process.exitCode = 1; - } - ); -}; - -const resolvePath = (root, ref) => { - const parts = ref.split("/"); - if (parts[0] !== "#") throw new Error("Unexpected ref"); - let current = root; - for (const p of parts.slice(1)) { - current = current[p]; - } - return current; -}; - -const preprocessSchema = (schema, root = schema) => { - if ("definitions" in schema) { - for (const key of Object.keys(schema.definitions)) { - preprocessSchema(schema.definitions[key], root); - } - } - if ("properties" in schema) { - for (const key of Object.keys(schema.properties)) { - const property = schema.properties[key]; - if ("$ref" in property) { - const result = resolvePath(root, property.$ref); - schema.properties[key] = { - description: result.description, - anyOf: [property] - }; - } else if ( - "oneOf" in property && - property.oneOf.length === 1 && - "$ref" in property.oneOf[0] - ) { - const result = resolvePath(root, property.oneOf[0].$ref); - schema.properties[key] = { - description: property.description || result.description, - anyOf: property.oneOf - }; - preprocessSchema(schema.properties[key], root); - } else { - preprocessSchema(property, root); - } - } - } - if ("items" in schema) { - preprocessSchema(schema.items, root); - } - if (typeof schema.additionalProperties === "object") { - preprocessSchema(schema.additionalProperties, root); - } - const arrayProperties = ["oneOf", "anyOf", "allOf"]; - for (const prop of arrayProperties) { - if (Array.isArray(schema[prop])) { - for (const item of schema[prop]) { - preprocessSchema(item, root); - } - } - } -}; - -makeSchemas(); diff --git a/tooling/format-file-header.js b/tooling/format-file-header.js deleted file mode 100644 index 2a799f51c..000000000 --- a/tooling/format-file-header.js +++ /dev/null @@ -1,212 +0,0 @@ -const path = require("path"); -const fs = require("fs"); - -// When --write is set, files will be written in place -// Otherwise it only prints outdated files -const doWrite = process.argv.includes("--write"); - -const allFiles = new Set(); -const findFiles = p => { - const s = fs.statSync(p); - if (s.isDirectory()) { - for (const name of fs.readdirSync(p)) { - if (name.startsWith(".")) continue; - findFiles(path.join(p, name)); - } - } else if (s.isFile()) { - allFiles.add(p); - } -}; -findFiles(path.resolve(__dirname, "../lib")); - -let canUpdateWithWrite = false; - -const sortImport = (a, b) => { - if (!a.key.startsWith(".") && b.key.startsWith(".")) return -1; - if (a.key.startsWith(".") && !b.key.startsWith(".")) return 1; - if (a.key < b.key) return -1; - if (a.key > b.key) return 1; - return 0; -}; - -const execToArray = (content, regexp) => { - const items = []; - let match = regexp.exec(content); - while (match) { - items.push({ - content: match[0], - key: match[1] + match[2] - }); - match = regexp.exec(content); - } - return items; -}; - -const schema = [ - { - title: "license comment", - regexp: /\/\*\n\s*MIT License http:\/\/www\.opensource\.org\/licenses\/mit-license\.php\n\s*(?:(Authors? .+)\n)?\s*\*\/\n/g, - updateMessage: "update the license comment", - update(content, author) { - return ( - [ - "/*", - "\tMIT License http://www.opensource.org/licenses/mit-license.php", - author && `\t${author}`, - "*/" - ] - .filter(Boolean) - .join("\n") + "\n" - ); - } - }, - { - title: "new line after license comment", - regexp: /\n?/g, - updateMessage: "insert a new line after the license comment", - update() { - return "\n"; - } - }, - { - title: "strict mode", - regexp: /"use strict";\n/g - }, - { - title: "new line after strict mode", - regexp: /\n?/g, - updateMessage: 'insert a new line after "use strict"', - update() { - return "\n"; - } - }, - { - title: "imports", - regexp: /(const (\{\s+\w+(?::\s+\w+)?(,\s+\w+(?::\s+\w+)?)*\s+\}|\w+) = (\/\*\* @type \{TODO\} \*\/\s\()?require\("[^"]+"\)\)?(\.\w+)*;\n)+\n/g, - updateMessage: "sort imports alphabetically", - update(content) { - const items = execToArray( - content, - /const (?:\{\s+\w+(?::\s+\w+)?(?:,\s+\w+(?::\s+\w+)?)*\s+\}|\w+) = (?:\/\*\* @type \{TODO\} \*\/\s\()?require\("([^"]+)"\)\)?((?:\.\w+)*);\n/g - ); - items.sort(sortImport); - return items.map(item => item.content).join("") + "\n"; - }, - optional: true, - repeat: true - }, - { - title: "type imports", - regexp: /(\/\*\* (?:@template \w+ )*@typedef \{import\("[^"]+"\)(\.\w+)*(?:<(?:(?:\w\.)*\w+, )*(?:\w\.)*\w+>)?\} \w+(?:<(?:(?:\w\.)*\w+, )*(?:\w\.)*\w+>)? \*\/\n)+\n/g, - updateMessage: "sort type imports alphabetically", - update(content) { - const items = execToArray( - content, - /\/\*\* (?:@template \w+ )*@typedef \{import\("([^"]+)"\)((?:\.\w+)*(?:<(?:(?:\w\.)*\w+, )*(?:\w\.)*\w+>)?)\} \w+(?:<(?:(?:\w\.)*\w+, )*(?:\w\.)*\w+>)? \*\/\n/g - ); - items.sort(sortImport); - return items.map(item => item.content).join("") + "\n"; - }, - optional: true, - repeat: true - } -]; - -const allSerializables = new Set(); - -for (const filePath of allFiles) { - let content = fs.readFileSync(filePath, "utf-8"); - const nl = /(\r?\n)/.exec(content); - content = content.replace(/\r?\n/g, "\n"); - let newContent = content; - - let state = 0; - let pos = 0; - // eslint-disable-next-line no-constant-condition - while (true) { - const current = schema[state]; - if (!current) break; - current.regexp.lastIndex = pos; - const match = current.regexp.exec(newContent); - if (!match) { - if (current.optional) { - state++; - continue; - } - console.log(`${filePath}: Missing ${current.title} at ${pos}`); - process.exitCode = 1; - break; - } - if (match.index !== pos) { - console.log( - `${filePath}: Unexpected code at ${pos}-${match.index}, expected ${current.title}` - ); - process.exitCode = 1; - pos = match.index; - } - if (!current.repeat) { - state++; - } - if (current.update) { - const update = current.update(...match); - if (update !== match[0]) { - newContent = - newContent.substr(0, pos) + - update + - newContent.slice(pos + match[0].length); - pos += update.length; - if (!doWrite) { - const updateMessage = - current.updateMessage || `${current.title} need to be updated`; - console.log(`${filePath}: ${updateMessage}`); - } - continue; - } - } - pos += match[0].length; - } - - if (newContent !== content) { - if (doWrite) { - if (nl) { - newContent = newContent.replace(/\n/g, nl[0]); - } - fs.writeFileSync(filePath, newContent, "utf-8"); - console.log(filePath); - } else { - canUpdateWithWrite = true; - process.exitCode = 1; - } - } - - const matches = content.match( - /makeSerializable\(\s*[^,]+,\s*"webpack\/lib\/[^"]+"\s*(?:,[^)]+)?\)/g - ); - if (matches) { - for (const match of matches) { - const str = /makeSerializable\(\s*[^,]+,\s*"webpack\/lib\/([^"]+)"/.exec( - match - )[1]; - allSerializables.add(str); - } - } -} - -// Check if lib/util/internalSerializables.js includes all serializables in webpack -{ - const content = fs.readFileSync( - path.resolve(__dirname, "../lib/util/internalSerializables.js") - ); - for (const serializable of allSerializables) { - if (!content.includes(`"../${serializable}"`)) { - console.log( - `lib/util/internalSerializables.js: must include static require to ../${serializable}` - ); - process.exitCode = 1; - } - } -} - -if (canUpdateWithWrite) { - console.log("Run 'yarn fix' to try to fix the problem automatically"); -} diff --git a/tooling/format-schemas.js b/tooling/format-schemas.js deleted file mode 100644 index 3afe353e8..000000000 --- a/tooling/format-schemas.js +++ /dev/null @@ -1,174 +0,0 @@ -const fs = require("fs"); -const path = require("path"); -const prettier = require("prettier"); - -const schemasDir = path.resolve(__dirname, "../schemas"); - -// When --write is set, files will be written in place -// Otherwise it only prints outdated files -const doWrite = process.argv.includes("--write"); - -const sortObjectAlphabetically = obj => { - const keys = Object.keys(obj).sort(); - const newObj = {}; - for (const key of keys) { - newObj[key] = obj[key]; - } - return newObj; -}; - -const typeOrder = [ - "array", - "enum", - "RegExp", - "number", - "boolean", - "string", - "object", - "Function", - undefined -]; - -const sortArrayByType = array => { - array.sort((a, b) => { - const aType = a.type || a.instanceof || (a.enum && "enum"); - const bType = b.type || b.instanceof || (b.enum && "enum"); - const aPos = typeOrder.indexOf(aType); - const bPos = typeOrder.indexOf(bType); - if (aPos === bPos) { - return array.indexOf(a) - array.indexOf(b); - } - return aPos - bPos; - }); -}; - -const sortObjectWithList = (obj, props) => { - const keys = Object.keys(obj) - .filter(p => !props.includes(p)) - .sort(); - const newObj = {}; - for (const key of props) { - if (key in obj) { - newObj[key] = obj[key]; - } - } - for (const key of keys) { - newObj[key] = obj[key]; - } - return newObj; -}; - -const PROPERTIES = [ - "$ref", - "definitions", - - "$id", - "id", - "title", - "description", - "type", - - "cli", - - "items", - "minItems", - "uniqueItems", - - "additionalProperties", - "properties", - "required", - "minProperties", - - "oneOf", - "anyOf", - "allOf", - "enum", - - "absolutePath", - "minLength", - - "minimum", - - "instanceof", - - "tsType" -]; - -const NESTED_WITH_NAME = ["definitions", "properties"]; - -const NESTED_DIRECT = ["items", "additionalProperties"]; - -const NESTED_ARRAY = ["oneOf", "anyOf", "allOf"]; - -const processJson = json => { - json = sortObjectWithList(json, PROPERTIES); - - for (const name of NESTED_WITH_NAME) { - if (name in json && json[name] && typeof json[name] === "object") { - json[name] = sortObjectAlphabetically(json[name]); - for (const key in json[name]) { - json[name][key] = processJson(json[name][key]); - } - } - } - for (const name of NESTED_DIRECT) { - if (name in json && json[name] && typeof json[name] === "object") { - json[name] = processJson(json[name]); - } - } - for (const name of NESTED_ARRAY) { - if (name in json && Array.isArray(json[name])) { - for (let i = 0; i < json[name].length; i++) { - json[name][i] = processJson(json[name][i]); - } - sortArrayByType(json[name]); - } - } - - return json; -}; - -const formatSchema = schemaPath => { - const json = require(schemaPath); - const processedJson = processJson(json); - const rawString = JSON.stringify(processedJson, null, 2); - prettier.resolveConfig(schemaPath).then(config => { - config.filepath = schemaPath; - config.parser = "json"; - const prettyString = prettier.format(rawString, config); - let normalizedContent = ""; - try { - const content = fs.readFileSync(schemaPath, "utf-8"); - normalizedContent = content.replace(/\r\n?/g, "\n"); - } catch (e) { - // ignore - } - if (normalizedContent.trim() !== prettyString.trim()) { - const basename = path.relative(schemasDir, schemaPath); - if (doWrite) { - fs.writeFileSync(schemaPath, prettyString, "utf-8"); - console.error(`schemas/${basename.replace(/\\/g, "/")} updated`); - } else { - console.error( - `schemas/${basename.replace(/\\/g, "/")} need to be updated` - ); - process.exitCode = 1; - } - } - }); -}; - -// include the top level folder "./schemas" by default -const dirs = new Set([schemasDir]); - -// search for all nestedDirs inside of this folder -for (let dirWithSchemas of dirs) { - for (let item of fs.readdirSync(dirWithSchemas)) { - const absPath = path.resolve(dirWithSchemas, item); - if (fs.statSync(absPath).isDirectory()) { - dirs.add(absPath); - } else if (item.endsWith(".json")) { - formatSchema(absPath); - } - } -} diff --git a/tooling/inherit-types.js b/tooling/inherit-types.js deleted file mode 100644 index 9ada7aa14..000000000 --- a/tooling/inherit-types.js +++ /dev/null @@ -1,176 +0,0 @@ -const path = require("path"); -const fs = require("fs"); -const ts = require("typescript"); -const program = require("./typescript-program"); - -// When --override is set, base jsdoc will override sub class jsdoc -// Otherwise on a conflict it will create a merge conflict in the file -const override = process.argv.includes("--override"); - -// When --write is set, files will be written in place -// Otherwise it only prints outdated files -const doWrite = process.argv.includes("--write"); - -const typeChecker = program.getTypeChecker(); - -/** - * @param {ts.ClassDeclaration | ts.ClassExpression} node the class declaration - * @returns {Set} the base class declarations - */ -const getBaseClasses = node => { - try { - /** @type {Set} */ - const decls = new Set(); - if (node.heritageClauses) { - for (const clause of node.heritageClauses) { - for (const clauseType of clause.types) { - const type = typeChecker.getTypeAtLocation(clauseType); - if (type.symbol) { - const decl = type.symbol.valueDeclaration; - if (ts.isClassDeclaration(decl) || ts.isClassExpression(decl)) - decls.add(decl); - } - } - } - } - return decls; - } catch (e) { - e.message += ` while getting the base class of ${node.name}`; - throw e; - } -}; - -/** - * @param {ts.ClassDeclaration | ts.ClassExpression} classNode the class declaration - * @param {string} memberName name of the member - * @returns {ts.MethodDeclaration | null} base class member declaration when found - */ -const findDeclarationInBaseClass = (classNode, memberName) => { - for (const baseClass of getBaseClasses(classNode)) { - for (const node of baseClass.members) { - if (ts.isMethodDeclaration(node)) { - if (node.name.getText() === memberName) { - return node; - } - } - } - const result = findDeclarationInBaseClass(baseClass, memberName); - if (result) return result; - } - return null; -}; - -const libPath = path.resolve(__dirname, "../lib"); - -for (const sourceFile of program.getSourceFiles()) { - let file = sourceFile.fileName; - if ( - file.toLowerCase().startsWith(libPath.replace(/\\/g, "/").toLowerCase()) - ) { - const updates = []; - - /** - * @param {ts.Node} node the traversed node - * @returns {void} - */ - const nodeHandler = node => { - if (ts.isClassDeclaration(node) || ts.isClassExpression(node)) { - for (const member of node.members) { - if ( - ts.isMethodDeclaration(member) && - !(ts.getCombinedModifierFlags(member) & ts.ModifierFlags.Static) - ) { - const baseDecl = findDeclarationInBaseClass( - node, - member.name.getText() - ); - if (baseDecl) { - const memberAsAny = /** @type {TODO} */ (member); - const baseDeclAsAny = /** @type {TODO} */ (baseDecl); - const currentJsDoc = memberAsAny.jsDoc && memberAsAny.jsDoc[0]; - const baseJsDoc = baseDeclAsAny.jsDoc && baseDeclAsAny.jsDoc[0]; - const currentJsDocText = - currentJsDoc && currentJsDoc.getText().replace(/\r\n?/g, "\n"); - let baseJsDocText = - baseJsDoc && baseJsDoc.getText().replace(/\r\n?/g, "\n"); - if (baseJsDocText) { - baseJsDocText = baseJsDocText.replace( - /\t \* @abstract\r?\n/g, - "" - ); - if (!currentJsDocText) { - // add js doc - updates.push({ - member: member.name.getText(), - start: member.getStart(), - end: member.getStart(), - content: baseJsDocText + "\n\t", - oldContent: "" - }); - } else if ( - baseJsDocText && - currentJsDocText !== baseJsDocText - ) { - // update js doc - if (override || !doWrite) { - updates.push({ - member: member.name.getText(), - start: currentJsDoc.getStart(), - end: currentJsDoc.getEnd(), - content: baseJsDocText, - oldContent: currentJsDocText - }); - } else { - updates.push({ - member: member.name.getText(), - start: currentJsDoc.getStart() - 1, - end: currentJsDoc.getEnd(), - content: `<<<<<<< original comment\n\t${currentJsDocText}\n=======\n\t${baseJsDocText}\n>>>>>>> comment from base class` - }); - } - } - } - } - } - } - } else { - node.forEachChild(nodeHandler); - } - }; - try { - sourceFile.forEachChild(nodeHandler); - } catch (e) { - e.message += ` while processing ${file}`; - throw e; - } - - if (updates.length > 0) { - if (doWrite) { - let fileContent = fs.readFileSync(file, "utf-8"); - updates.sort((a, b) => { - return b.start - a.start; - }); - for (const update of updates) { - fileContent = - fileContent.substr(0, update.start) + - update.content + - fileContent.substr(update.end); - } - console.log(`${file} ${updates.length} JSDoc comments added/updated`); - fs.writeFileSync(file, fileContent, "utf-8"); - } else { - console.log(file); - for (const update of updates) { - console.log( - `* ${update.member} should have this JSDoc:\n\t${update.content}` - ); - if (update.oldContent) { - console.log(`instead of\n\t${update.oldContent}`); - } - } - console.log(); - process.exitCode = 1; - } - } - } -} diff --git a/tooling/type-coverage.js b/tooling/type-coverage.js deleted file mode 100644 index dfeb195be..000000000 --- a/tooling/type-coverage.js +++ /dev/null @@ -1,132 +0,0 @@ -// loosely based on https://github.com/plantain-00/type-coverage - -const path = require("path"); -const fs = require("fs"); -const ts = require("typescript"); -const program = require("./typescript-program"); - -const typeChecker = program.getTypeChecker(); - -const projectPaths = [ - path.resolve(__dirname, "../lib"), - path.resolve(__dirname, "../bin"), - path.resolve(__dirname, "../tooling"), - path.resolve(__dirname, "../declarations.d.ts") -]; - -/** - * @param {string} file filename - * @returns {boolean} true, when file is part of the project - */ -const isProjectFile = file => { - return projectPaths.some(p => - file.toLowerCase().startsWith(p.replace(/\\/g, "/").toLowerCase()) - ); -}; - -/** - * @typedef {Object} Location - * @property {number} line - * @property {number} column - */ - -/** - * @typedef {Object} FileReport - * @property {string} path - * @property {Record} statementMap - * @property {{}} fnMap - * @property {{}} branchMap - * @property {Record} s - * @property {{}} f - * @property {{}} b - */ - -/** @type {Record} */ -const coverageReport = Object.create(null); - -for (const sourceFile of program.getSourceFiles()) { - let file = sourceFile.fileName; - if (isProjectFile(file)) { - /** @type {FileReport} */ - const rep = { - path: path.sep !== "/" ? file.replace(/\//g, path.sep) : file, - statementMap: {}, - fnMap: {}, - branchMap: {}, - s: {}, - f: {}, - b: {} - }; - coverageReport[rep.path] = rep; - let statementIndex = 0; - - /** - * @param {ts.Node} node the node to be walked - * @returns {void} - */ - const walkNode = node => { - if (ts.isIdentifier(node) || node.kind === ts.SyntaxKind.ThisKeyword) { - const type = typeChecker.getTypeAtLocation(node); - if (type) { - const { line, character } = ts.getLineAndCharacterOfPosition( - sourceFile, - node.getStart() - ); - const { - line: lineEnd, - character: characterEnd - } = ts.getLineAndCharacterOfPosition(sourceFile, node.getEnd()); - const typeText = typeChecker.typeToString(type); - let isExternal = false; - - /** - * @param {ts.Type} type the type to be checked - * @returns {void} - */ - const checkDecls = type => { - if (!type.symbol) return; - for (const decl of type.symbol.getDeclarations()) { - const sourceFile = decl.getSourceFile(); - if (sourceFile && !isProjectFile(sourceFile.fileName)) - isExternal = true; - } - }; - if (node.parent && ts.isPropertyAccessExpression(node.parent)) { - const expressionType = typeChecker.getTypeAtLocation( - node.parent.expression - ); - checkDecls(expressionType); - } - if (/^(<.*>)?\(/.test(typeText)) { - checkDecls(type); - } - const isTyped = - isExternal || - (!(type.flags & ts.TypeFlags.Any) && !/\bany\b/.test(typeText)); - rep.statementMap[statementIndex] = { - start: { - line: line + 1, - column: character - }, - end: { - line: lineEnd + 1, - column: characterEnd - 1 - } - }; - rep.s[statementIndex] = isTyped ? typeText.length : 0; - statementIndex++; - } - } - node.forEachChild(walkNode); - }; - sourceFile.forEachChild(walkNode); - } -} - -const outputDirectory = path.resolve(__dirname, "../coverage"); -fs.mkdirSync(outputDirectory, { recursive: true }); -fs.writeFileSync( - path.resolve(outputDirectory, "coverage-types.json"), - JSON.stringify(coverageReport), - "utf-8" -); diff --git a/tooling/typescript-program.js b/tooling/typescript-program.js deleted file mode 100644 index bd9413ab6..000000000 --- a/tooling/typescript-program.js +++ /dev/null @@ -1,17 +0,0 @@ -const path = require("path"); -const fs = require("fs"); -const ts = require("typescript"); - -const rootPath = path.resolve(__dirname, ".."); -const configPath = path.resolve(__dirname, "../tsconfig.json"); -const configContent = fs.readFileSync(configPath, "utf-8"); -const configJsonFile = ts.parseJsonText(configPath, configContent); -const parsedConfig = ts.parseJsonSourceFileConfigFileContent( - configJsonFile, - ts.sys, - rootPath, - { noEmit: true } -); -const { fileNames, options } = parsedConfig; - -module.exports = ts.createProgram(fileNames, options); diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 000000000..8c9e7177c --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2017", + "module": "commonjs", + "lib": ["es2017", "dom"], + "allowJs": true, + "checkJs": true, + "noEmit": true, + "strict": false, + "noImplicitThis": true, + "alwaysStrict": true, + "types": ["node", "jest"], + "esModuleInterop": true + }, + "include": ["test/**/webpack.config.js", "types.d.ts"] +} diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 100644 index 000000000..b6bb09721 --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2017", + "module": "commonjs", + "lib": ["es2017", "dom"], + "allowJs": true, + "checkJs": true, + "noEmit": true, + "strict": false, + "noImplicitThis": true, + "alwaysStrict": true, + "types": ["node"], + "esModuleInterop": true + }, + "include": ["declarations.d.ts", "declarations/*.d.ts", "lib/**/*.js"] +} diff --git a/types.d.ts b/types.d.ts new file mode 100644 index 000000000..954a27e5f --- /dev/null +++ b/types.d.ts @@ -0,0 +1,9627 @@ +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + +import { + ArrayExpression, + ArrowFunctionExpression, + AssignmentExpression, + AwaitExpression, + BinaryExpression, + BlockStatement, + BreakStatement, + ClassDeclaration, + ClassExpression, + Comment, + ConditionalExpression, + ContinueStatement, + DebuggerStatement, + DoWhileStatement, + EmptyStatement, + ExportAllDeclaration, + ExportDefaultDeclaration, + ExportNamedDeclaration, + ExpressionStatement, + ForInStatement, + ForOfStatement, + ForStatement, + FunctionDeclaration, + FunctionExpression, + Identifier, + IfStatement, + ImportDeclaration, + LabeledStatement, + LogicalExpression, + MemberExpression, + MetaProperty, + MethodDefinition, + NewExpression, + ObjectExpression, + Program, + RegExpLiteral, + ReturnStatement, + SequenceExpression, + SimpleCallExpression, + SimpleLiteral, + Super, + SwitchStatement, + TaggedTemplateExpression, + TemplateLiteral, + ThisExpression, + ThrowStatement, + TryStatement, + UnaryExpression, + UpdateExpression, + VariableDeclaration, + VariableDeclarator, + WhileStatement, + WithStatement, + YieldExpression +} from "estree"; +import { Stats as FsStats, WriteStream } from "fs"; +import { default as ValidationError } from "schema-utils/declarations/ValidationError"; +import { + AsArray, + AsyncParallelHook, + AsyncSeriesBailHook, + AsyncSeriesHook, + AsyncSeriesWaterfallHook, + HookMap, + MultiHook, + SyncBailHook, + SyncHook, + SyncWaterfallHook +} from "tapable"; + +declare namespace internals { + export class AbstractLibraryPlugin { + constructor(__0: { + /** + * name of the plugin + */ + pluginName: string; + /** + * used library type + */ + type: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + }); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + parseOptions(library: internals.LibraryOptions): false | T; + finishEntryModule( + module: internals.Module, + libraryContext: internals.LibraryContext + ): void; + runtimeRequirements( + chunk: internals.Chunk, + set: Set, + libraryContext: internals.LibraryContext + ): void; + render( + source: internals.Source, + renderContext: internals.RenderContextJavascriptModulesPlugin, + libraryContext: internals.LibraryContext + ): internals.Source; + chunkHash( + chunk: internals.Chunk, + hash: internals.Hash, + chunkHashContext: internals.ChunkHashContext, + libraryContext: internals.LibraryContext + ): void; + } + export class AggressiveMergingPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export class AggressiveSplittingPlugin { + constructor(options?: internals.AggressiveSplittingPluginOptions); + options: internals.AggressiveSplittingPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + static wasChunkRecorded(chunk: internals.Chunk): boolean; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface AggressiveSplittingPluginOptions { + /** + * Extra cost for each chunk (Default: 9.8kiB). + */ + chunkOverhead?: number; + + /** + * Extra cost multiplicator for entry chunks (Default: 10). + */ + entryChunkMultiplicator?: number; + + /** + * Byte, max size of per file (Default: 50kiB). + */ + maxSize?: number; + + /** + * Byte, split point. (Default: 30kiB). + */ + minSize?: number; + } + export type Amd = false | { [index: string]: any }; + export interface Argument { + description: string; + simpleType: "string" | "number" | "boolean"; + multiple: boolean; + configs: Array; + } + export interface ArgumentConfig { + description: string; + path: string; + multiple: boolean; + type: + | "string" + | "number" + | "boolean" + | "path" + | "enum" + | "RegExp" + | "reset"; + values?: Array; + } + export interface Asset { + /** + * the filename of the asset + */ + name: string; + + /** + * source of the asset + */ + source: internals.Source; + + /** + * info about the asset + */ + info: internals.AssetInfo; + } + export interface AssetEmittedInfo { + content: Buffer; + source: internals.Source; + compilation: internals.Compilation; + outputPath: string; + targetPath: string; + } + export interface AssetInfo { + /** + * true, if the asset can be long term cached forever (contains a hash) + */ + immutable?: boolean; + + /** + * size in bytes, only set after asset has been emitted + */ + size?: number; + + /** + * true, when asset is only used for development and doesn't count towards user-facing assets + */ + development?: boolean; + + /** + * true, when asset ships data for updating an existing application (HMR) + */ + hotModuleReplacement?: boolean; + } + export type AssetModuleFilename = + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + export abstract class AsyncDependenciesBlock extends internals.DependenciesBlock { + groupOptions: { + preloadOrder?: number; + prefetchOrder?: number; + name: string; + }; + loc: + | internals.SyntheticDependencyLocation + | internals.RealDependencyLocation; + request: string; + parent: internals.DependenciesBlock; + chunkName: string; + module: any; + } + export abstract class AsyncQueue { + hooks: { + beforeAdd: AsyncSeriesHook<[T]>; + added: SyncHook<[T], void>; + beforeStart: AsyncSeriesHook<[T]>; + started: SyncHook<[T], void>; + result: SyncHook<[T, Error, R], void>; + }; + add(item: T, callback: internals.CallbackCompiler): void; + invalidate(item: T): void; + stop(): void; + increaseParallelism(): void; + decreaseParallelism(): void; + isProcessing(item: T): boolean; + isQueued(item: T): boolean; + isDone(item: T): boolean; + } + export class AsyncWebAssemblyModulesPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + renderModule(module?: any, renderContext?: any, hooks?: any): any; + static getCompilationHooks( + compilation: internals.Compilation + ): internals.CompilationHooksAsyncWebAssemblyModulesPlugin; + } + export class AutomaticPrefetchPlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export type AuxiliaryComment = + | string + | internals.LibraryCustomUmdCommentObject; + export class BannerPlugin { + constructor( + options: + | string + | internals.BannerPluginOptions + | ((data: { + hash: string; + chunk: internals.Chunk; + filename: string; + }) => string) + ); + options: internals.BannerPluginOptions; + banner: (data: { + hash: string; + chunk: internals.Chunk; + filename: string; + }) => string; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export type BannerPluginArgument = + | string + | internals.BannerPluginOptions + | ((data: { + hash: string; + chunk: internals.Chunk; + filename: string; + }) => string); + export interface BannerPluginOptions { + /** + * Specifies the banner. + */ + banner: + | string + | ((data: { + hash: string; + chunk: internals.Chunk; + filename: string; + }) => string); + + /** + * If true, the banner will only be added to the entry chunks. + */ + entryOnly?: boolean; + + /** + * Exclude all modules matching any of these conditions. + */ + exclude?: string | RegExp | Array; + + /** + * Include all modules matching any of these conditions. + */ + include?: string | RegExp | Array; + + /** + * If true, banner will not be wrapped in a comment. + */ + raw?: boolean; + + /** + * Include all modules that pass test assertion. + */ + test?: string | RegExp | Array; + } + export abstract class BasicEvaluatedExpression { + type: number; + range: any; + falsy: boolean; + truthy: boolean; + bool: any; + number: any; + bigint: any; + regExp: any; + string: any; + quasis: any; + parts: any; + array: any; + items: any; + options: any; + prefix: any; + postfix: any; + wrappedInnerExpressions: any; + identifier: any; + rootInfo: any; + getMembers: any; + expression: any; + isNull(): boolean; + isString(): boolean; + isNumber(): boolean; + isBigInt(): boolean; + isBoolean(): boolean; + isRegExp(): boolean; + isConditional(): boolean; + isArray(): boolean; + isConstArray(): boolean; + isIdentifier(): boolean; + isWrapped(): boolean; + isTemplateString(): boolean; + isTruthy(): boolean; + isFalsy(): boolean; + asBool(): any; + asString(): any; + setString(string?: any): internals.BasicEvaluatedExpression; + setNull(): internals.BasicEvaluatedExpression; + setNumber(number?: any): internals.BasicEvaluatedExpression; + setBigInt(bigint?: any): internals.BasicEvaluatedExpression; + setBoolean(bool?: any): internals.BasicEvaluatedExpression; + setRegExp(regExp?: any): internals.BasicEvaluatedExpression; + setIdentifier( + identifier?: any, + rootInfo?: any, + getMembers?: any + ): internals.BasicEvaluatedExpression; + setWrapped( + prefix?: any, + postfix?: any, + innerExpressions?: any + ): internals.BasicEvaluatedExpression; + setOptions(options?: any): internals.BasicEvaluatedExpression; + addOptions(options?: any): internals.BasicEvaluatedExpression; + setItems(items?: any): internals.BasicEvaluatedExpression; + setArray(array?: any): internals.BasicEvaluatedExpression; + setTemplateString( + quasis?: any, + parts?: any, + kind?: any + ): internals.BasicEvaluatedExpression; + templateStringKind: any; + setTruthy(): internals.BasicEvaluatedExpression; + setFalsy(): internals.BasicEvaluatedExpression; + setRange(range?: any): internals.BasicEvaluatedExpression; + setExpression(expression?: any): internals.BasicEvaluatedExpression; + } + export abstract class ByTypeGenerator extends internals.Generator { + map: any; + } + export class Cache { + constructor(); + hooks: { + get: AsyncSeriesBailHook< + [ + string, + internals.Etag, + Array<(result: any, stats: internals.CallbackCache) => void> + ], + any + >; + store: AsyncParallelHook<[string, internals.Etag, any]>; + storeBuildDependencies: AsyncParallelHook<[Iterable]>; + beginIdle: SyncHook<[], void>; + endIdle: AsyncParallelHook<[]>; + shutdown: AsyncParallelHook<[]>; + }; + get( + identifier: string, + etag: internals.Etag, + callback: internals.CallbackCache + ): void; + store( + identifier: string, + etag: internals.Etag, + data: T, + callback: internals.CallbackCache + ): void; + + /** + * After this method has succeeded the cache can only be restored when build dependencies are + */ + storeBuildDependencies( + dependencies: Iterable, + callback: internals.CallbackCache + ): void; + beginIdle(): void; + endIdle(callback: internals.CallbackCache): void; + shutdown(callback: internals.CallbackCache): void; + static STAGE_MEMORY: number; + static STAGE_DEFAULT: number; + static STAGE_DISK: number; + static STAGE_NETWORK: number; + } + export interface CacheGroupSource { + key?: string; + priority?: number; + getName?: ( + module?: internals.Module, + chunks?: Array, + key?: string + ) => string; + chunksFilter?: (chunk: internals.Chunk) => boolean; + enforce?: boolean; + minSize: Record; + minRemainingSize: Record; + maxAsyncSize: Record; + maxInitialSize: Record; + minChunks?: number; + maxAsyncRequests?: number; + maxInitialRequests?: number; + filename?: + | string + | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + idHint?: string; + automaticNameDelimiter: string; + reuseExistingChunk?: boolean; + } + export interface CacheGroupsContext { + moduleGraph: internals.ModuleGraph; + chunkGraph: internals.ChunkGraph; + } + export type CacheOptions = + | boolean + | internals.MemoryCacheOptions + | internals.FileCacheOptions; + export type CacheOptionsNormalized = + | false + | internals.MemoryCacheOptions + | internals.FileCacheOptions; + export type CallExpression = SimpleCallExpression | NewExpression; + export interface CallbackCache { + (err?: internals.WebpackError, stats?: T): void; + } + export interface CallbackCompiler { + (err?: Error, result?: T): any; + } + export interface CallbackWebpack { + (err?: Error, stats?: T): void; + } + export abstract class Chunk { + id: string | number; + ids: Array; + debugId: number; + name: string; + idNameHints: internals.SortableSet; + preventIntegration: boolean; + filenameTemplate: + | string + | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + files: Set; + auxiliaryFiles: Set; + rendered: boolean; + hash: string; + contentHash: Record; + renderedHash: string; + chunkReason: string; + extraAsync: boolean; + readonly entryModule: internals.Module; + hasEntryModule(): boolean; + addModule(module: internals.Module): boolean; + removeModule(module: internals.Module): void; + getNumberOfModules(): number; + readonly modulesIterable: Iterable; + compareTo(otherChunk: internals.Chunk): 0 | 1 | -1; + containsModule(module: internals.Module): boolean; + getModules(): Array; + remove(): void; + moveModule(module: internals.Module, otherChunk: internals.Chunk): void; + integrate(otherChunk: internals.Chunk): boolean; + canBeIntegrated(otherChunk: internals.Chunk): boolean; + isEmpty(): boolean; + modulesSize(): number; + size(options?: internals.ChunkSizeOptions): number; + integratedSize( + otherChunk: internals.Chunk, + options: internals.ChunkSizeOptions + ): number; + getChunkModuleMaps( + filterFn: (m: internals.Module) => boolean + ): internals.ChunkModuleMaps; + hasModuleInGraph( + filterFn: (m: internals.Module) => boolean, + filterChunkFn: ( + c: internals.Chunk, + chunkGraph: internals.ChunkGraph + ) => boolean + ): boolean; + getChunkMaps(realHash: boolean): internals.ChunkMaps; + hasRuntime(): boolean; + canBeInitial(): boolean; + isOnlyInitial(): boolean; + addGroup(chunkGroup: internals.ChunkGroup): void; + removeGroup(chunkGroup: internals.ChunkGroup): void; + isInGroup(chunkGroup: internals.ChunkGroup): boolean; + getNumberOfGroups(): number; + readonly groupsIterable: Iterable; + disconnectFromGroups(): void; + split(newChunk: internals.Chunk): void; + + /** + * Update the hash + */ + updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; + getAllAsyncChunks(): Set; + getAllReferencedChunks(): Set; + hasAsyncChunks(): boolean; + getChildIdsByOrders( + chunkGraph: internals.ChunkGraph, + filterFn: ( + c: internals.Chunk, + chunkGraph: internals.ChunkGraph + ) => boolean + ): Record>; + getChildIdsByOrdersMap( + chunkGraph: internals.ChunkGraph, + includeDirectChildren: boolean, + filterFn: ( + c: internals.Chunk, + chunkGraph: internals.ChunkGraph + ) => boolean + ): Record>>; + } + export abstract class ChunkGraph { + moduleGraph: internals.ModuleGraph; + connectChunkAndModule( + chunk: internals.Chunk, + module: internals.Module + ): void; + disconnectChunkAndModule( + chunk: internals.Chunk, + module: internals.Module + ): void; + disconnectChunk(chunk: internals.Chunk): void; + attachModules( + chunk: internals.Chunk, + modules: Iterable + ): void; + attachRuntimeModules( + chunk: internals.Chunk, + modules: Iterable + ): void; + replaceModule( + oldModule: internals.Module, + newModule: internals.Module + ): void; + isModuleInChunk(module: internals.Module, chunk: internals.Chunk): boolean; + isModuleInChunkGroup( + module: internals.Module, + chunkGroup: internals.ChunkGroup + ): boolean; + isEntryModule(module: internals.Module): boolean; + getModuleChunksIterable( + module: internals.Module + ): Iterable; + getOrderedModuleChunksIterable( + module: internals.Module, + sortFn: (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1 + ): Iterable; + getModuleChunks(module: internals.Module): Array; + getNumberOfModuleChunks(module: internals.Module): number; + haveModulesEqualChunks( + moduleA: internals.Module, + moduleB: internals.Module + ): boolean; + getNumberOfChunkModules(chunk: internals.Chunk): number; + getChunkModulesIterable(chunk: internals.Chunk): Iterable; + getChunkModulesIterableBySourceType( + chunk: internals.Chunk, + sourceType: string + ): Iterable; + getOrderedChunkModulesIterable( + chunk: internals.Chunk, + comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 + ): Iterable; + getOrderedChunkModulesIterableBySourceType( + chunk: internals.Chunk, + sourceType: string, + comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 + ): Iterable; + getChunkModules(chunk: internals.Chunk): Array; + getOrderedChunkModules( + chunk: internals.Chunk, + comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 + ): Array; + getChunkModuleMaps( + chunk: internals.Chunk, + filterFn: (m: internals.Module) => boolean, + includeAllChunks?: boolean + ): internals.ChunkModuleMaps; + getChunkConditionMap( + chunk: internals.Chunk, + filterFn: ( + c: internals.Chunk, + chunkGraph: internals.ChunkGraph + ) => boolean + ): Record; + hasModuleInChunk( + chunk: internals.Chunk, + filterFn: (m: internals.Module) => boolean + ): boolean; + hasModuleInGraph( + chunk: internals.Chunk, + filterFn: (m: internals.Module) => boolean, + filterChunkFn: ( + c: internals.Chunk, + chunkGraph: internals.ChunkGraph + ) => boolean + ): boolean; + compareChunks(chunkA: internals.Chunk, chunkB: internals.Chunk): 0 | 1 | -1; + getChunkModulesSize(chunk: internals.Chunk): number; + getChunkModulesSizes(chunk: internals.Chunk): Record; + getChunkRootModules(chunk: internals.Chunk): Array; + getChunkSize( + chunk: internals.Chunk, + options?: internals.ChunkSizeOptions + ): number; + getIntegratedChunksSize( + chunkA: internals.Chunk, + chunkB: internals.Chunk, + options?: internals.ChunkSizeOptions + ): number; + canChunksBeIntegrated( + chunkA: internals.Chunk, + chunkB: internals.Chunk + ): boolean; + integrateChunks(chunkA: internals.Chunk, chunkB: internals.Chunk): void; + isEntryModuleInChunk( + module: internals.Module, + chunk: internals.Chunk + ): boolean; + connectChunkAndEntryModule( + chunk: internals.Chunk, + module: internals.Module, + entrypoint: internals.Entrypoint + ): void; + connectChunkAndRuntimeModule( + chunk: internals.Chunk, + module: internals.RuntimeModule + ): void; + disconnectChunkAndEntryModule( + chunk: internals.Chunk, + module: internals.Module + ): void; + disconnectChunkAndRuntimeModule( + chunk: internals.Chunk, + module: internals.RuntimeModule + ): void; + disconnectEntryModule(module: internals.Module): void; + disconnectEntries(chunk: internals.Chunk): void; + getNumberOfEntryModules(chunk: internals.Chunk): number; + getNumberOfRuntimeModules(chunk: internals.Chunk): number; + getChunkEntryModulesIterable( + chunk: internals.Chunk + ): Iterable; + getChunkEntryDependentChunksIterable( + chunk: internals.Chunk + ): Iterable; + hasChunkEntryDependentChunks(chunk: internals.Chunk): boolean; + getChunkRuntimeModulesIterable( + chunk: internals.Chunk + ): Iterable; + getChunkRuntimeModulesInOrder( + chunk: internals.Chunk + ): Array; + getChunkEntryModulesWithChunkGroupIterable( + chunk: internals.Chunk + ): Iterable<[internals.Module, internals.Entrypoint]>; + getBlockChunkGroup( + depBlock: internals.AsyncDependenciesBlock + ): internals.ChunkGroup; + connectBlockAndChunkGroup( + depBlock: internals.AsyncDependenciesBlock, + chunkGroup: internals.ChunkGroup + ): void; + disconnectChunkGroup(chunkGroup: internals.ChunkGroup): void; + getModuleId(module: internals.Module): string | number; + setModuleId(module: internals.Module, id: string | number): void; + getModuleHash(module: internals.Module): string; + getRenderedModuleHash(module: internals.Module): string; + setModuleHashes( + module: internals.Module, + hash: string, + renderedHash: string + ): void; + addModuleRuntimeRequirements( + module: internals.Module, + items: Set + ): void; + addChunkRuntimeRequirements( + chunk: internals.Chunk, + items: Set + ): void; + addTreeRuntimeRequirements( + chunk: internals.Chunk, + items: Iterable + ): void; + getModuleRuntimeRequirements(module: internals.Module): ReadonlySet; + getChunkRuntimeRequirements(chunk: internals.Chunk): ReadonlySet; + getTreeRuntimeRequirements(chunk: internals.Chunk): ReadonlySet; + } + export abstract class ChunkGroup { + groupDebugId: number; + options: { preloadOrder?: number; prefetchOrder?: number; name: string }; + chunks: Array; + origins: Array<{ + module: internals.Module; + loc: + | internals.SyntheticDependencyLocation + | internals.RealDependencyLocation; + request: string; + }>; + index: number; + + /** + * when a new chunk is added to a chunkGroup, addingOptions will occur. + */ + addOptions(options: { + preloadOrder?: number; + prefetchOrder?: number; + name: string; + }): void; + + /** + * returns the name of current ChunkGroup + * + * + * sets a new name for current ChunkGroup + */ + name: string; + + /** + * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's + */ + readonly debugId: string; + + /** + * get a unique id for ChunkGroup, made up of its member Chunk id's + */ + readonly id: string; + + /** + * Performs an unshift of a specific chunk + */ + unshiftChunk(chunk: internals.Chunk): boolean; + + /** + * inserts a chunk before another existing chunk in group + */ + insertChunk(chunk: internals.Chunk, before: internals.Chunk): boolean; + + /** + * add a chunk into ChunkGroup. Is pushed on or prepended + */ + pushChunk(chunk: internals.Chunk): boolean; + replaceChunk(oldChunk: internals.Chunk, newChunk: internals.Chunk): boolean; + removeChunk(chunk: internals.Chunk): boolean; + isInitial(): boolean; + addChild(group: internals.ChunkGroup): boolean; + getChildren(): Array; + getNumberOfChildren(): number; + readonly childrenIterable: internals.SortableSet; + removeChild(group: internals.ChunkGroup): boolean; + addParent(parentChunk: internals.ChunkGroup): boolean; + getParents(): Array; + getNumberOfParents(): number; + hasParent(parent: internals.ChunkGroup): boolean; + readonly parentsIterable: internals.SortableSet; + removeParent(chunkGroup: internals.ChunkGroup): boolean; + getBlocks(): Array; + getNumberOfBlocks(): number; + hasBlock(block?: any): boolean; + readonly blocksIterable: Iterable; + addBlock(block: internals.AsyncDependenciesBlock): boolean; + addOrigin( + module: internals.Module, + loc: + | internals.SyntheticDependencyLocation + | internals.RealDependencyLocation, + request: string + ): void; + getFiles(): Array; + remove(): void; + sortItems(): void; + + /** + * Sorting predicate which allows current ChunkGroup to be compared against another. + * Sorting values are based off of number of chunks in ChunkGroup. + */ + compareTo( + chunkGraph: internals.ChunkGraph, + otherGroup: internals.ChunkGroup + ): 0 | 1 | -1; + getChildrenByOrders( + moduleGraph: internals.ModuleGraph, + chunkGraph: internals.ChunkGraph + ): Record>; + + /** + * Sets the top-down index of a module in this ChunkGroup + */ + setModulePreOrderIndex(module: internals.Module, index: number): void; + + /** + * Gets the top-down index of a module in this ChunkGroup + */ + getModulePreOrderIndex(module: internals.Module): number; + + /** + * Sets the bottom-up index of a module in this ChunkGroup + */ + setModulePostOrderIndex(module: internals.Module, index: number): void; + + /** + * Gets the bottom-up index of a module in this ChunkGroup + */ + getModulePostOrderIndex(module: internals.Module): number; + checkConstraints(): void; + getModuleIndex: (module: internals.Module) => number; + getModuleIndex2: (module: internals.Module) => number; + } + export interface ChunkHashContext { + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + } + + /** + * Compare two Modules based on their ids for sorting + */ + export interface ChunkMaps { + hash: Record; + contentHash: Record>; + name: Record; + } + export class ChunkModuleIdRangePlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface ChunkModuleMaps { + id: Record>; + hash: Record; + } + export interface ChunkPathData { + id: string | number; + name?: string; + hash: string; + hashWithLength?: (arg0: number) => string; + contentHash?: Record; + contentHashWithLength?: Record string>; + } + export interface ChunkSizeOptions { + /** + * constant overhead for a chunk + */ + chunkOverhead?: number; + + /** + * multiplicator for initial chunks + */ + entryChunkMultiplicator?: number; + } + export abstract class ChunkTemplate { + hooks: Readonly<{ + renderManifest: { tap: (options?: any, fn?: any) => void }; + modules: { tap: (options?: any, fn?: any) => void }; + render: { tap: (options?: any, fn?: any) => void }; + renderWithEntry: { tap: (options?: any, fn?: any) => void }; + hash: { tap: (options?: any, fn?: any) => void }; + hashForChunk: { tap: (options?: any, fn?: any) => void }; + }>; + readonly outputOptions: any; + } + export interface CodeGenerationContext { + /** + * the dependency templates + */ + dependencyTemplates: internals.DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + } + export interface CodeGenerationResult { + /** + * the resulting sources for all source types + */ + sources: Map; + + /** + * the runtime requirements + */ + runtimeRequirements: ReadonlySet; + } + export class Compilation { + /** + * Creates an instance of Compilation. + */ + constructor(compiler: internals.Compiler); + hooks: Readonly<{ + buildModule: SyncHook<[internals.Module], void>; + rebuildModule: SyncHook<[internals.Module], void>; + failedModule: SyncHook<[internals.Module, internals.WebpackError], void>; + succeedModule: SyncHook<[internals.Module], void>; + stillValidModule: SyncHook<[internals.Module], void>; + addEntry: SyncHook< + [ + internals.Dependency, + { name: string } & Pick< + internals.EntryDescriptionNormalized, + "dependOn" | "filename" | "library" + > + ], + void + >; + failedEntry: SyncHook< + [ + internals.Dependency, + { name: string } & Pick< + internals.EntryDescriptionNormalized, + "dependOn" | "filename" | "library" + >, + Error + ], + void + >; + succeedEntry: SyncHook< + [ + internals.Dependency, + { name: string } & Pick< + internals.EntryDescriptionNormalized, + "dependOn" | "filename" | "library" + >, + internals.Module + ], + void + >; + dependencyReferencedExports: SyncWaterfallHook< + [Array>, internals.Dependency] + >; + finishModules: AsyncSeriesHook<[Iterable]>; + finishRebuildingModule: AsyncSeriesHook<[internals.Module]>; + unseal: SyncHook<[], void>; + seal: SyncHook<[], void>; + beforeChunks: SyncHook<[], void>; + afterChunks: SyncHook<[Iterable], void>; + optimizeDependencies: SyncBailHook<[Iterable], any>; + afterOptimizeDependencies: SyncHook<[Iterable], void>; + optimize: SyncHook<[], void>; + optimizeModules: SyncBailHook<[Iterable], any>; + afterOptimizeModules: SyncHook<[Iterable], void>; + optimizeChunks: SyncBailHook< + [Iterable, Array], + any + >; + afterOptimizeChunks: SyncHook< + [Iterable, Array], + void + >; + optimizeTree: AsyncSeriesHook< + [Iterable, Iterable] + >; + afterOptimizeTree: SyncHook< + [Iterable, Iterable], + void + >; + optimizeChunkModules: AsyncSeriesBailHook< + [Iterable, Iterable], + any + >; + afterOptimizeChunkModules: SyncHook< + [Iterable, Iterable], + void + >; + shouldRecord: SyncBailHook<[], boolean>; + additionalChunkRuntimeRequirements: SyncHook< + [internals.Chunk, Set], + void + >; + runtimeRequirementInChunk: HookMap< + SyncBailHook<[internals.Chunk, Set], any> + >; + additionalModuleRuntimeRequirements: SyncHook< + [internals.Module, Set], + void + >; + runtimeRequirementInModule: HookMap< + SyncBailHook<[internals.Module, Set], any> + >; + additionalTreeRuntimeRequirements: SyncHook< + [internals.Chunk, Set], + void + >; + runtimeRequirementInTree: HookMap< + SyncBailHook<[internals.Chunk, Set], any> + >; + runtimeModule: SyncHook<[internals.RuntimeModule, internals.Chunk], void>; + reviveModules: SyncHook<[Iterable, any], void>; + beforeModuleIds: SyncHook<[Iterable], void>; + moduleIds: SyncHook<[Iterable], void>; + optimizeModuleIds: SyncHook<[Iterable], void>; + afterOptimizeModuleIds: SyncHook<[Iterable], void>; + reviveChunks: SyncHook<[Iterable, any], void>; + beforeChunkIds: SyncHook<[Iterable], void>; + chunkIds: SyncHook<[Iterable], void>; + optimizeChunkIds: SyncHook<[Iterable], void>; + afterOptimizeChunkIds: SyncHook<[Iterable], void>; + recordModules: SyncHook<[Iterable, any], void>; + recordChunks: SyncHook<[Iterable, any], void>; + optimizeCodeGeneration: SyncHook<[Iterable], void>; + beforeModuleHash: SyncHook<[], void>; + afterModuleHash: SyncHook<[], void>; + beforeCodeGeneration: SyncHook<[], void>; + afterCodeGeneration: SyncHook<[], void>; + beforeRuntimeRequirements: SyncHook<[], void>; + afterRuntimeRequirements: SyncHook<[], void>; + beforeHash: SyncHook<[], void>; + contentHash: SyncHook<[internals.Chunk], void>; + afterHash: SyncHook<[], void>; + recordHash: SyncHook<[any], void>; + record: SyncHook<[internals.Compilation, any], void>; + beforeModuleAssets: SyncHook<[], void>; + shouldGenerateChunkAssets: SyncBailHook<[], boolean>; + beforeChunkAssets: SyncHook<[], void>; + additionalChunkAssets: SyncHook<[Iterable], void>; + additionalAssets: AsyncSeriesHook<[]>; + optimizeChunkAssets: AsyncSeriesHook<[Iterable]>; + afterOptimizeChunkAssets: SyncHook<[Iterable], void>; + optimizeAssets: AsyncSeriesHook<[Record]>; + afterOptimizeAssets: SyncHook<[Record], void>; + finishAssets: AsyncSeriesHook<[Record]>; + afterFinishAssets: SyncHook<[Record], void>; + needAdditionalSeal: SyncBailHook<[], boolean>; + afterSeal: AsyncSeriesHook<[]>; + renderManifest: SyncWaterfallHook< + [Array, internals.RenderManifestOptions] + >; + fullHash: SyncHook<[internals.Hash], void>; + chunkHash: SyncHook< + [internals.Chunk, internals.Hash, internals.ChunkHashContext], + void + >; + moduleAsset: SyncHook<[internals.Module, string], void>; + chunkAsset: SyncHook<[internals.Chunk, string], void>; + assetPath: SyncWaterfallHook<[string, any, internals.AssetInfo]>; + needAdditionalPass: SyncBailHook<[], boolean>; + childCompiler: SyncHook<[internals.Compiler, string, number], void>; + log: SyncBailHook<[string, internals.LogEntry], true>; + statsPreset: HookMap>; + statsNormalize: SyncHook<[any, any], void>; + statsFactory: SyncHook<[internals.StatsFactory, any], void>; + statsPrinter: SyncHook<[internals.StatsPrinter, any], void>; + readonly normalModuleLoader: SyncHook< + [any, internals.NormalModule], + void + >; + }>; + name: string; + compiler: internals.Compiler; + resolverFactory: internals.ResolverFactory; + inputFileSystem: internals.InputFileSystem; + fileSystemInfo: internals.FileSystemInfo; + requestShortener: internals.RequestShortener; + compilerPath: string; + cache: internals.Cache; + logger: internals.WebpackLogger; + options: internals.WebpackOptionsNormalized; + outputOptions: internals.OutputNormalized; + bail: boolean; + profile: boolean; + mainTemplate: internals.MainTemplate; + chunkTemplate: internals.ChunkTemplate; + runtimeTemplate: internals.RuntimeTemplate; + moduleTemplates: { javascript: internals.ModuleTemplate }; + moduleGraph: internals.ModuleGraph; + chunkGraph: internals.ChunkGraph; + codeGenerationResults: Map< + internals.Module, + internals.CodeGenerationResult + >; + factorizeQueue: internals.AsyncQueue< + internals.FactorizeModuleOptions, + string, + internals.Module + >; + addModuleQueue: internals.AsyncQueue< + internals.Module, + string, + internals.Module + >; + buildQueue: internals.AsyncQueue< + internals.Module, + internals.Module, + internals.Module + >; + rebuildQueue: internals.AsyncQueue< + internals.Module, + internals.Module, + internals.Module + >; + processDependenciesQueue: internals.AsyncQueue< + internals.Module, + internals.Module, + internals.Module + >; + + /** + * Modules in value are building during the build of Module in key. + * Means value blocking key from finishing. + * Needed to detect build cycles. + */ + creatingModuleDuringBuild: WeakMap>; + entries: Map; + entrypoints: Map; + chunks: Set; + chunkGroups: Array; + namedChunkGroups: Map; + namedChunks: Map; + modules: Set; + records: any; + additionalChunkAssets: Array; + assets: Record; + assetsInfo: Map; + errors: Array; + warnings: Array; + children: Array; + logging: Map>; + dependencyFactories: Map< + { new (...args: Array): internals.Dependency }, + internals.ModuleFactory + >; + dependencyTemplates: internals.DependencyTemplates; + childrenCounters: {}; + usedChunkIds: Set; + usedModuleIds: Set; + needAdditionalPass: boolean; + builtModules: WeakSet; + emittedAssets: Set; + comparedForEmitAssets: Set; + fileDependencies: internals.LazySet; + contextDependencies: internals.LazySet; + missingDependencies: internals.LazySet; + buildDependencies: internals.LazySet; + compilationDependencies: { add: (item?: any) => internals.LazySet }; + getStats(): internals.Stats; + createStatsOptions(optionsOrPreset?: any, context?: {}): {}; + createStatsFactory(options?: any): internals.StatsFactory; + createStatsPrinter(options?: any): internals.StatsPrinter; + getLogger(name: string | (() => string)): internals.WebpackLogger; + addModule( + module: internals.Module, + callback: ( + err?: internals.WebpackError, + result?: internals.Module + ) => void + ): void; + + /** + * Fetches a module from a compilation by its identifier + */ + getModule(module: internals.Module): internals.Module; + + /** + * Attempts to search for a module by its identifier + */ + findModule(identifier: string): internals.Module; + + /** + * Schedules a build of the module object + */ + buildModule( + module: internals.Module, + callback: ( + err?: internals.WebpackError, + result?: internals.Module + ) => void + ): void; + processModuleDependencies( + module: internals.Module, + callback: ( + err?: internals.WebpackError, + result?: internals.Module + ) => void + ): void; + handleModuleCreation( + __0: internals.HandleModuleCreationOptions, + callback: ( + err?: internals.WebpackError, + result?: internals.Module + ) => void + ): void; + factorizeModule( + options: internals.FactorizeModuleOptions, + callback: ( + err?: internals.WebpackError, + result?: internals.Module + ) => void + ): void; + addModuleChain( + context: string, + dependency: internals.Dependency, + callback: ( + err?: internals.WebpackError, + result?: internals.Module + ) => void + ): void; + addEntry( + context: string, + entry: internals.EntryDependency, + optionsOrName: + | string + | ({ name: string } & Pick< + internals.EntryDescriptionNormalized, + "dependOn" | "filename" | "library" + >), + callback: ( + err?: internals.WebpackError, + result?: internals.Module + ) => void + ): void; + rebuildModule( + module: internals.Module, + callback: ( + err?: internals.WebpackError, + result?: internals.Module + ) => void + ): void; + finish(callback?: any): void; + unseal(): void; + seal(callback: (err?: internals.WebpackError) => void): void; + reportDependencyErrorsAndWarnings( + module: internals.Module, + blocks: Array + ): void; + codeGeneration(): Map; + processRuntimeRequirements( + entrypoints: Iterable + ): void; + addRuntimeModule( + chunk: internals.Chunk, + module: internals.RuntimeModule + ): void; + addChunkInGroup( + groupOptions: + | string + | { preloadOrder?: number; prefetchOrder?: number; name: string }, + module: internals.Module, + loc: + | internals.SyntheticDependencyLocation + | internals.RealDependencyLocation, + request: string + ): internals.ChunkGroup; + + /** + * This method first looks to see if a name is provided for a new chunk, + * and first looks to see if any named chunks already exist and reuse that chunk instead. + */ + addChunk(name: string): internals.Chunk; + assignDepth(module: internals.Module): void; + getDependencyReferencedExports( + dependency: internals.Dependency + ): Array>; + removeReasonsOfDependencyBlock( + module: internals.Module, + block: internals.DependenciesBlockLike + ): void; + patchChunksAfterReasonRemoval( + module: internals.Module, + chunk: internals.Chunk + ): void; + removeChunkFromDependencies( + block: internals.DependenciesBlock, + chunk: internals.Chunk + ): void; + sortItemsWithChunkIds(): void; + summarizeDependencies(): void; + createModuleHashes(): void; + createHash(): void; + fullHash: string; + hash: string; + modifyHash(update: string): void; + emitAsset( + file: string, + source: internals.Source, + assetInfo?: internals.AssetInfo + ): void; + updateAsset( + file: string, + newSourceOrFunction: + | internals.Source + | ((arg0: internals.Source) => internals.Source), + assetInfoUpdateOrFunction?: + | internals.AssetInfo + | ((arg0: internals.AssetInfo) => internals.AssetInfo) + ): void; + getAssets(): Array; + getAsset(name: string): internals.Asset; + clearAssets(): void; + createModuleAssets(): void; + getRenderManifest( + options: internals.RenderManifestOptions + ): Array; + createChunkAssets(callback: (err?: internals.WebpackError) => void): void; + getPath( + filename: + | string + | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), + data?: internals.PathData + ): string; + getPathWithInfo( + filename: + | string + | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), + data?: internals.PathData + ): { path: string; info: internals.AssetInfo }; + getAssetPath( + filename: + | string + | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), + data: internals.PathData + ): string; + getAssetPathWithInfo( + filename: + | string + | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), + data: internals.PathData + ): { path: string; info: internals.AssetInfo }; + + /** + * This function allows you to run another instance of webpack inside of webpack however as + * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins + * from parent (or top level compiler) and creates a child Compilation + */ + createChildCompiler( + name: string, + outputOptions: internals.OutputNormalized, + plugins: Array + ): internals.Compiler; + checkConstraints(): void; + } + export interface CompilationHooksAsyncWebAssemblyModulesPlugin { + renderModuleContent: SyncWaterfallHook< + [ + internals.Source, + internals.Module, + internals.RenderContextAsyncWebAssemblyModulesPlugin + ] + >; + } + export interface CompilationHooksJavascriptModulesPlugin { + renderModuleContent: SyncWaterfallHook< + [ + internals.Source, + internals.Module, + internals.RenderContextJavascriptModulesPlugin + ] + >; + renderModuleContainer: SyncWaterfallHook< + [ + internals.Source, + internals.Module, + internals.RenderContextJavascriptModulesPlugin + ] + >; + renderModulePackage: SyncWaterfallHook< + [ + internals.Source, + internals.Module, + internals.RenderContextJavascriptModulesPlugin + ] + >; + renderChunk: SyncWaterfallHook< + [internals.Source, internals.RenderContextJavascriptModulesPlugin] + >; + renderMain: SyncWaterfallHook< + [internals.Source, internals.RenderContextJavascriptModulesPlugin] + >; + render: SyncWaterfallHook< + [internals.Source, internals.RenderContextJavascriptModulesPlugin] + >; + renderRequire: SyncWaterfallHook< + [string, internals.RenderBootstrapContext] + >; + chunkHash: SyncHook< + [internals.Chunk, internals.Hash, internals.ChunkHashContext], + void + >; + } + export interface CompilationParams { + normalModuleFactory: internals.NormalModuleFactory; + contextModuleFactory: internals.ContextModuleFactory; + } + export class Compiler { + constructor(context: string); + hooks: Readonly<{ + initialize: SyncHook<[], void>; + shouldEmit: SyncBailHook<[internals.Compilation], boolean>; + done: AsyncSeriesHook<[internals.Stats]>; + afterDone: SyncHook<[internals.Stats], void>; + additionalPass: AsyncSeriesHook<[]>; + beforeRun: AsyncSeriesHook<[internals.Compiler]>; + run: AsyncSeriesHook<[internals.Compiler]>; + emit: AsyncSeriesHook<[internals.Compilation]>; + assetEmitted: AsyncSeriesHook<[string, internals.AssetEmittedInfo]>; + afterEmit: AsyncSeriesHook<[internals.Compilation]>; + thisCompilation: SyncHook< + [internals.Compilation, internals.CompilationParams], + void + >; + compilation: SyncHook< + [internals.Compilation, internals.CompilationParams], + void + >; + normalModuleFactory: SyncHook<[internals.NormalModuleFactory], void>; + contextModuleFactory: SyncHook<[internals.ContextModuleFactory], void>; + beforeCompile: AsyncSeriesHook<[internals.CompilationParams]>; + compile: SyncHook<[internals.CompilationParams], void>; + make: AsyncParallelHook<[internals.Compilation]>; + afterCompile: AsyncSeriesHook<[internals.Compilation]>; + watchRun: AsyncSeriesHook<[internals.Compiler]>; + failed: SyncHook<[Error], void>; + invalid: SyncHook<[string, string], void>; + watchClose: SyncHook<[], void>; + infrastructureLog: SyncBailHook<[string, string, Array], true>; + environment: SyncHook<[], void>; + afterEnvironment: SyncHook<[], void>; + afterPlugins: SyncHook<[internals.Compiler], void>; + afterResolvers: SyncHook<[internals.Compiler], void>; + entryOption: SyncBailHook< + [ + string, + ( + | (() => Promise) + | internals.EntryStaticNormalized + ) + ], + boolean + >; + }>; + name: string; + parentCompilation: internals.Compilation; + root: internals.Compiler; + outputPath: string; + outputFileSystem: internals.OutputFileSystem; + intermediateFileSystem: internals.InputFileSystem & + internals.OutputFileSystem & + internals.IntermediateFileSystemExtras; + inputFileSystem: internals.InputFileSystem; + watchFileSystem: any; + recordsInputPath: string; + recordsOutputPath: string; + records: {}; + managedPaths: Set; + immutablePaths: Set; + modifiedFiles: Set; + removedFiles: Set; + fileTimestamps: Map; + contextTimestamps: Map; + resolverFactory: internals.ResolverFactory; + infrastructureLogger: any; + options: internals.WebpackOptionsNormalized; + context: string; + requestShortener: internals.RequestShortener; + cache: internals.Cache; + compilerPath: string; + running: boolean; + watchMode: boolean; + getInfrastructureLogger( + name: string | (() => string) + ): internals.WebpackLogger; + watch( + watchOptions: internals.WatchOptions, + handler: internals.CallbackCompiler + ): internals.Watching; + run(callback: internals.CallbackCompiler): void; + runAsChild( + callback: ( + err?: Error, + entries?: Array, + compilation?: internals.Compilation + ) => any + ): void; + purgeInputFileSystem(): void; + emitAssets( + compilation: internals.Compilation, + callback: internals.CallbackCompiler + ): void; + emitRecords(callback: internals.CallbackCompiler): void; + readRecords(callback: internals.CallbackCompiler): void; + createChildCompiler( + compilation: internals.Compilation, + compilerName: string, + compilerIndex: number, + outputOptions: internals.OutputNormalized, + plugins: Array + ): internals.Compiler; + isChild(): boolean; + createCompilation(): internals.Compilation; + newCompilation(params: internals.CompilationParams): internals.Compilation; + createNormalModuleFactory(): internals.NormalModuleFactory; + createContextModuleFactory(): internals.ContextModuleFactory; + newCompilationParams(): { + normalModuleFactory: internals.NormalModuleFactory; + contextModuleFactory: internals.ContextModuleFactory; + }; + compile(callback: internals.CallbackCompiler): void; + close(callback: internals.CallbackCompiler): void; + } + export class ContextExclusionPlugin { + constructor(negativeMatcher: RegExp); + negativeMatcher: RegExp; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export abstract class ContextModuleFactory extends internals.ModuleFactory { + hooks: Readonly<{ + beforeResolve: AsyncSeriesWaterfallHook<[any]>; + afterResolve: AsyncSeriesWaterfallHook<[any]>; + contextModuleFiles: SyncWaterfallHook<[Array]>; + alternatives: AsyncSeriesWaterfallHook<[Array]>; + }>; + resolverFactory: any; + resolveDependencies(fs?: any, options?: any, callback?: any): any; + } + export class ContextReplacementPlugin { + constructor( + resourceRegExp?: any, + newContentResource?: any, + newContentRecursive?: any, + newContentRegExp?: any + ); + resourceRegExp: any; + newContentCallback: any; + newContentResource: any; + newContentCreateContextMap: any; + newContentRecursive: any; + newContentRegExp: any; + apply(compiler?: any): void; + } + export type CrossOriginLoading = false | "anonymous" | "use-credentials"; + export type Declaration = + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration; + export class DefinePlugin { + /** + * Create a new define plugin + */ + constructor( + definitions: Record< + string, + | string + | number + | bigint + | boolean + | Function + | RegExp + | internals.RuntimeValue + | { [index: string]: RecursiveArrayOrRecordDeclarations } + | Array + > + ); + definitions: Record< + string, + | string + | number + | bigint + | boolean + | Function + | RegExp + | internals.RuntimeValue + | { [index: string]: RecursiveArrayOrRecordDeclarations } + | Array + >; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + static runtimeValue( + fn?: any, + fileDependencies?: any + ): internals.RuntimeValue; + } + export class DelegatedPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export abstract class DependenciesBlock { + dependencies: Array; + blocks: Array; + + /** + * Adds a DependencyBlock to DependencyBlock relationship. + * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting) + */ + addBlock(block: internals.AsyncDependenciesBlock): void; + addDependency(dependency: internals.Dependency): void; + removeDependency(dependency: internals.Dependency): void; + + /** + * Removes all dependencies and blocks + */ + clearDependenciesAndBlocks(): void; + + /** + * Update the hash + */ + updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; + serialize(__0: { write: any }): void; + deserialize(__0: { read: any }): void; + } + export interface DependenciesBlockLike { + dependencies: Array; + blocks: Array; + } + export class Dependency { + constructor(); + weak: boolean; + optional: boolean; + loc: + | internals.SyntheticDependencyLocation + | internals.RealDependencyLocation; + readonly type: string; + getResourceIdentifier(): string; + getReference(moduleGraph: internals.ModuleGraph): never; + + /** + * Returns list of exports referenced by this dependency + */ + getReferencedExports( + moduleGraph: internals.ModuleGraph + ): Array>; + getCondition(moduleGraph: internals.ModuleGraph): () => boolean; + + /** + * Returns the exported names + */ + getExports(moduleGraph: internals.ModuleGraph): internals.ExportsSpec; + + /** + * Returns warnings + */ + getWarnings( + moduleGraph: internals.ModuleGraph + ): Array; + + /** + * Returns errors + */ + getErrors( + moduleGraph: internals.ModuleGraph + ): Array; + + /** + * Update the hash + */ + updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; + + /** + * implement this method to allow the occurrence order plugin to count correctly + */ + getNumberOfIdOccurrences(): number; + serialize(__0: { write: any }): void; + deserialize(__0: { read: any }): void; + module: any; + readonly disconnect: any; + static NO_EXPORTS_REFERENCED: Array; + static NS_OBJECT_REFERENCED: Array>; + static DEFAULT_EXPORT_REFERENCED: Array>; + } + export abstract class DependencyTemplate { + apply( + dependency: internals.Dependency, + source: internals.ReplaceSource, + templateContext: internals.DependencyTemplateContext + ): void; + } + export interface DependencyTemplateContext { + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the dependency templates + */ + dependencyTemplates: internals.DependencyTemplates; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + + /** + * the requirements for runtime + */ + runtimeRequirements: Set; + + /** + * current module + */ + module: internals.Module; + + /** + * mutable array of init fragments for the current module + */ + initFragments: Array; + } + export abstract class DependencyTemplates { + get(dependency: { + new (...args: Array): internals.Dependency; + }): internals.DependencyTemplate; + set( + dependency: { new (...args: Array): internals.Dependency }, + dependencyTemplate: internals.DependencyTemplate + ): void; + updateHash(part: string): void; + getHash(): string; + clone(): internals.DependencyTemplates; + } + export class DeterministicModuleIdsPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * Options for the webpack-dev-server. + */ + export interface DevServer { + [index: string]: any; + } + export type DevTool = string | false; + export type DevtoolFallbackModuleFilenameTemplate = string | Function; + export class DllPlugin { + constructor(options: internals.DllPluginOptions); + options: { + entryOnly: boolean; + /** + * Context of requests in the manifest file (defaults to the webpack context). + */ + context?: string; + /** + * If true, manifest json file (output) will be formatted. + */ + format?: boolean; + /** + * Name of the exposed dll function (external name, use value of 'output.library'). + */ + name?: string; + /** + * Absolute path to the manifest json file (output). + */ + path: string; + /** + * Type of the dll bundle (external type, use value of 'output.libraryTarget'). + */ + type?: string; + }; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface DllPluginOptions { + /** + * Context of requests in the manifest file (defaults to the webpack context). + */ + context?: string; + + /** + * If true, only entry points will be exposed (default: true). + */ + entryOnly?: boolean; + + /** + * If true, manifest json file (output) will be formatted. + */ + format?: boolean; + + /** + * Name of the exposed dll function (external name, use value of 'output.library'). + */ + name?: string; + + /** + * Absolute path to the manifest json file (output). + */ + path: string; + + /** + * Type of the dll bundle (external type, use value of 'output.libraryTarget'). + */ + type?: string; + } + export class DllReferencePlugin { + constructor( + options: + | { + /** + * Context of requests in the manifest (or content property) as absolute path. + */ + context?: string; + /** + * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). + */ + extensions?: Array; + /** + * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. + */ + manifest: string | internals.DllReferencePluginOptionsManifest; + /** + * The name where the dll is exposed (external name, defaults to manifest.name). + */ + name?: string; + /** + * Prefix which is used for accessing the content of the dll. + */ + scope?: string; + /** + * How the dll is exposed (libraryTarget, defaults to manifest.type). + */ + sourceType?: + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + /** + * The way how the export of the dll bundle is used. + */ + type?: "object" | "require"; + } + | { + /** + * The mappings from request to module info. + */ + content: internals.DllReferencePluginOptionsContent; + /** + * Context of requests in the manifest (or content property) as absolute path. + */ + context?: string; + /** + * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). + */ + extensions?: Array; + /** + * The name where the dll is exposed (external name). + */ + name: string; + /** + * Prefix which is used for accessing the content of the dll. + */ + scope?: string; + /** + * How the dll is exposed (libraryTarget). + */ + sourceType?: + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + /** + * The way how the export of the dll bundle is used. + */ + type?: "object" | "require"; + } + ); + options: + | { + /** + * Context of requests in the manifest (or content property) as absolute path. + */ + context?: string; + /** + * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). + */ + extensions?: Array; + /** + * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. + */ + manifest: string | internals.DllReferencePluginOptionsManifest; + /** + * The name where the dll is exposed (external name, defaults to manifest.name). + */ + name?: string; + /** + * Prefix which is used for accessing the content of the dll. + */ + scope?: string; + /** + * How the dll is exposed (libraryTarget, defaults to manifest.type). + */ + sourceType?: + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + /** + * The way how the export of the dll bundle is used. + */ + type?: "object" | "require"; + } + | { + /** + * The mappings from request to module info. + */ + content: internals.DllReferencePluginOptionsContent; + /** + * Context of requests in the manifest (or content property) as absolute path. + */ + context?: string; + /** + * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). + */ + extensions?: Array; + /** + * The name where the dll is exposed (external name). + */ + name: string; + /** + * Prefix which is used for accessing the content of the dll. + */ + scope?: string; + /** + * How the dll is exposed (libraryTarget). + */ + sourceType?: + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + /** + * The way how the export of the dll bundle is used. + */ + type?: "object" | "require"; + }; + apply(compiler?: any): void; + } + export type DllReferencePluginOptions = + | { + /** + * Context of requests in the manifest (or content property) as absolute path. + */ + context?: string; + /** + * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). + */ + extensions?: Array; + /** + * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. + */ + manifest: string | internals.DllReferencePluginOptionsManifest; + /** + * The name where the dll is exposed (external name, defaults to manifest.name). + */ + name?: string; + /** + * Prefix which is used for accessing the content of the dll. + */ + scope?: string; + /** + * How the dll is exposed (libraryTarget, defaults to manifest.type). + */ + sourceType?: + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + /** + * The way how the export of the dll bundle is used. + */ + type?: "object" | "require"; + } + | { + /** + * The mappings from request to module info. + */ + content: internals.DllReferencePluginOptionsContent; + /** + * Context of requests in the manifest (or content property) as absolute path. + */ + context?: string; + /** + * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). + */ + extensions?: Array; + /** + * The name where the dll is exposed (external name). + */ + name: string; + /** + * Prefix which is used for accessing the content of the dll. + */ + scope?: string; + /** + * How the dll is exposed (libraryTarget). + */ + sourceType?: + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + /** + * The way how the export of the dll bundle is used. + */ + type?: "object" | "require"; + }; + + /** + * The mappings from request to module info. + */ + export interface DllReferencePluginOptionsContent { + [index: string]: { + /** + * Meta information about the module. + */ + buildMeta?: { [index: string]: any }; + /** + * Information about the provided exports of the module. + */ + exports?: true | Array; + /** + * Module ID. + */ + id: string | number; + }; + } + + /** + * An object containing content, name and type. + */ + export interface DllReferencePluginOptionsManifest { + /** + * The mappings from request to module info. + */ + content: internals.DllReferencePluginOptionsContent; + + /** + * The name where the dll is exposed (external name). + */ + name?: string; + + /** + * The type how the dll is exposed (external type). + */ + type?: + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + } + export type DllReferencePluginOptionsSourceType = + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + export interface Effect { + type: string; + value: any; + } + export class EnableLibraryPlugin { + constructor( + type: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system" + ); + type: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + static checkEnabled( + compiler: internals.Compiler, + type: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system" + ): void; + } + export type Entry = + | string + | (() => + | string + | internals.EntryObject + | [string, string] + | Promise) + | internals.EntryObject + | [string, string]; + export interface EntryData { + /** + * dependencies of the entrypoint + */ + dependencies: Array; + + /** + * options of the entrypoint + */ + options: { name: string } & Pick< + internals.EntryDescriptionNormalized, + "dependOn" | "filename" | "library" + >; + } + export abstract class EntryDependency extends internals.ModuleDependency {} + + /** + * An object with entry point description. + */ + export interface EntryDescription { + /** + * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded. + */ + dependOn?: string | [string, string]; + + /** + * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. + */ + filename?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * Module(s) that are loaded upon startup. + */ + import: string | [string, string]; + + /** + * Options for library. + */ + library?: internals.LibraryOptions; + } + + /** + * An object with entry point description. + */ + export interface EntryDescriptionNormalized { + /** + * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded. + */ + dependOn?: [string, string]; + + /** + * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. + */ + filename?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * Module(s) that are loaded upon startup. The last one is exported. + */ + import: [string, string]; + + /** + * Options for library. + */ + library?: internals.LibraryOptions; + } + export type EntryItem = string | [string, string]; + export type EntryNormalized = + | (() => Promise) + | internals.EntryStaticNormalized; + + /** + * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object. + */ + export interface EntryObject { + [index: string]: string | [string, string] | internals.EntryDescription; + } + export class EntryPlugin { + /** + * An entry plugin which will handle + * creation of the EntryDependency + */ + constructor( + context: string, + entry: string, + options: + | string + | ({ name: string } & Pick< + internals.EntryDescriptionNormalized, + "dependOn" | "filename" | "library" + >) + ); + context: string; + entry: string; + options: + | string + | ({ name: string } & Pick< + internals.EntryDescriptionNormalized, + "dependOn" | "filename" | "library" + >); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + static createDependency( + entry: string, + options: + | string + | ({ name: string } & Pick< + internals.EntryDescriptionNormalized, + "dependOn" | "filename" | "library" + >) + ): internals.EntryDependency; + } + export type EntryStatic = string | internals.EntryObject | [string, string]; + + /** + * Multiple entry bundles are created. The key is the entry name. The value is an entry description object. + */ + export interface EntryStaticNormalized { + [index: string]: internals.EntryDescriptionNormalized; + } + export abstract class Entrypoint extends internals.ChunkGroup { + runtimeChunk: internals.Chunk; + + /** + * Sets the runtimeChunk for an entrypoint. + */ + setRuntimeChunk(chunk: internals.Chunk): void; + + /** + * Fetches the chunk reference containing the webpack bootstrap code + */ + getRuntimeChunk(): internals.Chunk; + } + export class EnvironmentPlugin { + constructor(...keys: Array); + keys: Array; + defaultValues: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface Etag { + toString: () => string; + } + export class EvalDevToolModulePlugin { + constructor(options?: any); + namespace: any; + sourceUrlComment: any; + moduleFilenameTemplate: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export class EvalSourceMapDevToolPlugin { + constructor(options?: any); + sourceMapComment: any; + moduleFilenameTemplate: any; + namespace: any; + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * Enables/Disables experiments (experimental features with relax SemVer compatibility). + */ + export interface Experiments { + /** + * Allow module type 'asset' to generate assets. + */ + asset?: boolean; + + /** + * Support WebAssembly as asynchronous EcmaScript Module. + */ + asyncWebAssembly?: boolean; + + /** + * Allow 'import/export' syntax to import async modules. + */ + importAsync?: boolean; + + /** + * Allow 'import/export await' syntax to import async modules. + */ + importAwait?: boolean; + + /** + * Support .mjs files as way to define strict ESM file (node.js). + */ + mjs?: boolean; + + /** + * Allow output javascript files as module source type. + */ + outputModule?: boolean; + + /** + * Support WebAssembly as synchronous EcmaScript Module (outdated). + */ + syncWebAssembly?: boolean; + + /** + * Allow using top-level-await in EcmaScript Modules. + */ + topLevelAwait?: boolean; + } + export abstract class ExportInfo { + name: string; + usedName: string | typeof internals.SKIP_OVER_NAME; + used: 0 | 1 | 2 | 3 | 4; + + /** + * true: it is provided + * false: it is not provided + * null: only the runtime knows if it is provided + * undefined: it was not determined if it is provided + */ + provided: boolean; + + /** + * true: it can be mangled + * false: is can not be mangled + * undefined: it was not determined if it can be mangled + */ + canMangleProvide: boolean; + + /** + * true: it can be mangled + * false: is can not be mangled + * undefined: it was not determined if it can be mangled + */ + canMangleUse: boolean; + exportsInfoOwned: boolean; + exportsInfo: internals.ExportsInfo; + readonly canMangle: boolean; + getUsedName(fallbackName?: any): any; + createNestedExportsInfo(): internals.ExportsInfo; + getNestedExportsInfo(): internals.ExportsInfo; + getUsedInfo(): + | "used" + | "no usage info" + | "maybe used (runtime-defined)" + | "unused" + | "only properties used"; + getProvidedInfo(): + | "no provided info" + | "maybe provided (runtime-defined)" + | "provided" + | "not provided"; + getRenameInfo(): string; + } + export interface ExportSpec { + /** + * the name of the export + */ + name: string; + + /** + * can the export be renamed (defaults to true) + */ + canMangle?: boolean; + + /** + * nested exports + */ + exports?: Array; + + /** + * when reexported: from which module + */ + from?: internals.Module; + + /** + * when reexported: from which export + */ + export?: Array; + } + export abstract class ExportsInfo { + readonly ownedExports: Iterable; + readonly exports: Iterable; + readonly orderedExports: Iterable; + readonly otherExportsInfo: internals.ExportInfo; + setRedirectNamedTo(exportsInfo?: any): void; + setHasProvideInfo(): void; + setHasUseInfo(): void; + getExportInfo(name: string): internals.ExportInfo; + getReadOnlyExportInfo(name: string): internals.ExportInfo; + getNestedExportsInfo(name: Array): internals.ExportsInfo; + setUnknownExportsProvided(canMangle: boolean): boolean; + setUsedInUnknownWay(): boolean; + setAllKnownExportsUsed(): boolean; + setUsedForSideEffectsOnly(): boolean; + isUsed(): boolean; + getUsedExports(): any; + getProvidedExports(): true | Array; + isExportProvided(name: string | Array): boolean; + isExportUsed(name: string | Array): 0 | 1 | 2 | 3 | 4; + getUsedName(name: string | Array): string | false | Array; + getRestoreProvidedData(): any; + restoreProvided(__0: { + otherProvided: any; + otherCanMangleProvide: any; + exports: any; + }): void; + } + export interface ExportsSpec { + /** + * exported names, true for unknown exports or null for no exports + */ + exports: true | Array; + + /** + * can the export be renamed (defaults to true) + */ + canMangle?: boolean; + + /** + * module on which the result depends on + */ + dependencies?: Array; + } + export type Expression = + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression; + export type ExternalItem = + | string + | RegExp + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void); + export type Externals = + | string + | RegExp + | Array< + | string + | RegExp + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void) + > + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void); + export class ExternalsPlugin { + constructor(type?: any, externals?: any); + type: any; + externals: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export type ExternalsType = + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + export interface FactorizeModuleOptions { + currentProfile: internals.ModuleProfile; + factory: internals.ModuleFactory; + dependencies: Array; + originModule: internals.Module; + context?: string; + } + export interface FallbackCacheGroup { + minSize: Record; + maxAsyncSize: Record; + maxInitialSize: Record; + automaticNameDelimiter: string; + } + export class FetchCompileWasmPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * Options object for persistent file-based caching. + */ + export interface FileCacheOptions { + /** + * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack'). + */ + buildDependencies?: { [index: string]: Array }; + + /** + * Base directory for the cache (defaults to node_modules/.cache/webpack). + */ + cacheDirectory?: string; + + /** + * Locations for the cache (defaults to cacheDirectory / name). + */ + cacheLocation?: string; + + /** + * Algorithm used for generation the hash (see node.js crypto package). + */ + hashAlgorithm?: string; + + /** + * Time in ms after which idle period the cache storing should happen (only for store: 'pack' or 'idle'). + */ + idleTimeout?: number; + + /** + * Time in ms after which idle period the initial cache storing should happen (only for store: 'pack' or 'idle'). + */ + idleTimeoutForInitialStore?: number; + + /** + * List of paths that are managed by a package manager and contain a version or hash in it's path so all files are immutable. + */ + immutablePaths?: Array; + + /** + * List of paths that are managed by a package manager and can be trusted to not be modified otherwise. + */ + managedPaths?: Array; + + /** + * Name for the cache. Different names will lead to different coexisting caches. + */ + name?: string; + + /** + * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file). + */ + store?: "pack"; + + /** + * Filesystem caching. + */ + type: "filesystem"; + + /** + * Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache. + */ + version?: string; + } + export abstract class FileSystemInfo { + fs: internals.InputFileSystem; + logger: internals.WebpackLogger; + fileTimestampQueue: internals.AsyncQueue< + string, + string, + internals.FileSystemInfoEntry + >; + fileHashQueue: internals.AsyncQueue; + contextTimestampQueue: internals.AsyncQueue< + string, + string, + internals.FileSystemInfoEntry + >; + contextHashQueue: internals.AsyncQueue; + managedItemQueue: internals.AsyncQueue; + managedItemDirectoryQueue: internals.AsyncQueue< + string, + string, + Set + >; + managedPaths: Array; + managedPathsWithSlash: Array; + immutablePaths: Array; + immutablePathsWithSlash: Array; + addFileTimestamps( + map: Map + ): void; + addContextTimestamps( + map: Map + ): void; + getFileTimestamp( + path: string, + callback: ( + arg0: internals.WebpackError, + arg1: internals.FileSystemInfoEntry | "ignore" + ) => void + ): void; + getContextTimestamp( + path: string, + callback: ( + arg0: internals.WebpackError, + arg1: internals.FileSystemInfoEntry | "ignore" + ) => void + ): void; + getFileHash( + path: string, + callback: (arg0: internals.WebpackError, arg1: string) => void + ): void; + getContextHash( + path: string, + callback: (arg0: internals.WebpackError, arg1: string) => void + ): void; + resolveBuildDependencies( + context: string, + deps: Iterable, + callback: ( + arg0: Error, + arg1: internals.ResolveBuildDependenciesResult + ) => void + ): void; + checkResolveResultsValid( + resolveResults: Map, + callback: (arg0: Error, arg1: boolean) => void + ): void; + createSnapshot( + startTime: number, + files: Iterable, + directories: Iterable, + missing: Iterable, + options: { + /** + * should use hash to snapshot + */ + hash?: boolean; + }, + callback: (arg0: internals.WebpackError, arg1: internals.Snapshot) => void + ): void; + mergeSnapshots( + snapshot1: internals.Snapshot, + snapshot2: internals.Snapshot + ): internals.Snapshot; + checkSnapshotValid( + snapshot: internals.Snapshot, + callback: (arg0: internals.WebpackError, arg1: boolean) => void + ): void; + getDeprecatedFileTimestamps(): Map; + getDeprecatedContextTimestamps(): Map; + } + + /** + * istanbul ignore next + */ + export interface FileSystemInfoEntry { + safeTime: number; + timestamp?: number; + timestampHash?: string; + } + export type Filename = + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + export type FilterItemTypes = string | RegExp | ((value: string) => boolean); + export type FilterTypes = + | string + | RegExp + | Array boolean)> + | ((value: string) => boolean); + export interface GenerateContext { + /** + * mapping from dependencies to templates + */ + dependencyTemplates: internals.DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + + /** + * the requirements for runtime + */ + runtimeRequirements: Set; + + /** + * which kind of code should be generated + */ + type: string; + } + export class Generator { + constructor(); + getTypes(module: internals.NormalModule): Set; + getSize(module: internals.NormalModule, type: string): number; + generate( + module: internals.NormalModule, + __1: internals.GenerateContext + ): internals.Source; + updateHash(hash: internals.Hash, __1: internals.UpdateHashContext): void; + static byType(map?: any): internals.ByTypeGenerator; + } + export interface HMRJavascriptParserHooks { + hotAcceptCallback: SyncBailHook<[any, Array], void>; + hotAcceptWithoutCallback: SyncBailHook<[any, Array], void>; + } + export interface HandleModuleCreationOptions { + factory: internals.ModuleFactory; + dependencies: Array; + originModule: internals.Module; + context?: string; + + /** + * recurse into dependencies of the created module + */ + recursive?: boolean; + } + export class Hash { + constructor(); + update(data: string | Buffer, inputEncoding: string): internals.Hash; + digest(encoding: string): string | Buffer; + } + export type HashFunction = string | typeof internals.Hash; + export class HashedModuleIdsPlugin { + constructor(options?: internals.HashedModuleIdsPluginOptions); + options: internals.HashedModuleIdsPluginOptions; + apply(compiler?: any): void; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface HashedModuleIdsPluginOptions { + /** + * The context directory for creating names. + */ + context?: string; + + /** + * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported. + */ + hashDigest?: "hex" | "latin1" | "base64"; + + /** + * The prefix length of the hash digest to use, defaults to 4. + */ + hashDigestLength?: number; + + /** + * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported. + */ + hashFunction?: string; + } + export class HotModuleReplacementPlugin { + constructor(options?: any); + options: any; + multiStep: any; + fullBuildTimeout: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + static getParserHooks( + parser: internals.JavascriptParser + ): internals.HMRJavascriptParserHooks; + } + export class IgnorePlugin { + constructor( + options: + | { + /** + * A RegExp to test the context (directory) against. + */ + contextRegExp?: RegExp; + /** + * A RegExp to test the request against. + */ + resourceRegExp?: RegExp; + } + | { + /** + * A filter function for resource and context. + */ + checkResource?: (resource: string, context: string) => boolean; + } + ); + options: + | { + /** + * A RegExp to test the context (directory) against. + */ + contextRegExp?: RegExp; + /** + * A RegExp to test the request against. + */ + resourceRegExp?: RegExp; + } + | { + /** + * A filter function for resource and context. + */ + checkResource?: (resource: string, context: string) => boolean; + }; + + /** + * Note that if "contextRegExp" is given, both the "resourceRegExp" + * and "contextRegExp" have to match. + */ + checkIgnore(resolveData: internals.ResolveData): false; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export type IgnorePluginOptions = + | { + /** + * A RegExp to test the context (directory) against. + */ + contextRegExp?: RegExp; + /** + * A RegExp to test the request against. + */ + resourceRegExp?: RegExp; + } + | { + /** + * A filter function for resource and context. + */ + checkResource?: (resource: string, context: string) => boolean; + }; + + /** + * Options for infrastructure level logging. + */ + export interface InfrastructureLogging { + /** + * Enable debug logging for specific loggers. + */ + debug?: + | string + | boolean + | RegExp + | Array boolean)> + | ((value: string) => boolean); + + /** + * Log level. + */ + level?: "none" | "verbose" | "error" | "warn" | "info" | "log"; + } + export abstract class InitFragment { + content: string | internals.Source; + stage: number; + position: number; + key: string; + endContent: string | internals.Source; + getContent( + generateContext: internals.GenerateContext + ): string | internals.Source; + getEndContent( + generateContext: internals.GenerateContext + ): string | internals.Source; + merge: any; + } + export interface InputFileSystem { + readFile: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: Buffer) => void + ) => void; + readdir: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: Array) => void + ) => void; + stat: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: FsStats) => void + ) => void; + realpath?: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: string) => void + ) => void; + purge?: (arg0: string) => void; + join?: (arg0: string, arg1: string) => string; + relative?: (arg0: string, arg1: string) => string; + dirname?: (arg0: string) => string; + } + export interface IntermediateFileSystemExtras { + mkdirSync: (arg0: string) => void; + createWriteStream: (arg0: string) => WriteStream; + rename: ( + arg0: string, + arg1: string, + arg2: (arg0: NodeJS.ErrnoException) => void + ) => void; + } + export class JavascriptModulesPlugin { + constructor(options?: {}); + options: {}; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + renderModule( + module: internals.Module, + renderContext: internals.RenderContextJavascriptModulesPlugin, + hooks: internals.CompilationHooksJavascriptModulesPlugin, + factory: boolean | "strict" + ): internals.Source; + renderChunk( + renderContext: internals.RenderContextJavascriptModulesPlugin, + hooks: internals.CompilationHooksJavascriptModulesPlugin + ): internals.Source; + renderMain( + renderContext: internals.MainRenderContext, + hooks: internals.CompilationHooksJavascriptModulesPlugin + ): internals.Source; + renderBootstrap( + renderContext: internals.RenderBootstrapContext, + hooks: internals.CompilationHooksJavascriptModulesPlugin + ): { + header: Array; + startup: Array; + allowInlineStartup: boolean; + }; + renderRequire( + renderContext: internals.RenderBootstrapContext, + hooks: internals.CompilationHooksJavascriptModulesPlugin + ): string; + static getCompilationHooks( + compilation: internals.Compilation + ): internals.CompilationHooksJavascriptModulesPlugin; + static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any; + static chunkHasJs: ( + chunk: internals.Chunk, + chunkGraph: internals.ChunkGraph + ) => boolean; + } + export abstract class JavascriptParser extends internals.Parser { + hooks: Readonly<{ + evaluateTypeof: HookMap< + SyncBailHook<[UnaryExpression], internals.BasicEvaluatedExpression> + >; + evaluate: HookMap< + SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + internals.BasicEvaluatedExpression + > + >; + evaluateIdentifier: HookMap< + SyncBailHook< + [ThisExpression | MemberExpression | Identifier], + internals.BasicEvaluatedExpression + > + >; + evaluateDefinedIdentifier: HookMap< + SyncBailHook< + [ThisExpression | MemberExpression | Identifier], + internals.BasicEvaluatedExpression + > + >; + evaluateCallExpressionMember: HookMap< + SyncBailHook< + [ + SimpleCallExpression | NewExpression, + internals.BasicEvaluatedExpression + ], + internals.BasicEvaluatedExpression + > + >; + preStatement: SyncBailHook< + [ + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + | ImportDeclaration + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration + ], + boolean | void + >; + blockPreStatement: SyncBailHook< + [ + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + | ImportDeclaration + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration + ], + boolean | void + >; + statement: SyncBailHook< + [ + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + | ImportDeclaration + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration + ], + boolean | void + >; + statementIf: SyncBailHook<[IfStatement], boolean | void>; + classExtendsExpression: SyncBailHook< + [ + ( + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ), + ClassExpression | ClassDeclaration + ], + boolean | void + >; + classBodyElement: SyncBailHook< + [MethodDefinition, ClassExpression | ClassDeclaration], + boolean | void + >; + label: HookMap>; + import: SyncBailHook< + [ + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ), + string | SimpleLiteral | RegExpLiteral + ], + boolean | void + >; + importSpecifier: SyncBailHook< + [ + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ), + string | SimpleLiteral | RegExpLiteral, + string, + string + ], + boolean | void + >; + export: SyncBailHook< + [ + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ], + boolean | void + >; + exportImport: SyncBailHook< + [ + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ), + string | SimpleLiteral | RegExpLiteral + ], + boolean | void + >; + exportDeclaration: SyncBailHook< + [ + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ), + FunctionDeclaration | VariableDeclaration | ClassDeclaration + ], + boolean | void + >; + exportExpression: SyncBailHook< + [ + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ), + FunctionDeclaration | VariableDeclaration | ClassDeclaration + ], + boolean | void + >; + exportSpecifier: SyncBailHook< + [ + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ), + string, + string, + number + ], + boolean | void + >; + exportImportSpecifier: SyncBailHook< + [ + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ), + string | SimpleLiteral | RegExpLiteral, + string, + string, + number + ], + boolean | void + >; + preDeclarator: SyncBailHook< + [ + VariableDeclarator, + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ) + ], + boolean | void + >; + declarator: SyncBailHook< + [ + VariableDeclarator, + ( + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + ) + ], + boolean | void + >; + varDeclaration: HookMap< + SyncBailHook< + [FunctionDeclaration | VariableDeclaration | ClassDeclaration], + boolean | void + > + >; + varDeclarationLet: HookMap< + SyncBailHook< + [FunctionDeclaration | VariableDeclaration | ClassDeclaration], + boolean | void + > + >; + varDeclarationConst: HookMap< + SyncBailHook< + [FunctionDeclaration | VariableDeclaration | ClassDeclaration], + boolean | void + > + >; + varDeclarationVar: HookMap< + SyncBailHook< + [FunctionDeclaration | VariableDeclaration | ClassDeclaration], + boolean | void + > + >; + pattern: HookMap>; + canRename: HookMap< + SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + > + >; + rename: HookMap< + SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + > + >; + assign: HookMap>; + assignMemberChain: HookMap< + SyncBailHook<[AssignmentExpression, Array], boolean | void> + >; + typeof: HookMap< + SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + > + >; + importCall: SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + >; + topLevelAwait: SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + >; + call: HookMap< + SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + > + >; + callMemberChain: HookMap< + SyncBailHook< + [ + ( + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ), + Array + ], + boolean | void + > + >; + memberChainOfCallMemberChain: HookMap< + SyncBailHook< + [ + ( + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ), + Array, + SimpleCallExpression | NewExpression, + Array + ], + boolean | void + > + >; + callMemberChainOfCallMemberChain: HookMap< + SyncBailHook< + [ + ( + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ), + Array, + SimpleCallExpression | NewExpression, + Array + ], + boolean | void + > + >; + new: HookMap< + SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + > + >; + expression: HookMap< + SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + > + >; + expressionMemberChain: HookMap< + SyncBailHook< + [ + ( + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ), + Array + ], + boolean | void + > + >; + expressionConditionalOperator: SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + >; + expressionLogicalOperator: SyncBailHook< + [ + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ], + boolean | void + >; + program: SyncBailHook<[Program, Array], boolean | void>; + finish: SyncBailHook<[Program, Array], boolean | void>; + }>; + options: any; + sourceType: "module" | "script" | "auto"; + scope: internals.ScopeInfo; + state: Record & internals.ParserStateBase; + comments: any; + semicolons: any; + statementEndPos: any; + lastStatementEndPos: any; + statementStartPos: any; + currentTagData: any; + initializeEvaluating(): void; + getRenameIdentifier(expr?: any): any; + walkClass(classy: ClassExpression | ClassDeclaration): void; + walkMethodDefinition(methodDefinition?: any): void; + preWalkStatements(statements?: any): void; + blockPreWalkStatements(statements?: any): void; + walkStatements(statements?: any): void; + preWalkStatement(statement?: any): void; + blockPreWalkStatement(statement?: any): void; + walkStatement(statement?: any): void; + preWalkBlockStatement(statement?: any): void; + walkBlockStatement(statement?: any): void; + walkExpressionStatement(statement?: any): void; + preWalkIfStatement(statement?: any): void; + walkIfStatement(statement?: any): void; + preWalkLabeledStatement(statement?: any): void; + walkLabeledStatement(statement?: any): void; + preWalkWithStatement(statement?: any): void; + walkWithStatement(statement?: any): void; + preWalkSwitchStatement(statement?: any): void; + walkSwitchStatement(statement?: any): void; + walkTerminatingStatement(statement?: any): void; + walkReturnStatement(statement?: any): void; + walkThrowStatement(statement?: any): void; + preWalkTryStatement(statement?: any): void; + walkTryStatement(statement?: any): void; + preWalkWhileStatement(statement?: any): void; + walkWhileStatement(statement?: any): void; + preWalkDoWhileStatement(statement?: any): void; + walkDoWhileStatement(statement?: any): void; + preWalkForStatement(statement?: any): void; + walkForStatement(statement?: any): void; + preWalkForInStatement(statement?: any): void; + walkForInStatement(statement?: any): void; + preWalkForOfStatement(statement?: any): void; + walkForOfStatement(statement?: any): void; + preWalkFunctionDeclaration(statement?: any): void; + walkFunctionDeclaration(statement?: any): void; + blockPreWalkImportDeclaration(statement?: any): void; + enterDeclaration(declaration?: any, onIdent?: any): void; + blockPreWalkExportNamedDeclaration(statement?: any): void; + walkExportNamedDeclaration(statement?: any): void; + blockPreWalkExportDefaultDeclaration(statement?: any): void; + walkExportDefaultDeclaration(statement?: any): void; + blockPreWalkExportAllDeclaration(statement?: any): void; + preWalkVariableDeclaration(statement?: any): void; + blockPreWalkVariableDeclaration(statement?: any): void; + walkVariableDeclaration(statement?: any): void; + blockPreWalkClassDeclaration(statement?: any): void; + walkClassDeclaration(statement?: any): void; + preWalkSwitchCases(switchCases?: any): void; + walkSwitchCases(switchCases?: any): void; + preWalkCatchClause(catchClause?: any): void; + walkCatchClause(catchClause?: any): void; + walkPattern(pattern?: any): void; + walkAssignmentPattern(pattern?: any): void; + walkObjectPattern(pattern?: any): void; + walkArrayPattern(pattern?: any): void; + walkRestElement(pattern?: any): void; + walkExpressions(expressions?: any): void; + walkExpression(expression?: any): void; + walkAwaitExpression(expression?: any): void; + walkArrayExpression(expression?: any): void; + walkSpreadElement(expression?: any): void; + walkObjectExpression(expression?: any): void; + walkFunctionExpression(expression?: any): void; + walkArrowFunctionExpression(expression?: any): void; + walkSequenceExpression(expression?: any): void; + walkUpdateExpression(expression?: any): void; + walkUnaryExpression(expression?: any): void; + walkLeftRightExpression(expression?: any): void; + walkBinaryExpression(expression?: any): void; + walkLogicalExpression(expression?: any): void; + walkAssignmentExpression(expression?: any): void; + walkConditionalExpression(expression?: any): void; + walkNewExpression(expression?: any, args?: any): void; + walkYieldExpression(expression?: any): void; + walkTemplateLiteral(expression?: any): void; + walkTaggedTemplateExpression(expression?: any): void; + walkClassExpression(expression?: any): void; + walkImportExpression(expression?: any): void; + walkCallExpression(expression?: any, args?: any): void; + walkMemberExpression(expression?: any): void; + walkMemberExpressionWithExpressionName( + expression?: any, + name?: any, + rootInfo?: any, + members?: any + ): void; + walkThisExpression(expression?: any): void; + walkIdentifier(expression?: any): void; + callHooksForExpression(hookMap: any, expr: any, ...args: Array): any; + callHooksForExpressionWithFallback( + hookMap: HookMap>, + expr: MemberExpression, + fallback: ( + arg0: string, + arg1: string | internals.ScopeInfo | internals.VariableInfo, + arg2: () => Array + ) => any, + defined: (arg0: string) => any, + ...args: AsArray + ): R; + callHooksForName( + hookMap: HookMap>, + name: string, + ...args: AsArray + ): R; + callHooksForInfo( + hookMap: HookMap>, + info: string | internals.ScopeInfo | internals.VariableInfo, + ...args: AsArray + ): R; + callHooksForInfoWithFallback( + hookMap: HookMap>, + info: string | internals.ScopeInfo | internals.VariableInfo, + fallback: (arg0: string) => any, + defined: () => any, + ...args: AsArray + ): R; + callHooksForNameWithFallback( + hookMap: HookMap>, + name: string, + fallback: (arg0: string) => any, + defined: () => any, + ...args: AsArray + ): R; + inScope(params: any, fn: () => void): void; + inFunctionScope(hasThis?: any, params?: any, fn?: any): void; + inBlockScope(fn?: any): void; + detectMode(statements?: any): void; + enterPatterns(patterns?: any, onIdent?: any): void; + enterPattern(pattern?: any, onIdent?: any): void; + enterIdentifier(pattern?: any, onIdent?: any): void; + enterObjectPattern(pattern?: any, onIdent?: any): void; + enterArrayPattern(pattern?: any, onIdent?: any): void; + enterRestElement(pattern?: any, onIdent?: any): void; + enterAssignmentPattern(pattern?: any, onIdent?: any): void; + evaluateExpression( + expression: + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + ): internals.BasicEvaluatedExpression; + parseString(expression?: any): any; + parseCalculatedString(expression?: any): any; + evaluate(source?: any): internals.BasicEvaluatedExpression; + getComments(range?: any): any; + isAsiPosition(pos?: any): any; + getTagData(name?: any, tag?: any): any; + tagVariable(name?: any, tag?: any, data?: any): void; + defineVariable(name?: any): void; + undefineVariable(name?: any): void; + isVariableDefined(name?: any): boolean; + getVariableInfo( + name: string + ): string | internals.ScopeInfo | internals.VariableInfo; + setVariable( + name: string, + variableInfo: string | internals.ScopeInfo | internals.VariableInfo + ): void; + parseCommentOptions(range?: any): { options: any; errors: any }; + extractMemberExpressionChain( + expression: MemberExpression + ): { + members: Array; + object: + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + | Super; + }; + getFreeInfoFromVariable( + varName: string + ): { name: string; info: string | internals.VariableInfo }; + getMemberExpressionInfo( + expression: MemberExpression, + allowedTypes: Array<"expression" | "call"> + ): + | { + type: "call"; + call: SimpleCallExpression | NewExpression; + calleeName: string; + rootInfo: string | internals.VariableInfo; + getCalleeMembers: () => Array; + name: string; + getMembers: () => Array; + } + | { + type: "expression"; + rootInfo: string | internals.VariableInfo; + name: string; + getMembers: () => Array; + }; + getNameForExpression( + expression: MemberExpression + ): { + name: string; + rootInfo: string | internals.ScopeInfo | internals.VariableInfo; + getMembers: () => Array; + }; + } + export interface JsonpCompilationPluginHooks { + jsonpScript: SyncWaterfallHook<[string, internals.Chunk, string]>; + linkPreload: SyncWaterfallHook<[string, internals.Chunk, string]>; + linkPrefetch: SyncWaterfallHook<[string, internals.Chunk, string]>; + } + export type JsonpScriptType = false | "module" | "text/javascript"; + export class JsonpTemplatePlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + static getCompilationHooks( + compilation: internals.Compilation + ): internals.JsonpCompilationPluginHooks; + } + export interface KnownBuildMeta { + moduleArgument?: string; + exportsArgument?: string; + strict?: boolean; + moduleConcatenationBailout?: string; + exportsType?: "default" | "namespace" | "flagged"; + defaultObject?: boolean | "redirect" | "redirect-warn"; + strictHarmonyModule?: boolean; + async?: boolean; + } + export abstract class LazySet { + readonly size: number; + add(item: T): internals.LazySet; + addAll(iterable: internals.LazySet | Iterable): internals.LazySet; + clear(): void; + delete(value: T): boolean; + entries(): IterableIterator<[T, T]>; + forEach( + callbackFn: (arg0: T, arg1: T, arg2: Set) => void, + thisArg?: any + ): void; + has(item: T): boolean; + keys(): IterableIterator; + values(): IterableIterator; + serialize(__0: { write: any }): void; + } + export interface LibIdentOptions { + /** + * absolute context path to which lib ident is relative to + */ + context: string; + + /** + * object for caching + */ + associatedObjectForCache?: any; + } + export class LibManifestPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export type Library = + | string + | Array + | internals.LibraryCustomUmdObject + | internals.LibraryOptions; + export interface LibraryContext { + compilation: internals.Compilation; + options: T; + } + + /** + * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`. + */ + export interface LibraryCustomUmdCommentObject { + /** + * Set comment for `amd` section in UMD. + */ + amd?: string; + + /** + * Set comment for `commonjs` (exports) section in UMD. + */ + commonjs?: string; + + /** + * Set comment for `commonjs2` (module.exports) section in UMD. + */ + commonjs2?: string; + + /** + * Set comment for `root` (global variable) section in UMD. + */ + root?: string; + } + + /** + * Description object for all UMD variants of the library name. + */ + export interface LibraryCustomUmdObject { + /** + * Name of the exposed AMD library in the UMD. + */ + amd?: string; + + /** + * Name of the exposed commonjs export in the UMD. + */ + commonjs?: string; + + /** + * Name of the property exposed globally by a UMD library. + */ + root?: string | Array; + } + export type LibraryExport = string | Array; + export type LibraryName = + | string + | Array + | internals.LibraryCustomUmdObject; + + /** + * Options for library. + */ + export interface LibraryOptions { + /** + * Add a comment in the UMD wrapper. + */ + auxiliaryComment?: string | internals.LibraryCustomUmdCommentObject; + + /** + * Specify which export should be exposed as library. + */ + export?: string | Array; + + /** + * The name of the library (some types allow unnamed libraries too). + */ + name?: string | Array | internals.LibraryCustomUmdObject; + + /** + * Type of library. + */ + type: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + + /** + * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module. + */ + umdNamedDefine?: boolean; + } + export class LibraryTemplatePlugin { + constructor( + name: string | Array | internals.LibraryCustomUmdObject, + target: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system", + umdNamedDefine: boolean, + auxiliaryComment: string | internals.LibraryCustomUmdCommentObject, + exportProperty: string | Array + ); + library: { + type: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + name: string | Array | internals.LibraryCustomUmdObject; + umdNamedDefine: boolean; + auxiliaryComment: string | internals.LibraryCustomUmdCommentObject; + export: string | Array; + }; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export class LimitChunkCountPlugin { + constructor(options: internals.LimitChunkCountPluginOptions); + options: internals.LimitChunkCountPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface LimitChunkCountPluginOptions { + /** + * Constant overhead for a chunk. + */ + chunkOverhead?: number; + + /** + * Multiplicator for initial chunks. + */ + entryChunkMultiplicator?: number; + + /** + * Limit the maximum number of chunks using a value greater greater than or equal to 1. + */ + maxChunks: number; + } + + /** + * Custom values available in the loader context. + */ + export interface Loader { + [index: string]: any; + } + export interface LoaderItem { + loader: string; + options: any; + ident: string; + } + export class LoaderOptionsPlugin { + constructor(options?: internals.LoaderOptionsPluginOptions); + options: internals.LoaderOptionsPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface LoaderOptionsPluginOptions { + [index: string]: any; + + /** + * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3. + */ + debug?: boolean; + + /** + * Where loaders can be switched to minimize mode. + */ + minimize?: boolean; + + /** + * A configuration object that can be used to configure older loaders. + */ + options?: { + [index: string]: any; + /** + * The context that can be used to configure older loaders. + */ + context?: string; + }; + } + export class LoaderTargetPlugin { + constructor(target: string); + target: string; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface LogEntry { + type: string; + args: Array; + time: number; + trace?: Array; + } + export const MEASURE_END_OPERATION: unique symbol; + export const MEASURE_START_OPERATION: unique symbol; + export interface MainRenderContext { + /** + * the chunk + */ + chunk: internals.Chunk; + + /** + * the dependency templates + */ + dependencyTemplates: internals.DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + + /** + * results of code generation + */ + codeGenerationResults: Map< + internals.Module, + internals.CodeGenerationResult + >; + + /** + * hash to be used for render call + */ + hash: string; + } + export abstract class MainTemplate { + hooks: Readonly<{ + renderManifest: { tap: (options?: any, fn?: any) => void }; + modules: { tap: () => never }; + moduleObj: { tap: () => never }; + require: { tap: (options?: any, fn?: any) => void }; + beforeStartup: { tap: () => never }; + startup: { tap: () => never }; + afterStartup: { tap: () => never }; + render: { tap: (options?: any, fn?: any) => void }; + renderWithEntry: { tap: (options?: any, fn?: any) => void }; + assetPath: { + tap: (options?: any, fn?: any) => void; + call: (filename?: any, options?: any) => string; + }; + hash: { tap: (options?: any, fn?: any) => void }; + hashForChunk: { tap: (options?: any, fn?: any) => void }; + globalHashPaths: { tap: () => void }; + globalHash: { tap: () => void }; + hotBootstrap: { tap: () => never }; + bootstrap: SyncWaterfallHook< + [ + string, + internals.Chunk, + string, + internals.ModuleTemplate, + internals.DependencyTemplates + ] + >; + localVars: SyncWaterfallHook<[string, internals.Chunk, string]>; + requireExtensions: SyncWaterfallHook<[string, internals.Chunk, string]>; + requireEnsure: SyncWaterfallHook< + [string, internals.Chunk, string, string] + >; + }>; + renderCurrentHashCode: (hash: string, length: number) => string; + getPublicPath: (options?: any) => string; + getAssetPath: (path?: any, options?: any) => string; + getAssetPathWithInfo: ( + path?: any, + options?: any + ) => { path: string; info: internals.AssetInfo }; + readonly requireFn: string; + readonly outputOptions: any; + } + export interface MapOptions { + columns?: boolean; + module?: boolean; + } + + /** + * Options object for in-memory caching. + */ + export interface MemoryCacheOptions { + /** + * List of paths that are managed by a package manager and contain a version or hash in it's path so all files are immutable. + */ + immutablePaths?: Array; + + /** + * List of paths that are managed by a package manager and can be trusted to not be modified otherwise. + */ + managedPaths?: Array; + + /** + * In memory caching. + */ + type: "memory"; + } + export class MemoryCachePlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export class MinChunkSizePlugin { + constructor(options: internals.MinChunkSizePluginOptions); + options: internals.MinChunkSizePluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface MinChunkSizePluginOptions { + /** + * Constant overhead for a chunk. + */ + chunkOverhead?: number; + + /** + * Multiplicator for initial chunks. + */ + entryChunkMultiplicator?: number; + + /** + * Minimum number of characters. + */ + minChunkSize: number; + } + export type Mode = "development" | "production" | "none"; + export class Module extends internals.DependenciesBlock { + constructor(type: string, context?: string); + type: string; + context: string; + needId: boolean; + debugId: number; + resolveOptions: any; + factoryMeta: any; + buildMeta: internals.KnownBuildMeta & Record; + buildInfo: any; + presentationalDependencies: Array; + id: string | number; + readonly hash: string; + readonly renderedHash: string; + profile: internals.ModuleProfile; + index: number; + index2: number; + depth: number; + issuer: internals.Module; + readonly usedExports: boolean | internals.SortableSet; + readonly optimizationBailout: Array< + string | ((requestShortener: internals.RequestShortener) => string) + >; + readonly optional: boolean; + addChunk(chunk?: any): boolean; + removeChunk(chunk?: any): void; + isInChunk(chunk?: any): boolean; + isEntryModule(): boolean; + getChunks(): Array; + getNumberOfChunks(): number; + readonly chunksIterable: Iterable; + isProvided(exportName: string): boolean; + readonly exportsArgument: string; + readonly moduleArgument: string; + getExportsType( + strict: boolean + ): + | "dynamic" + | "dynamic-default" + | "namespace" + | "default-only" + | "default-with-named"; + addPresentationalDependency( + presentationalDependency: internals.Dependency + ): void; + addWarning(warning: internals.WebpackError): void; + getWarnings(): Iterable; + addError(error: internals.WebpackError): void; + getErrors(): Iterable; + + /** + * removes all warnings and errors + */ + clearWarningsAndErrors(): void; + isOptional(moduleGraph: internals.ModuleGraph): boolean; + isAccessibleInChunk( + chunkGraph: internals.ChunkGraph, + chunk: internals.Chunk, + ignoreChunk: internals.Chunk + ): boolean; + isAccessibleInChunkGroup( + chunkGraph: internals.ChunkGraph, + chunkGroup: internals.ChunkGroup, + ignoreChunk: internals.Chunk + ): boolean; + hasReasonForChunk( + chunk: internals.Chunk, + moduleGraph: internals.ModuleGraph, + chunkGraph: internals.ChunkGraph + ): boolean; + hasReasons(moduleGraph: internals.ModuleGraph): boolean; + isModuleUsed(moduleGraph: internals.ModuleGraph): boolean; + isExportUsed( + moduleGraph: internals.ModuleGraph, + exportName: string | Array + ): 0 | 1 | 2 | 3 | 4; + getUsedName( + moduleGraph: internals.ModuleGraph, + exportName: string | Array + ): string | false | Array; + needBuild( + context: internals.NeedBuildContext, + callback: (arg0: internals.WebpackError, arg1: boolean) => void + ): void; + needRebuild(fileTimestamps?: any, contextTimestamps?: any): boolean; + invalidateBuild(): void; + identifier(): string; + readableIdentifier(requestShortener: internals.RequestShortener): string; + build( + options: internals.WebpackOptionsNormalized, + compilation: internals.Compilation, + resolver: internals.Resolver & internals.WithOptions, + fs: internals.InputFileSystem, + callback: (arg0: internals.WebpackError) => void + ): void; + getSourceTypes(): Set; + source(sourceContext: internals.SourceContext): internals.Source; + size(type: string): number; + libIdent(options: internals.LibIdentOptions): string; + nameForCondition(): string; + getRuntimeRequirements( + context: internals.SourceContext + ): ReadonlySet; + codeGeneration( + context: internals.CodeGenerationContext + ): internals.CodeGenerationResult; + chunkCondition( + chunk: internals.Chunk, + compilation: internals.Compilation + ): boolean; + + /** + * Assuming this module is in the cache. Update the (cached) module with + * the fresh module from the factory. Usually updates internal references + * and properties. + */ + updateCacheModule(module: internals.Module): void; + originalSource(): internals.Source; + useSourceMap: any; + readonly hasEqualsChunks: any; + readonly isUsed: any; + readonly errors: any; + readonly warnings: any; + used: any; + } + export class ModuleConcatenationPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export abstract class ModuleDependency extends internals.Dependency { + request: string; + userRequest: string; + range: any; + } + export abstract class ModuleFactory { + create( + data: internals.ModuleFactoryCreateData, + callback: (arg0: Error, arg1: internals.ModuleFactoryResult) => void + ): void; + } + export interface ModuleFactoryCreateData { + contextInfo: internals.ModuleFactoryCreateDataContextInfo; + resolveOptions?: any; + context: string; + dependencies: Array; + } + export interface ModuleFactoryCreateDataContextInfo { + issuer: string; + compiler: string; + } + export interface ModuleFactoryResult { + /** + * the created module or unset if no module was created + */ + module?: internals.Module; + fileDependencies?: Set; + contextDependencies?: Set; + missingDependencies?: Set; + } + export namespace ModuleFilenameHelpers { + export let ALL_LOADERS_RESOURCE: string; + export let REGEXP_ALL_LOADERS_RESOURCE: RegExp; + export let LOADERS_RESOURCE: string; + export let REGEXP_LOADERS_RESOURCE: RegExp; + export let RESOURCE: string; + export let REGEXP_RESOURCE: RegExp; + export let ABSOLUTE_RESOURCE_PATH: string; + export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp; + export let RESOURCE_PATH: string; + export let REGEXP_RESOURCE_PATH: RegExp; + export let ALL_LOADERS: string; + export let REGEXP_ALL_LOADERS: RegExp; + export let LOADERS: string; + export let REGEXP_LOADERS: RegExp; + export let QUERY: string; + export let REGEXP_QUERY: RegExp; + export let ID: string; + export let REGEXP_ID: RegExp; + export let HASH: string; + export let REGEXP_HASH: RegExp; + export let NAMESPACE: string; + export let REGEXP_NAMESPACE: RegExp; + export let createFilename: ( + module: any, + options: any, + __2: { requestShortener: any; chunkGraph: any } + ) => any; + export let replaceDuplicates: ( + array?: any, + fn?: any, + comparator?: any + ) => any; + export let matchPart: (str?: any, test?: any) => any; + export let matchObject: (obj?: any, str?: any) => boolean; + } + export abstract class ModuleGraph { + setParents( + dependency: internals.Dependency, + block: internals.DependenciesBlock, + module: internals.Module + ): void; + getParentModule(dependency: internals.Dependency): internals.Module; + getParentBlock( + dependency: internals.Dependency + ): internals.DependenciesBlock; + setResolvedModule( + originModule: internals.Module, + dependency: internals.Dependency, + module: internals.Module + ): void; + updateModule( + dependency: internals.Dependency, + module: internals.Module + ): void; + removeConnection(dependency: internals.Dependency): void; + addExplanation(dependency: internals.Dependency, explanation: string): void; + cloneModuleAttributes( + sourceModule: internals.Module, + targetModule: internals.Module + ): void; + removeModuleAttributes(module: internals.Module): void; + removeAllModuleAttributes(): void; + moveModuleConnections( + oldModule: internals.Module, + newModule: internals.Module, + filterConnection: (arg0: internals.ModuleGraphConnection) => boolean + ): void; + addExtraReason(module: internals.Module, explanation: string): void; + getResolvedModule(dependency: internals.Dependency): internals.Module; + finishModule(module: internals.Module): void; + getConnection( + dependency: internals.Dependency + ): internals.ModuleGraphConnection; + getModule(dependency: internals.Dependency): internals.Module; + getOrigin(dependency: internals.Dependency): internals.Module; + getResolvedOrigin(dependency: internals.Dependency): internals.Module; + getIncomingConnections( + module: internals.Module + ): Iterable; + getOutgoingConnections( + module: internals.Module + ): Iterable; + getProfile(module: internals.Module): internals.ModuleProfile; + setProfile( + module: internals.Module, + profile: internals.ModuleProfile + ): void; + getIssuer(module: internals.Module): internals.Module; + setIssuer(module: internals.Module, issuer: internals.Module): void; + setIssuerIfUnset(module: internals.Module, issuer: internals.Module): void; + getOptimizationBailout( + module: internals.Module + ): Array< + string | ((requestShortener: internals.RequestShortener) => string) + >; + getProvidedExports(module: internals.Module): true | Array; + isExportProvided( + module: internals.Module, + exportName: string | Array + ): boolean; + getExportsInfo(module: internals.Module): internals.ExportsInfo; + getExportInfo( + module: internals.Module, + exportName: string + ): internals.ExportInfo; + getReadOnlyExportInfo( + module: internals.Module, + exportName: string + ): internals.ExportInfo; + getUsedExports( + module: internals.Module + ): boolean | internals.SortableSet; + getPreOrderIndex(module: internals.Module): number; + getPostOrderIndex(module: internals.Module): number; + setPreOrderIndex(module: internals.Module, index: number): void; + setPreOrderIndexIfUnset(module: internals.Module, index: number): boolean; + setPostOrderIndex(module: internals.Module, index: number): void; + setPostOrderIndexIfUnset(module: internals.Module, index: number): boolean; + getDepth(module: internals.Module): number; + setDepth(module: internals.Module, depth: number): void; + setDepthIfLower(module: internals.Module, depth: number): boolean; + isAsync(module: internals.Module): boolean; + setAsync(module: internals.Module): void; + getMeta(thing?: any): any; + } + export abstract class ModuleGraphConnection { + originModule: internals.Module; + resolvedOriginModule: internals.Module; + dependency: internals.Dependency; + resolvedModule: internals.Module; + module: internals.Module; + weak: boolean; + conditional: boolean; + condition: (arg0: internals.ModuleGraphConnection) => boolean; + explanations: Set; + addCondition( + condition: (arg0: internals.ModuleGraphConnection) => boolean + ): void; + addExplanation(explanation: string): void; + readonly explanation: string; + active: any; + } + + /** + * Options affecting the normal modules (`NormalModuleFactory`). + */ + export interface ModuleOptions { + /** + * An array of rules applied by default for modules. + */ + defaultRules?: Array; + + /** + * Enable warnings for full dynamic dependencies. + */ + exprContextCritical?: boolean; + + /** + * Enable recursive directory lookup for full dynamic dependencies. + */ + exprContextRecursive?: boolean; + + /** + * Sets the default regular expression for full dynamic dependencies. + */ + exprContextRegExp?: boolean | RegExp; + + /** + * Set the default request for full dynamic dependencies. + */ + exprContextRequest?: string; + + /** + * Don't parse files matching. It's matched against the full resolved request. + */ + noParse?: + | string + | Function + | RegExp + | [string | Function | RegExp, string | Function | RegExp]; + + /** + * An array of rules applied for modules. + */ + rules?: Array; + + /** + * Emit errors instead of warnings when imported names don't exist in imported module. + */ + strictExportPresence?: boolean; + + /** + * Handle the this context correctly according to the spec for namespace objects. + */ + strictThisContextOnImports?: boolean; + + /** + * Enable warnings when using the require function in a not statically analyse-able way. + */ + unknownContextCritical?: boolean; + + /** + * Enable recursive directory lookup when using the require function in a not statically analyse-able way. + */ + unknownContextRecursive?: boolean; + + /** + * Sets the regular expression when using the require function in a not statically analyse-able way. + */ + unknownContextRegExp?: boolean | RegExp; + + /** + * Sets the request when using the require function in a not statically analyse-able way. + */ + unknownContextRequest?: string; + + /** + * Cache the resolving of module requests. + */ + unsafeCache?: boolean | Function; + + /** + * Enable warnings for partial dynamic dependencies. + */ + wrappedContextCritical?: boolean; + + /** + * Enable recursive directory lookup for partial dynamic dependencies. + */ + wrappedContextRecursive?: boolean; + + /** + * Set the inner regular expression for partial dynamic dependencies. + */ + wrappedContextRegExp?: RegExp; + } + export interface ModulePathData { + id: string | number; + hash: string; + hashWithLength?: (arg0: number) => string; + } + export abstract class ModuleProfile { + startTime: number; + factory: number; + restoring: number; + integration: number; + building: number; + storing: number; + additionalFactories: number; + additionalIntegration: number; + markFactoryStart(): void; + factoryStartTime: number; + markFactoryEnd(): void; + factoryEndTime: number; + markRestoringStart(): void; + restoringStartTime: number; + markRestoringEnd(): void; + restoringEndTime: number; + markIntegrationStart(): void; + integrationStartTime: number; + markIntegrationEnd(): void; + integrationEndTime: number; + markBuildingStart(): void; + buildingStartTime: number; + markBuildingEnd(): void; + buildingEndTime: number; + markStoringStart(): void; + storingStartTime: number; + markStoringEnd(): void; + storingEndTime: number; + + /** + * Merge this profile into another one + */ + mergeInto(realProfile: internals.ModuleProfile): void; + } + export abstract class ModuleTemplate { + type: string; + hooks: Readonly<{ + content: { tap: (options?: any, fn?: any) => void }; + module: { tap: (options?: any, fn?: any) => void }; + render: { tap: (options?: any, fn?: any) => void }; + package: { tap: (options?: any, fn?: any) => void }; + hash: { tap: (options?: any, fn?: any) => void }; + }>; + readonly runtimeTemplate: any; + } + export class MultiCompiler { + constructor( + compilers: Array | Record + ); + hooks: Readonly<{ + done: SyncHook<[internals.MultiStats], void>; + invalid: MultiHook>; + run: MultiHook>; + watchClose: SyncHook<[], void>; + watchRun: MultiHook>; + infrastructureLog: MultiHook< + SyncBailHook<[string, string, Array], true> + >; + }>; + compilers: Array; + dependencies: WeakMap>; + running: boolean; + readonly options: Array; + readonly outputPath: string; + inputFileSystem: internals.InputFileSystem; + outputFileSystem: internals.OutputFileSystem; + intermediateFileSystem: internals.InputFileSystem & + internals.OutputFileSystem & + internals.IntermediateFileSystemExtras; + getInfrastructureLogger(name?: any): internals.WebpackLogger; + setDependencies( + compiler: internals.Compiler, + dependencies: Array + ): void; + validateDependencies( + callback: internals.CallbackCompiler + ): boolean; + runWithDependencies( + compilers: Array, + fn: ( + compiler: internals.Compiler, + callback: internals.CallbackCompiler + ) => any, + callback: internals.CallbackCompiler + ): void; + watch( + watchOptions: internals.WatchOptions | Array, + handler: internals.CallbackCompiler + ): internals.MultiWatching; + run(callback: internals.CallbackCompiler): void; + purgeInputFileSystem(): void; + close(callback: internals.CallbackCompiler): void; + } + export abstract class MultiStats { + stats: Array; + hash: string; + hasErrors(): boolean; + hasWarnings(): boolean; + toJson( + options?: any + ): { + children: Array; + version: any; + hash: string; + errors: Array; + warnings: Array; + }; + toString(options?: any): string; + } + export abstract class MultiWatching { + watchings: Array; + compiler: internals.MultiCompiler; + invalidate(): void; + suspend(): void; + resume(): void; + close(callback: internals.CallbackCompiler): void; + } + export class NamedChunkIdsPlugin { + constructor(options?: any); + delimiter: any; + context: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export class NamedModuleIdsPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export class NaturalModuleIdsPlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface NeedBuildContext { + fileSystemInfo: internals.FileSystemInfo; + } + export class NoEmitOnErrorsPlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export type Node = false | internals.NodeOptions; + export class NodeEnvironmentPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * Options object for node compatibility features. + */ + export interface NodeOptions { + /** + * Include a polyfill for the 'global' variable. + */ + global?: boolean; + } + export class NodeTemplatePlugin { + constructor(options?: any); + asyncChunkLoading: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export class NormalModule extends internals.Module { + constructor(__0: { + /** + * module type + */ + type: string; + /** + * request string + */ + request: string; + /** + * request intended by user (without loaders from config) + */ + userRequest: string; + /** + * request without resolving + */ + rawRequest: string; + /** + * list of loaders + */ + loaders: Array; + /** + * path + query of the real resource + */ + resource: string; + /** + * path + query of the matched resource (virtual) + */ + matchResource: string; + /** + * the parser used + */ + parser: internals.Parser; + /** + * the generator used + */ + generator: internals.Generator; + /** + * options used for resolving requests from this module + */ + resolveOptions: any; + }); + request: string; + userRequest: string; + rawRequest: string; + binary: boolean; + parser: internals.Parser; + generator: internals.Generator; + resource: string; + matchResource: string; + loaders: Array; + error: internals.WebpackError; + createSourceForAsset( + context: string, + name: string, + content: string, + sourceMap?: any, + associatedObjectForCache?: any + ): internals.Source; + createLoaderContext( + resolver: internals.Resolver & internals.WithOptions, + options: internals.WebpackOptionsNormalized, + compilation: internals.Compilation, + fs: internals.InputFileSystem + ): any; + getCurrentLoader(loaderContext?: any, index?: any): internals.LoaderItem; + createSource( + context: string, + content: string | Buffer, + sourceMap?: any, + associatedObjectForCache?: any + ): internals.Source; + doBuild( + options: internals.WebpackOptionsNormalized, + compilation: internals.Compilation, + resolver: internals.Resolver & internals.WithOptions, + fs: internals.InputFileSystem, + callback: (arg0: internals.WebpackError) => void + ): void; + markModuleAsErrored(error: internals.WebpackError): void; + applyNoParseRule(rule?: any, content?: any): any; + shouldPreventParsing(noParseRule?: any, request?: any): any; + static getCompilationHooks( + compilation: internals.Compilation + ): internals.NormalModuleCompilationHooks; + static deserialize(context?: any): internals.NormalModule; + } + export interface NormalModuleCompilationHooks { + loader: SyncHook<[any, internals.NormalModule], void>; + } + export abstract class NormalModuleFactory extends internals.ModuleFactory { + hooks: Readonly<{ + resolve: AsyncSeriesBailHook<[internals.ResolveData], any>; + factorize: AsyncSeriesBailHook<[internals.ResolveData], any>; + beforeResolve: AsyncSeriesBailHook<[internals.ResolveData], any>; + afterResolve: AsyncSeriesBailHook<[internals.ResolveData], any>; + createModule: SyncBailHook<[internals.ResolveData], any>; + module: SyncWaterfallHook<[internals.Module, any, internals.ResolveData]>; + createParser: HookMap>; + parser: HookMap>; + createGenerator: HookMap>; + generator: HookMap>; + }>; + resolverFactory: any; + ruleSet: internals.RuleSet; + unsafeCache: boolean; + cachePredicate: any; + context: any; + fs: any; + parserCache: Map>; + generatorCache: Map>; + resolveRequestArray( + contextInfo?: any, + context?: any, + array?: any, + resolver?: any, + resolveContext?: any, + callback?: any + ): any; + getParser(type?: any, parserOptions?: {}): any; + createParser(type?: any, parserOptions?: {}): any; + getGenerator(type?: any, generatorOptions?: {}): internals.Generator; + createGenerator(type?: any, generatorOptions?: {}): any; + getResolver(type?: any, resolveOptions?: any): any; + } + export class NormalModuleReplacementPlugin { + /** + * Create an instance of the plugin + */ + constructor( + resourceRegExp: RegExp, + newResource: string | ((arg0?: any) => void) + ); + resourceRegExp: RegExp; + newResource: string | ((arg0?: any) => void); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface ObjectDeserializerContext { + read: () => any; + } + export interface ObjectSerializer { + serialize: (arg0: any, arg1: internals.ObjectSerializerContext) => void; + deserialize: (arg0: internals.ObjectDeserializerContext) => any; + } + export interface ObjectSerializerContext { + write: (arg0?: any) => void; + } + export class OccurrenceChunkIdsPlugin { + constructor(options?: internals.OccurrenceChunkIdsPluginOptions); + options: internals.OccurrenceChunkIdsPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface OccurrenceChunkIdsPluginOptions { + /** + * Prioritise initial size over total size. + */ + prioritiseInitial?: boolean; + } + export class OccurrenceModuleIdsPlugin { + constructor(options?: internals.OccurrenceModuleIdsPluginOptions); + options: internals.OccurrenceModuleIdsPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface OccurrenceModuleIdsPluginOptions { + /** + * Prioritise initial size over total size. + */ + prioritiseInitial?: boolean; + } + + /** + * Enables/Disables integrated optimizations. + */ + export interface Optimization { + /** + * Check for incompatible wasm types when importing/exporting from/to ESM. + */ + checkWasmTypes?: boolean; + + /** + * Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin). + */ + chunkIds?: + | false + | "natural" + | "named" + | "deterministic" + | "size" + | "total-size"; + + /** + * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer. + */ + concatenateModules?: boolean; + + /** + * Also flag chunks as loaded which contain a subset of the modules. + */ + flagIncludedChunks?: boolean; + + /** + * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection. + */ + innerGraph?: boolean; + + /** + * Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports). + */ + mangleExports?: boolean; + + /** + * Reduce size of WASM by changing imports to shorter strings. + */ + mangleWasmImports?: boolean; + + /** + * Merge chunks which contain the same modules. + */ + mergeDuplicateChunks?: boolean; + + /** + * Enable minimizing the output. Uses optimization.minimizer. + */ + minimize?: boolean; + + /** + * Minimizer(s) to use for minimizing the output. + */ + minimizer?: Array< + internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + >; + + /** + * Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin). + */ + moduleIds?: + | false + | "natural" + | "named" + | "deterministic" + | "size" + | "hashed"; + + /** + * Avoid emitting assets when errors occur. + */ + noEmitOnErrors?: boolean; + + /** + * Set process.env.NODE_ENV to a specific value. + */ + nodeEnv?: string | false; + + /** + * Generate records with relative paths to be able to move the context folder. + */ + portableRecords?: boolean; + + /** + * Figure out which exports are provided by modules to generate more efficient code. + */ + providedExports?: boolean; + + /** + * Removes modules from chunks when these modules are already included in all parents. + */ + removeAvailableModules?: boolean; + + /** + * Remove chunks which are empty. + */ + removeEmptyChunks?: boolean; + + /** + * Create an additional chunk which contains only the webpack runtime and chunk hash maps. + */ + runtimeChunk?: + | boolean + | "single" + | "multiple" + | { + /** + * The name or name factory for the runtime chunks. + */ + name?: string | Function; + }; + + /** + * Skip over modules which are flagged to contain no side effects when exports are not used. + */ + sideEffects?: boolean; + + /** + * Optimize duplication and caching by splitting chunks by shared modules and cache group. + */ + splitChunks?: false | internals.OptimizationSplitChunksOptions; + + /** + * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code. + */ + usedExports?: boolean; + } + export type OptimizationRuntimeChunk = + | boolean + | "single" + | "multiple" + | { + /** + * The name or name factory for the runtime chunks. + */ + name?: string | Function; + }; + + /** + * Options object for describing behavior of a cache group selecting modules that should be cached together. + */ + export interface OptimizationSplitChunksCacheGroup { + /** + * Sets the name delimiter for created chunks. + */ + automaticNameDelimiter?: string; + + /** + * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML). + */ + chunks?: + | "initial" + | "async" + | "all" + | (( + module: internals.Module + ) => + | void + | internals.OptimizationSplitChunksCacheGroup + | Array); + + /** + * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group. + */ + enforce?: boolean; + + /** + * Sets the template for the filename for created chunks. + */ + filename?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * Sets the hint for chunk id. + */ + idHint?: string; + + /** + * Maximum number of requests which are accepted for on-demand loading. + */ + maxAsyncRequests?: number; + + /** + * Maximal size hint for the on-demand chunks. + */ + maxAsyncSize?: number | { [index: string]: number }; + + /** + * Maximum number of initial chunks which are accepted for an entry point. + */ + maxInitialRequests?: number; + + /** + * Maximal size hint for the initial chunks. + */ + maxInitialSize?: number | { [index: string]: number }; + + /** + * Maximal size hint for the created chunks. + */ + maxSize?: number | { [index: string]: number }; + + /** + * Minimum number of times a module has to be duplicated until it's considered for splitting. + */ + minChunks?: number; + + /** + * Minimal size for the chunks the stay after moving the modules to a new chunk. + */ + minRemainingSize?: number | { [index: string]: number }; + + /** + * Minimal size for the created chunk. + */ + minSize?: number | { [index: string]: number }; + + /** + * Give chunks for this cache group a name (chunks with equal name are merged). + */ + name?: string | false | Function; + + /** + * Priority of this cache group. + */ + priority?: number; + + /** + * Try to reuse existing chunk (with name) when it has matching modules. + */ + reuseExistingChunk?: boolean; + + /** + * Assign modules to a cache group by module name. + */ + test?: string | Function | RegExp; + + /** + * Assign modules to a cache group by module type. + */ + type?: string | Function | RegExp; + } + + /** + * Options object for splitting chunks into smaller chunks. + */ + export interface OptimizationSplitChunksOptions { + /** + * Sets the name delimiter for created chunks. + */ + automaticNameDelimiter?: string; + + /** + * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors'). + */ + cacheGroups?: { + [index: string]: + | string + | false + | Function + | RegExp + | internals.OptimizationSplitChunksCacheGroup; + }; + + /** + * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML). + */ + chunks?: Function | "initial" | "async" | "all"; + + /** + * Options for modules not selected by any other cache group. + */ + fallbackCacheGroup?: { + /** + * Sets the name delimiter for created chunks. + */ + automaticNameDelimiter?: string; + /** + * Maximal size hint for the on-demand chunks. + */ + maxAsyncSize?: number | { [index: string]: number }; + /** + * Maximal size hint for the initial chunks. + */ + maxInitialSize?: number | { [index: string]: number }; + /** + * Maximal size hint for the created chunks. + */ + maxSize?: number | { [index: string]: number }; + /** + * Minimal size for the created chunk. + */ + minSize?: number | { [index: string]: number }; + }; + + /** + * Sets the template for the filename for created chunks. + */ + filename?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * Prevents exposing path info when creating names for parts splitted by maxSize. + */ + hidePathInfo?: boolean; + + /** + * Maximum number of requests which are accepted for on-demand loading. + */ + maxAsyncRequests?: number; + + /** + * Maximal size hint for the on-demand chunks. + */ + maxAsyncSize?: number | { [index: string]: number }; + + /** + * Maximum number of initial chunks which are accepted for an entry point. + */ + maxInitialRequests?: number; + + /** + * Maximal size hint for the initial chunks. + */ + maxInitialSize?: number | { [index: string]: number }; + + /** + * Maximal size hint for the created chunks. + */ + maxSize?: number | { [index: string]: number }; + + /** + * Minimum number of times a module has to be duplicated until it's considered for splitting. + */ + minChunks?: number; + + /** + * Minimal size for the chunks the stay after moving the modules to a new chunk. + */ + minRemainingSize?: number | { [index: string]: number }; + + /** + * Minimal size for the created chunks. + */ + minSize?: number | { [index: string]: number }; + + /** + * Give chunks created a name (chunks with equal name are merged). + */ + name?: string | false | Function; + } + export type OptimizationSplitChunksSizes = + | number + | { [index: string]: number }; + export abstract class OptionsApply { + process(options?: any, compiler?: any): void; + } + + /** + * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. + */ + export interface Output { + /** + * The filename of asset modules as relative path inside the `output.path` directory. + */ + assetModuleFilename?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * Add a comment in the UMD wrapper. + */ + auxiliaryComment?: string | internals.LibraryCustomUmdCommentObject; + + /** + * The callback function name used by webpack for loading of chunks in WebWorkers. + */ + chunkCallbackName?: string; + + /** + * The filename of non-entry chunks as relative path inside the `output.path` directory. + */ + chunkFilename?: string; + + /** + * Number of milliseconds before chunk request expires. + */ + chunkLoadTimeout?: number; + + /** + * Check if to be emitted file already exists and have the same content before writing to output filesystem. + */ + compareBeforeEmit?: boolean; + + /** + * This option enables cross-origin loading of chunks. + */ + crossOriginLoading?: false | "anonymous" | "use-credentials"; + + /** + * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers. + */ + devtoolFallbackModuleFilenameTemplate?: string | Function; + + /** + * Filename template string of function for the sources array in a generated SourceMap. + */ + devtoolModuleFilenameTemplate?: string | Function; + + /** + * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries. + */ + devtoolNamespace?: string; + + /** + * The maximum EcmaScript version of the webpack generated code (doesn't include input source code from modules). + */ + ecmaVersion?: number; + + /** + * List of library types enabled for use by entry points. + */ + enabledLibraryTypes?: Array< + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system" + >; + + /** + * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. + */ + filename?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * An expression which is used to address the global object/scope in runtime code. + */ + globalObject?: string; + + /** + * Digest type used for the hash. + */ + hashDigest?: string; + + /** + * Number of chars which are used for the hash. + */ + hashDigestLength?: number; + + /** + * Algorithm used for generation the hash (see node.js crypto package). + */ + hashFunction?: string | typeof internals.Hash; + + /** + * Any string which is added to the hash to salt it. + */ + hashSalt?: string; + + /** + * The filename of the Hot Update Chunks. They are inside the output.path directory. + */ + hotUpdateChunkFilename?: string; + + /** + * The JSONP function used by webpack for async loading of hot update chunks. + */ + hotUpdateFunction?: string; + + /** + * The filename of the Hot Update Main File. It is inside the `output.path` directory. + */ + hotUpdateMainFilename?: string; + + /** + * Wrap javascript code into IIFE's to avoid leaking into global scope. + */ + iife?: boolean; + + /** + * The JSONP function used by webpack for async loading of chunks. + */ + jsonpFunction?: string; + + /** + * This option enables loading async chunks via a custom script type, such as script type="module". + */ + jsonpScriptType?: false | "module" | "text/javascript"; + + /** + * Make the output files a library, exporting the exports of the entry point. + */ + library?: + | string + | Array + | internals.LibraryCustomUmdObject + | internals.LibraryOptions; + + /** + * Specify which export should be exposed as library. + */ + libraryExport?: string | Array; + + /** + * Type of library. + */ + libraryTarget?: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + + /** + * Output javascript files as module source type. + */ + module?: boolean; + + /** + * The output directory as **absolute path** (required). + */ + path?: string; + + /** + * Include comments with information about the modules. + */ + pathinfo?: boolean; + + /** + * The `publicPath` specifies the public URL address of the output files when referenced in a browser. + */ + publicPath?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. + */ + sourceMapFilename?: string; + + /** + * Prefixes every line of the source in the bundle with this string. + */ + sourcePrefix?: string; + + /** + * Handles exceptions in module loading correctly at a performance cost. + */ + strictModuleExceptionHandling?: boolean; + + /** + * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module. + */ + umdNamedDefine?: boolean; + + /** + * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. + */ + uniqueName?: string; + + /** + * The filename of WebAssembly modules as relative path inside the `output.path` directory. + */ + webassemblyModuleFilename?: string; + } + export interface OutputFileSystem { + writeFile: ( + arg0: string, + arg1: string | Buffer, + arg2: (arg0: NodeJS.ErrnoException) => void + ) => void; + mkdir: (arg0: string, arg1: (arg0: NodeJS.ErrnoException) => void) => void; + stat: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: FsStats) => void + ) => void; + readFile: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: Buffer) => void + ) => void; + join?: (arg0: string, arg1: string) => string; + relative?: (arg0: string, arg1: string) => string; + dirname?: (arg0: string) => string; + } + + /** + * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. + */ + export interface OutputNormalized { + /** + * The filename of asset modules as relative path inside the `output.path` directory. + */ + assetModuleFilename?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * The callback function name used by webpack for loading of chunks in WebWorkers. + */ + chunkCallbackName?: string; + + /** + * The filename of non-entry chunks as relative path inside the `output.path` directory. + */ + chunkFilename?: string; + + /** + * Number of milliseconds before chunk request expires. + */ + chunkLoadTimeout?: number; + + /** + * Check if to be emitted file already exists and have the same content before writing to output filesystem. + */ + compareBeforeEmit?: boolean; + + /** + * This option enables cross-origin loading of chunks. + */ + crossOriginLoading?: false | "anonymous" | "use-credentials"; + + /** + * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers. + */ + devtoolFallbackModuleFilenameTemplate?: string | Function; + + /** + * Filename template string of function for the sources array in a generated SourceMap. + */ + devtoolModuleFilenameTemplate?: string | Function; + + /** + * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries. + */ + devtoolNamespace?: string; + + /** + * The maximum EcmaScript version of the webpack generated code (doesn't include input source code from modules). + */ + ecmaVersion?: number; + + /** + * List of library types enabled for use by entry points. + */ + enabledLibraryTypes?: Array< + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system" + >; + + /** + * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. + */ + filename?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * An expression which is used to address the global object/scope in runtime code. + */ + globalObject?: string; + + /** + * Digest type used for the hash. + */ + hashDigest?: string; + + /** + * Number of chars which are used for the hash. + */ + hashDigestLength?: number; + + /** + * Algorithm used for generation the hash (see node.js crypto package). + */ + hashFunction?: string | typeof internals.Hash; + + /** + * Any string which is added to the hash to salt it. + */ + hashSalt?: string; + + /** + * The filename of the Hot Update Chunks. They are inside the output.path directory. + */ + hotUpdateChunkFilename?: string; + + /** + * The JSONP function used by webpack for async loading of hot update chunks. + */ + hotUpdateFunction?: string; + + /** + * The filename of the Hot Update Main File. It is inside the `output.path` directory. + */ + hotUpdateMainFilename?: string; + + /** + * Wrap javascript code into IIFE's to avoid leaking into global scope. + */ + iife?: boolean; + + /** + * The JSONP function used by webpack for async loading of chunks. + */ + jsonpFunction?: string; + + /** + * This option enables loading async chunks via a custom script type, such as script type="module". + */ + jsonpScriptType?: false | "module" | "text/javascript"; + + /** + * Options for library. + */ + library?: internals.LibraryOptions; + + /** + * Output javascript files as module source type. + */ + module?: boolean; + + /** + * The output directory as **absolute path** (required). + */ + path?: string; + + /** + * Include comments with information about the modules. + */ + pathinfo?: boolean; + + /** + * The `publicPath` specifies the public URL address of the output files when referenced in a browser. + */ + publicPath?: + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + + /** + * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. + */ + sourceMapFilename?: string; + + /** + * Prefixes every line of the source in the bundle with this string. + */ + sourcePrefix?: string; + + /** + * Handles exceptions in module loading correctly at a performance cost. + */ + strictModuleExceptionHandling?: boolean; + + /** + * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. + */ + uniqueName?: string; + + /** + * The filename of WebAssembly modules as relative path inside the `output.path` directory. + */ + webassemblyModuleFilename?: string; + } + export class Parser { + constructor(); + parse( + source: string | Buffer | Record, + state: Record & internals.ParserStateBase + ): Record & internals.ParserStateBase; + } + export interface ParserStateBase { + current: internals.NormalModule; + module: internals.NormalModule; + compilation: internals.Compilation; + options: any; + } + export interface PathData { + chunkGraph?: internals.ChunkGraph; + hash?: string; + hashWithLength?: (arg0: number) => string; + chunk?: internals.Chunk | internals.ChunkPathData; + module?: internals.Module | internals.ModulePathData; + filename?: string; + basename?: string; + query?: string; + contentHashType?: string; + contentHash?: string; + contentHashWithLength?: (arg0: number) => string; + noChunkHash?: boolean; + url?: string; + } + export type Performance = false | internals.PerformanceOptions; + + /** + * Configuration object for web performance recommendations. + */ + export interface PerformanceOptions { + /** + * Filter function to select assets that are checked. + */ + assetFilter?: Function; + + /** + * Sets the format of the hints: warnings, errors or nothing at all. + */ + hints?: false | "error" | "warning"; + + /** + * File size limit (in bytes) when exceeded, that webpack will provide performance hints. + */ + maxAssetSize?: number; + + /** + * Total size of an entry point (in bytes). + */ + maxEntrypointSize?: number; + } + export interface Plugin { + apply: () => void; + } + export class PrefetchPlugin { + constructor(context?: any, request?: any); + context: any; + request: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface PrintedElement { + element: string; + content: string; + } + export interface Problem { + type: + | "unknown-argument" + | "unexpected-non-array-in-path" + | "unexpected-non-object-in-path" + | "multiple-values-unexpected" + | "invalid-value"; + path: string; + argument: string; + value?: any; + index?: number; + expected?: string; + } + export class Profiler { + constructor(inspector?: any); + session: any; + inspector: any; + hasSession(): boolean; + startProfiling(): Promise | Promise<[any, any, any]>; + sendCommand(method?: any, params?: any): Promise; + destroy(): Promise; + stopProfiling(): Promise; + } + export class ProfilingPlugin { + constructor(options?: internals.ProfilingPluginOptions); + outputPath: string; + apply(compiler?: any): void; + static Profiler: typeof internals.Profiler; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface ProfilingPluginOptions { + /** + * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`. + */ + outputPath?: string; + } + export class ProgressPlugin { + constructor( + options: + | internals.ProgressPluginOptions + | ((percentage: number, msg: string, ...args: Array) => void) + ); + profile: boolean; + handler: (percentage: number, msg: string, ...args: Array) => void; + modulesCount: number; + dependenciesCount: number; + showEntries: boolean; + showModules: boolean; + showDependencies: boolean; + showActiveModules: boolean; + percentBy: "dependencies" | "modules" | "entries"; + apply(compiler: internals.Compiler | internals.MultiCompiler): void; + static getReporter( + compiler: internals.Compiler + ): (p: number, args: Array) => void; + static defaultOptions: { + profile: boolean; + modulesCount: number; + dependenciesCount: number; + modules: boolean; + dependencies: boolean; + activeModules: boolean; + entries: boolean; + }; + } + export type ProgressPluginArgument = + | internals.ProgressPluginOptions + | ((percentage: number, msg: string, ...args: Array) => void); + + /** + * Options object for the ProgressPlugin. + */ + export interface ProgressPluginOptions { + /** + * Show active modules count and one active module in progress message. + */ + activeModules?: boolean; + + /** + * Show dependencies count in progress message. + */ + dependencies?: boolean; + + /** + * Minimum dependencies count to start with. For better progress calculation. Default: 10000. + */ + dependenciesCount?: number; + + /** + * Show entries count in progress message. + */ + entries?: boolean; + + /** + * Function that executes for every progress step. + */ + handler?: (percentage: number, msg: string, ...args: Array) => void; + + /** + * Show modules count in progress message. + */ + modules?: boolean; + + /** + * Minimum modules count to start with. For better progress calculation. Default: 5000. + */ + modulesCount?: number; + + /** + * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent. + */ + percentBy?: "dependencies" | "modules" | "entries"; + + /** + * Collect profile data for progress steps. Default: false. + */ + profile?: boolean; + } + export class ProvidePlugin { + constructor(definitions: Record>); + definitions: Record>; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export type PublicPath = + | string + | (( + pathData: internals.PathData, + assetInfo: internals.AssetInfo + ) => string); + export interface RawChunkGroupOptions { + preloadOrder?: number; + prefetchOrder?: number; + } + export class ReadFileCompileWasmPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface RealDependencyLocation { + start: internals.SourcePosition; + end?: internals.SourcePosition; + index?: number; + } + export type RecursiveArrayOrRecord = + | string + | number + | bigint + | boolean + | Function + | RegExp + | internals.RuntimeValue + | { [index: string]: RecursiveArrayOrRecordDeclarations } + | Array; + type RecursiveArrayOrRecordDeclarations = + | string + | number + | bigint + | boolean + | Function + | RegExp + | internals.RuntimeValue + | { [index: string]: RecursiveArrayOrRecordDeclarations } + | Array; + export interface RenderBootstrapContext { + /** + * the chunk + */ + chunk: internals.Chunk; + + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + + /** + * hash to be used for render call + */ + hash: string; + } + export interface RenderContextAsyncWebAssemblyModulesPlugin { + /** + * the chunk + */ + chunk: any; + + /** + * the dependency templates + */ + dependencyTemplates: any; + + /** + * the runtime template + */ + runtimeTemplate: any; + + /** + * the module graph + */ + moduleGraph: any; + + /** + * the chunk graph + */ + chunkGraph: any; + + /** + * results of code generation + */ + codeGenerationResults: Map< + internals.Module, + internals.CodeGenerationResult + >; + } + export interface RenderContextJavascriptModulesPlugin { + /** + * the chunk + */ + chunk: internals.Chunk; + + /** + * the dependency templates + */ + dependencyTemplates: internals.DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + + /** + * results of code generation + */ + codeGenerationResults: Map< + internals.Module, + internals.CodeGenerationResult + >; + } + export interface RenderContextModuleTemplate { + /** + * the chunk + */ + chunk: internals.Chunk; + + /** + * the dependency templates + */ + dependencyTemplates: internals.DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + } + export interface RenderManifestEntry { + render: () => internals.Source; + filenameTemplate: + | string + | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + pathOptions?: internals.PathData; + identifier: string; + hash?: string; + auxiliary?: boolean; + } + export interface RenderManifestOptions { + /** + * the chunk used to render + */ + chunk: internals.Chunk; + hash: string; + fullHash: string; + outputOptions: any; + codeGenerationResults: Map< + internals.Module, + internals.CodeGenerationResult + >; + moduleTemplates: { javascript: internals.ModuleTemplate }; + dependencyTemplates: internals.DependencyTemplates; + runtimeTemplate: internals.RuntimeTemplate; + moduleGraph: internals.ModuleGraph; + chunkGraph: internals.ChunkGraph; + } + export abstract class ReplaceSource extends internals.Source { + replace(start: number, end: number, newValue: string, name: string): void; + insert(pos: number, newValue: string, name: string): void; + getName(): string; + original(): string; + getReplacements(): Array<{ + start: number; + end: number; + content: string; + insertIndex: number; + name: string; + }>; + } + export abstract class RequestShortener { + contextify: (arg0: string) => string; + shorten(request: string): string; + } + + /** + * istanbul ignore next + */ + export interface ResolveBuildDependenciesResult { + /** + * list of files + */ + files: Set; + + /** + * list of directories + */ + directories: Set; + + /** + * list of missing entries + */ + missing: Set; + + /** + * stored resolve results + */ + resolveResults: Map; + + /** + * dependencies of the resolving + */ + resolveDependencies: { + /** + * list of files + */ + files: Set; + /** + * list of directories + */ + directories: Set; + /** + * list of missing entries + */ + missing: Set; + }; + } + export interface ResolveContext { + log?: (message: string) => void; + fileDependencies?: internals.WriteOnlySet; + contextDependencies?: internals.WriteOnlySet; + missingDependencies?: internals.WriteOnlySet; + stack?: Set; + } + export interface ResolveData { + contextInfo: internals.ModuleFactoryCreateDataContextInfo; + resolveOptions: any; + context: string; + request: string; + dependencies: Array; + createData: any; + fileDependencies: internals.LazySet; + missingDependencies: internals.LazySet; + contextDependencies: internals.LazySet; + } + + /** + * Options object for resolving requests. + */ + export interface ResolveOptions { + /** + * Redirect module requests. + */ + alias?: + | Array<{ + /** + * New request. + */ + alias: string | false | Array; + /** + * Request to be redirected. + */ + name: string; + /** + * Redirect only exact matching request. + */ + onlyModule?: boolean; + }> + | { [index: string]: string | false | Array }; + + /** + * Fields in the description file (usually package.json) which are used to redirect requests inside the module. + */ + aliasFields?: Array>; + + /** + * Enable caching of successfully resolved requests (cache entries are revalidated). + */ + cache?: boolean; + + /** + * Predicate function to decide which requests should be cached. + */ + cachePredicate?: Function; + + /** + * Include the context information in the cache identifier when caching. + */ + cacheWithContext?: boolean; + + /** + * Filenames used to find a description file (like a package.json). + */ + descriptionFiles?: Array; + + /** + * Enforce using one of the extensions from the extensions option. + */ + enforceExtension?: boolean; + + /** + * Extensions added to the request when trying to find the file. + */ + extensions?: Array; + + /** + * Filesystem for the resolver. + */ + fileSystem?: { [index: string]: any }; + + /** + * Field names from the description file (package.json) which are used to find the default entry point. + */ + mainFields?: Array>; + + /** + * Filenames used to find the default entry point if there is no description file or main field. + */ + mainFiles?: Array; + + /** + * Folder names or directory paths where to find modules. + */ + modules?: Array; + + /** + * Plugins for the resolver. + */ + plugins?: Array; + + /** + * Custom resolver. + */ + resolver?: { [index: string]: any }; + + /** + * Enable resolving symlinks to the original location. + */ + symlinks?: boolean; + + /** + * Enable caching of successfully resolved requests (cache entries are not revalidated). + */ + unsafeCache?: boolean | { [index: string]: any }; + + /** + * Use synchronous filesystem calls for the resolver. + */ + useSyncFileSystemCalls?: boolean; + } + + /** + * Plugin instance. + */ + export interface ResolvePluginInstance { + [index: string]: any; + + /** + * The run point of the plugin, required method. + */ + apply: (resolver?: any) => void; + } + export abstract class Resolver { + resolve( + context: Object, + path: string, + request: string, + resolveContext: internals.ResolveContext, + callback: ( + err: NodeJS.ErrnoException, + result: string, + additionalInfo: Object + ) => void + ): void; + } + export interface ResolverCache { + direct: WeakMap; + stringified: Map; + } + export abstract class ResolverFactory { + hooks: Readonly<{ + resolveOptions: HookMap>; + resolver: HookMap>; + }>; + cache: Map; + get( + type: string, + resolveOptions?: any + ): internals.Resolver & internals.WithOptions; + } + export interface RuleSet { + /** + * map of references in the rule set (may grow over time) + */ + references: Map; + + /** + * execute the rule set + */ + exec: (arg0?: any) => Array; + } + export type RuleSetCondition = + | string + | RegExp + | { + /** + * Logical AND. + */ + and?: Array; + /** + * Logical NOT. + */ + not?: Array; + /** + * Logical OR. + */ + or?: Array; + } + | ((value: string) => boolean) + | Array; + export type RuleSetConditionAbsolute = + | string + | RegExp + | { + /** + * Logical AND. + */ + and?: Array; + /** + * Logical NOT. + */ + not?: Array; + /** + * Logical OR. + */ + or?: Array; + } + | ((value: string) => boolean) + | Array; + type RuleSetConditionAbsoluteWebpackOptions = + | string + | RegExp + | { + /** + * Logical AND. + */ + and?: Array; + /** + * Logical NOT. + */ + not?: Array; + /** + * Logical OR. + */ + or?: Array; + } + | ((value: string) => boolean) + | Array; + type RuleSetConditionWebpackOptions = + | string + | RegExp + | { + /** + * Logical AND. + */ + and?: Array; + /** + * Logical NOT. + */ + not?: Array; + /** + * Logical OR. + */ + or?: Array; + } + | ((value: string) => boolean) + | Array; + export type RuleSetLoaderOptions = string | { [index: string]: any }; + + /** + * A rule description with conditions and effects for modules. + */ + export interface RuleSetRule { + /** + * Match the child compiler name. + */ + compiler?: + | string + | RegExp + | { + /** + * Logical AND. + */ + and?: Array; + /** + * Logical NOT. + */ + not?: Array; + /** + * Logical OR. + */ + or?: Array; + } + | ((value: string) => boolean) + | Array; + + /** + * Enforce this rule as pre or post step. + */ + enforce?: "pre" | "post"; + + /** + * Shortcut for resource.exclude. + */ + exclude?: + | string + | RegExp + | { + /** + * Logical AND. + */ + and?: Array; + /** + * Logical NOT. + */ + not?: Array; + /** + * Logical OR. + */ + or?: Array; + } + | ((value: string) => boolean) + | Array; + + /** + * The options for the module generator. + */ + generator?: { [index: string]: any }; + + /** + * Shortcut for resource.include. + */ + include?: RuleSetConditionAbsoluteWebpackOptions; + + /** + * Match the issuer of the module (The module pointing to this module). + */ + issuer?: RuleSetConditionAbsoluteWebpackOptions; + + /** + * Shortcut for use.loader. + */ + loader?: string; + + /** + * Only execute the first matching rule in this array. + */ + oneOf?: Array; + + /** + * Shortcut for use.options. + */ + options?: string | { [index: string]: any }; + + /** + * Options for parsing. + */ + parser?: { [index: string]: any }; + + /** + * Match the real resource path of the module. + */ + realResource?: RuleSetConditionAbsoluteWebpackOptions; + + /** + * Options for the resolver. + */ + resolve?: internals.ResolveOptions; + + /** + * Match the resource path of the module. + */ + resource?: RuleSetConditionAbsoluteWebpackOptions; + + /** + * Match the resource query of the module. + */ + resourceQuery?: RuleSetConditionWebpackOptions; + + /** + * Match and execute these rules when this rule is matched. + */ + rules?: Array; + + /** + * Flags a module as with or without side effects. + */ + sideEffects?: boolean; + + /** + * Shortcut for resource.test. + */ + test?: RuleSetConditionAbsoluteWebpackOptions; + + /** + * Module type to use for the module. + */ + type?: string; + + /** + * Modifiers applied to the module when rule is matched. + */ + use?: + | string + | Array< + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | ((data: {}) => + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | __TypeWebpackOptions + | Array) + > + | ((data: {}) => Array) + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | __TypeWebpackOptions; + } + export type RuleSetUse = + | string + | Array< + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | ((data: {}) => + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | __TypeWebpackOptions + | Array) + > + | ((data: {}) => Array) + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | __TypeWebpackOptions; + export type RuleSetUseItem = + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | __TypeWebpackOptions; + type RuleSetUseItemWebpackOptions = + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | ((data: {}) => + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | __TypeWebpackOptions + | Array); + export type RulesBannerPlugin = string | RegExp | Array; + export type RulesSourceMapDevToolPlugin = + | string + | RegExp + | Array; + export class RuntimeChunkPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export namespace RuntimeGlobals { + export let require: string; + export let requireScope: string; + export let exports: string; + export let thisAsExports: string; + export let returnExportsFromRuntime: string; + export let module: string; + export let moduleId: string; + export let moduleLoaded: string; + export let publicPath: string; + export let entryModuleId: string; + export let moduleCache: string; + export let moduleFactories: string; + export let moduleFactoriesAddOnly: string; + export let ensureChunk: string; + export let ensureChunkHandlers: string; + export let ensureChunkIncludeEntries: string; + export let prefetchChunk: string; + export let prefetchChunkHandlers: string; + export let preloadChunk: string; + export let preloadChunkHandlers: string; + export let definePropertyGetters: string; + export let makeNamespaceObject: string; + export let createFakeNamespaceObject: string; + export let compatGetDefaultExport: string; + export let harmonyModuleDecorator: string; + export let nodeModuleDecorator: string; + export let getFullHash: string; + export let wasmInstances: string; + export let instantiateWasm: string; + export let uncaughtErrorHandler: string; + export let scriptNonce: string; + export let chunkName: string; + export let getChunkScriptFilename: string; + export let getChunkUpdateScriptFilename: string; + export let startup: string; + export let startupNoDefault: string; + export let interceptModuleExecution: string; + export let global: string; + export let getUpdateManifestFilename: string; + export let hmrDownloadManifest: string; + export let hmrDownloadUpdateHandlers: string; + export let hmrModuleData: string; + export let hmrInvalidateModuleHandlers: string; + export let amdDefine: string; + export let amdOptions: string; + export let system: string; + export let hasOwnProperty: string; + export let systemContext: string; + } + export class RuntimeModule extends internals.Module { + constructor(name: string, stage?: number); + name: string; + stage: number; + compilation: internals.Compilation; + chunk: internals.Chunk; + attach(compilation: internals.Compilation, chunk: internals.Chunk): void; + generate(): string; + getGeneratedCode(): string; + } + export abstract class RuntimeTemplate { + outputOptions: internals.Output; + requestShortener: internals.RequestShortener; + isIIFE(): boolean; + supportsConst(): boolean; + supportsArrowFunction(): boolean; + supportsForOf(): boolean; + returningFunction(returnValue?: any, args?: string): string; + basicFunction(args?: any, body?: any): string; + iife(args?: any, body?: any): string; + forEach(variable?: any, array?: any, body?: any): string; + + /** + * Add a comment + */ + comment(__0: { + /** + * request string used originally + */ + request?: string; + /** + * name of the chunk referenced + */ + chunkName?: string; + /** + * reason information of the chunk + */ + chunkReason?: string; + /** + * additional message + */ + message?: string; + /** + * name of the export + */ + exportName?: string; + }): string; + throwMissingModuleErrorBlock(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + throwMissingModuleErrorFunction(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + missingModule(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + missingModuleStatement(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + missingModulePromise(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + weakError(__0: { + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + /** + * the module + */ + module: internals.Module; + /** + * the request that should be printed as comment + */ + request: string; + /** + * expression to use as id expression + */ + idExpr?: string; + /** + * which kind of code should be returned + */ + type: "expression" | "promise" | "statements"; + }): string; + moduleId(__0: { + /** + * the module + */ + module: internals.Module; + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + }): string; + moduleRaw(__0: { + /** + * the module + */ + module: internals.Module; + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + moduleExports(__0: { + /** + * the module + */ + module: internals.Module; + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + moduleNamespace(__0: { + /** + * the module + */ + module: internals.Module; + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * if the current module is in strict esm mode + */ + strict?: boolean; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + moduleNamespacePromise(__0: { + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + /** + * the current dependencies block + */ + block?: internals.AsyncDependenciesBlock; + /** + * the module + */ + module: internals.Module; + /** + * the request that should be printed as comment + */ + request: string; + /** + * a message for the comment + */ + message: string; + /** + * if the current module is in strict esm mode + */ + strict?: boolean; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + importStatement(__0: { + /** + * whether a new variable should be created or the existing one updated + */ + update?: boolean; + /** + * the module + */ + module: internals.Module; + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * name of the import variable + */ + importVar: string; + /** + * module in which the statement is emitted + */ + originModule: internals.Module; + /** + * true, if this is a weak dependency + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + exportFromImport(__0: { + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + /** + * the module + */ + module: internals.Module; + /** + * the request + */ + request: string; + /** + * the export name + */ + exportName: string | Array; + /** + * the origin module + */ + originModule: internals.Module; + /** + * true, if location is safe for ASI, a bracket can be emitted + */ + asiSafe: boolean; + /** + * true, if expression will be called + */ + isCall: boolean; + /** + * when false, call context will not be preserved + */ + callContext: boolean; + /** + * when true and accessing the default exports, interop code will be generated + */ + defaultInterop: boolean; + /** + * the identifier name of the import variable + */ + importVar: string; + /** + * init fragments will be added here + */ + initFragments: Array; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + blockPromise(__0: { + /** + * the async block + */ + block: internals.AsyncDependenciesBlock; + /** + * the message + */ + message: string; + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + defineEsModuleFlagStatement(__0: { + /** + * the name of the exports object + */ + exportsArgument: string; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + } + export abstract class RuntimeValue { + fn: any; + fileDependencies: any; + exec(parser?: any): any; + } + export const SKIP_OVER_NAME: unique symbol; + export interface ScopeInfo { + definitions: internals.StackedMap< + string, + internals.ScopeInfo | internals.VariableInfo + >; + topLevelScope: boolean | "arrow"; + inShorthand: boolean; + isStrict: boolean; + isAsmJs: boolean; + inTry: boolean; + } + export abstract class Serializer { + serializeMiddlewares: any; + deserializeMiddlewares: any; + context: any; + serialize(obj?: any, context?: any): any; + deserialize(value?: any, context?: any): any; + } + export class SideEffectsFlagPlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + static moduleHasSideEffects( + moduleName?: any, + flagValue?: any, + cache?: any + ): any; + } + + /** + * istanbul ignore next + */ + export interface Snapshot { + startTime?: number; + fileTimestamps?: Map; + fileHashes?: Map; + contextTimestamps?: Map; + contextHashes?: Map; + missingExistence?: Map; + managedItemInfo?: Map; + children?: Set; + } + export abstract class SortableSet extends Set { + /** + * Sort with a comparer function + */ + sortWith(sortFn: (arg0: T, arg1: T) => number): void; + sort(): void; + + /** + * Get data from cache + */ + getFromCache(fn: (arg0: internals.SortableSet) => R): R; + + /** + * Get data from cache (ignoring sorting) + */ + getFromUnorderedCache(fn: (arg0: internals.SortableSet) => R): R; + toJSON(): Array; + } + export abstract class Source { + size(): number; + map(options: internals.MapOptions): Object; + sourceAndMap( + options: internals.MapOptions + ): { source: string | Buffer; map: Object }; + updateHash(hash: internals.Hash): void; + source(): string | Buffer; + buffer(): Buffer; + } + export interface SourceContext { + /** + * the dependency templates + */ + dependencyTemplates: internals.DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: internals.RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: internals.ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: internals.ChunkGraph; + + /** + * the type of source that should be generated + */ + type?: string; + } + export class SourceMapDevToolPlugin { + constructor(options?: internals.SourceMapDevToolPluginOptions); + sourceMapFilename: string | false; + sourceMappingURLComment: string | false; + moduleFilenameTemplate: string | Function; + fallbackModuleFilenameTemplate: string | Function; + namespace: string; + options: internals.SourceMapDevToolPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface SourceMapDevToolPluginOptions { + /** + * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending. + */ + append?: string | false; + + /** + * Indicates whether column mappings should be used (defaults to true). + */ + columns?: boolean; + + /** + * Exclude modules that match the given value from source map generation. + */ + exclude?: string | RegExp | Array; + + /** + * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict. + */ + fallbackModuleFilenameTemplate?: string | Function; + + /** + * Path prefix to which the [file] placeholder is relative to. + */ + fileContext?: string; + + /** + * Defines the output filename of the SourceMap (will be inlined if no value is provided). + */ + filename?: string | false; + + /** + * Include source maps for module paths that match the given value. + */ + include?: string | RegExp | Array; + + /** + * Indicates whether SourceMaps from loaders should be used (defaults to true). + */ + module?: boolean; + + /** + * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap. + */ + moduleFilenameTemplate?: string | Function; + + /** + * Namespace prefix to allow multiple webpack roots in the devtools. + */ + namespace?: string; + + /** + * Omit the 'sourceContents' array from the SourceMap. + */ + noSources?: boolean; + + /** + * Provide a custom public path for the SourceMapping comment. + */ + publicPath?: string; + + /** + * Provide a custom value for the 'sourceRoot' property in the SourceMap. + */ + sourceRoot?: string; + + /** + * Include source maps for modules based on their extension (defaults to .js and .css). + */ + test?: string | RegExp | Array; + } + export interface SourcePosition { + line: number; + column?: number; + } + export interface SplitChunksOptions { + chunksFilter: (chunk: internals.Chunk) => boolean; + minSize: Record; + minRemainingSize: Record; + maxInitialSize: Record; + maxAsyncSize: Record; + minChunks: number; + maxAsyncRequests: number; + maxInitialRequests: number; + hidePathInfo: boolean; + filename: + | string + | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + automaticNameDelimiter: string; + getCacheGroups: ( + module: internals.Module, + context: internals.CacheGroupsContext + ) => Array; + getName: ( + module?: internals.Module, + chunks?: Array, + key?: string + ) => string; + fallbackCacheGroup: internals.FallbackCacheGroup; + } + export class SplitChunksPlugin { + constructor(options?: internals.OptimizationSplitChunksOptions); + options: internals.SplitChunksOptions; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export abstract class StackedMap { + map: Map< + K, + V | typeof internals.TOMBSTONE | typeof internals.UNDEFINED_MARKER + >; + stack: Array< + Map + >; + set(item: K, value: V): void; + delete(item: K): void; + has(item: K): boolean; + get(item: K): V; + asArray(): Array; + asSet(): Set; + asPairArray(): Array<[K, V]>; + asMap(): Map; + readonly size: number; + createChild(): internals.StackedMap; + } + export type Statement = + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration; + export class Stats { + constructor(compilation: internals.Compilation); + compilation: internals.Compilation; + hash: string; + startTime: any; + endTime: any; + hasWarnings(): boolean; + hasErrors(): boolean; + toJson(options?: any): any; + toString(options?: any): any; + } + export abstract class StatsFactory { + hooks: Readonly<{ + extract: HookMap>; + filter: HookMap>; + sort: HookMap< + SyncBailHook<[Array<(arg0?: any, arg1?: any) => number>, any], any> + >; + filterSorted: HookMap>; + sortResults: HookMap< + SyncBailHook<[Array<(arg0?: any, arg1?: any) => number>, any], any> + >; + filterResults: HookMap>; + merge: HookMap, any], any>>; + result: HookMap, any], any>>; + getItemName: HookMap>; + getItemFactory: HookMap>; + }>; + create(type?: any, data?: any, baseContext?: any): any; + } + + /** + * Stats options object. + */ + export interface StatsOptions { + /** + * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults). + */ + all?: boolean; + + /** + * Add assets information. + */ + assets?: boolean; + + /** + * Sort the assets by that field. + */ + assetsSort?: string; + + /** + * Add built at time information. + */ + builtAt?: boolean; + + /** + * Add information about cached (not built) modules. + */ + cached?: boolean; + + /** + * Show cached assets (setting this to `false` only shows emitted files). + */ + cachedAssets?: boolean; + + /** + * Add children information. + */ + children?: boolean; + + /** + * Display all chunk groups with the corresponding bundles. + */ + chunkGroups?: boolean; + + /** + * Add built modules information to chunk information. + */ + chunkModules?: boolean; + + /** + * Add the origins of chunks and chunk merging info. + */ + chunkOrigins?: boolean; + + /** + * Add information about parent, children and sibling chunks to chunk information. + */ + chunkRelations?: boolean; + + /** + * Add root modules information to chunk information. + */ + chunkRootModules?: boolean; + + /** + * Add chunk information. + */ + chunks?: boolean; + + /** + * Sort the chunks by that field. + */ + chunksSort?: string; + + /** + * Enables/Disables colorful output. + */ + colors?: + | boolean + | { + /** + * Custom color for bold text. + */ + bold?: string; + /** + * Custom color for cyan text. + */ + cyan?: string; + /** + * Custom color for green text. + */ + green?: string; + /** + * Custom color for magenta text. + */ + magenta?: string; + /** + * Custom color for red text. + */ + red?: string; + /** + * Custom color for yellow text. + */ + yellow?: string; + }; + + /** + * Context directory for request shortening. + */ + context?: string; + + /** + * Add module depth in module graph. + */ + depth?: boolean; + + /** + * Display the entry points with the corresponding bundles. + */ + entrypoints?: boolean; + + /** + * Add --env information. + */ + env?: boolean; + + /** + * Add details to errors (like resolving log). + */ + errorDetails?: boolean; + + /** + * Add internal stack trace to errors. + */ + errorStack?: boolean; + + /** + * Add errors. + */ + errors?: boolean; + + /** + * Please use excludeModules instead. + */ + exclude?: + | string + | boolean + | RegExp + | Array boolean)> + | ((value: string) => boolean); + + /** + * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions. + */ + excludeAssets?: + | string + | RegExp + | Array boolean)> + | ((value: string) => boolean); + + /** + * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions. + */ + excludeModules?: + | string + | boolean + | RegExp + | Array boolean)> + | ((value: string) => boolean); + + /** + * Add the hash of the compilation. + */ + hash?: boolean; + + /** + * Add ids. + */ + ids?: boolean; + + /** + * Add logging output. + */ + logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log"; + + /** + * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions. + */ + loggingDebug?: + | string + | boolean + | RegExp + | Array boolean)> + | ((value: string) => boolean); + + /** + * Add stack traces to logging output. + */ + loggingTrace?: boolean; + + /** + * Set the maximum number of modules to be shown. + */ + maxModules?: number; + + /** + * Add information about assets inside modules. + */ + moduleAssets?: boolean; + + /** + * Add dependencies and origin of warnings/errors. + */ + moduleTrace?: boolean; + + /** + * Add built modules information. + */ + modules?: boolean; + + /** + * Sort the modules by that field. + */ + modulesSort?: string; + + /** + * Add information about modules nested in other modules (like with module concatenation). + */ + nestedModules?: boolean; + + /** + * Show reasons why optimization bailed out for modules. + */ + optimizationBailout?: boolean; + + /** + * Add information about orphan modules. + */ + orphanModules?: boolean; + + /** + * Add output path information. + */ + outputPath?: boolean; + + /** + * Add performance hint flags. + */ + performance?: boolean; + + /** + * Preset for the default values. + */ + preset?: string | boolean; + + /** + * Show exports provided by modules. + */ + providedExports?: boolean; + + /** + * Add public path information. + */ + publicPath?: boolean; + + /** + * Add information about the reasons why modules are included. + */ + reasons?: boolean; + + /** + * Add information about runtime modules. + */ + runtime?: boolean; + + /** + * Add the source code of modules. + */ + source?: boolean; + + /** + * Add timing information. + */ + timings?: boolean; + + /** + * Show exports used by modules. + */ + usedExports?: boolean; + + /** + * Add webpack version information. + */ + version?: boolean; + + /** + * Add warnings. + */ + warnings?: boolean; + + /** + * Suppress warnings that match the specified filters. Filters can be Strings, RegExps or Functions. + */ + warningsFilter?: + | string + | RegExp + | Array boolean)> + | ((value: string) => boolean); + } + export abstract class StatsPrinter { + hooks: Readonly<{ + sortElements: HookMap, any], any>>; + printElements: HookMap< + SyncBailHook<[Array, any], any> + >; + sortItems: HookMap, any], any>>; + getItemName: HookMap>; + printItems: HookMap, any], any>>; + print: HookMap>; + result: HookMap>; + }>; + print(type?: any, object?: any, baseContext?: any): any; + } + export type StatsValue = + | boolean + | "none" + | "errors-only" + | "minimal" + | "normal" + | "detailed" + | "verbose" + | "errors-warnings" + | internals.StatsOptions; + export interface SyntheticDependencyLocation { + name: string; + index?: number; + } + export const TOMBSTONE: unique symbol; + export interface TagInfo { + tag: any; + data: any; + next: internals.TagInfo; + } + export type Target = + | "web" + | "webworker" + | "node" + | "async-node" + | "node-webkit" + | "electron-main" + | "electron-renderer" + | "electron-preload" + | ((compiler: internals.Compiler) => void); + export class Template { + constructor(); + static getFunctionContent(fn: Function): string; + static toIdentifier(str: string): string; + static toComment(str: string): string; + static toNormalComment(str: string): string; + static toPath(str: string): string; + static numberToIdentifier(n: number): string; + static numberToIdentifierContinuation(n: number): string; + static indent(s: string | Array): string; + static prefix(s: string | Array, prefix: string): string; + static asString(str: string | Array): string; + static getModulesArrayBounds( + modules: Array + ): false | [number, number]; + static renderChunkModules( + renderContext: internals.RenderContextModuleTemplate, + modules: Array, + renderModule: (arg0: internals.Module) => internals.Source, + prefix?: string + ): internals.Source; + static renderRuntimeModules( + runtimeModules: Array, + renderContext: internals.RenderContextModuleTemplate + ): internals.Source; + static renderChunkRuntimeModules( + runtimeModules: Array, + renderContext: internals.RenderContextModuleTemplate + ): internals.Source; + static NUMBER_OF_IDENTIFIER_START_CHARS: number; + static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number; + } + export const UNDEFINED_MARKER: unique symbol; + export interface UpdateHashContext { + /** + * the module + */ + module: internals.NormalModule; + + /** + * the compilation + */ + compilation: internals.Compilation; + } + export abstract class VariableInfo { + declaredScope: internals.ScopeInfo; + freeName: string | true; + tagInfo: internals.TagInfo; + } + export class WatchIgnorePlugin { + constructor(options: internals.WatchIgnorePluginOptions); + paths: [string | RegExp, string | RegExp]; + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + + /** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ + export interface WatchIgnorePluginOptions { + /** + * A list of RegExps or absolute paths to directories or files that should be ignored. + */ + paths: [string | RegExp, string | RegExp]; + } + + /** + * Options for the watcher. + */ + export interface WatchOptions { + /** + * Delay the rebuilt after the first change. Value is a time in ms. + */ + aggregateTimeout?: number; + + /** + * Ignore some files from watching (glob pattern). + */ + ignored?: string | Array; + + /** + * Enable polling mode for watching. + */ + poll?: number | boolean; + + /** + * Stop watching when stdin stream has ended. + */ + stdin?: boolean; + } + export abstract class Watching { + startTime: number; + invalid: boolean; + handler: internals.CallbackCompiler; + callbacks: Array>; + closed: boolean; + suspended: boolean; + watchOptions: { + /** + * Delay the rebuilt after the first change. Value is a time in ms. + */ + aggregateTimeout?: number; + /** + * Ignore some files from watching (glob pattern). + */ + ignored?: string | Array; + /** + * Enable polling mode for watching. + */ + poll?: number | boolean; + /** + * Stop watching when stdin stream has ended. + */ + stdin?: boolean; + }; + compiler: internals.Compiler; + running: boolean; + watcher: any; + pausedWatcher: any; + watch( + files: Iterable, + dirs: Iterable, + missing: Iterable + ): void; + invalidate(callback: internals.CallbackCompiler): void; + suspend(): void; + resume(): void; + close(callback: internals.CallbackCompiler): void; + } + export class WebWorkerTemplatePlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: internals.Compiler): void; + } + export interface WebpackError extends Error { + details: any; + module: internals.Module; + loc: + | internals.SyntheticDependencyLocation + | internals.RealDependencyLocation; + hideStack: boolean; + chunk: internals.Chunk; + file: string; + serialize(__0: { write: any }): void; + deserialize(__0: { read: any }): void; + } + export abstract class WebpackLogger { + getChildLogger: (arg0: string | (() => string)) => internals.WebpackLogger; + error(...args: Array): void; + warn(...args: Array): void; + info(...args: Array): void; + log(...args: Array): void; + debug(...args: Array): void; + assert(assertion: any, ...args: Array): void; + trace(): void; + clear(): void; + status(...args: Array): void; + group(...args: Array): void; + groupCollapsed(...args: Array): void; + groupEnd(...args: Array): void; + profile(label?: any): void; + profileEnd(label?: any): void; + time(label?: any): void; + timeLog(label?: any): void; + timeEnd(label?: any): void; + timeAggregate(label?: any): void; + timeAggregateEnd(label?: any): void; + } + + /** + * Options object as provided by the user. + */ + export interface WebpackOptions { + /** + * Set the value of `require.amd` and `define.amd`. Or disable AMD support. + */ + amd?: false | { [index: string]: any }; + + /** + * Report the first error as a hard error instead of tolerating it. + */ + bail?: boolean; + + /** + * Cache generated modules and chunks to improve performance for multiple incremental builds. + */ + cache?: boolean | internals.MemoryCacheOptions | internals.FileCacheOptions; + + /** + * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. + */ + context?: string; + + /** + * References to other configurations to depend on. + */ + dependencies?: Array; + + /** + * Options for the webpack-dev-server. + */ + devServer?: internals.DevServer; + + /** + * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + */ + devtool?: string | false; + + /** + * The entry point(s) of the compilation. + */ + entry?: + | string + | (() => + | string + | internals.EntryObject + | [string, string] + | Promise) + | internals.EntryObject + | [string, string]; + + /** + * Enables/Disables experiments (experimental features with relax SemVer compatibility). + */ + experiments?: internals.Experiments; + + /** + * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. + */ + externals?: + | string + | RegExp + | Array< + | string + | RegExp + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void) + > + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void); + + /** + * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value). + */ + externalsType?: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + + /** + * Options for infrastructure level logging. + */ + infrastructureLogging?: internals.InfrastructureLogging; + + /** + * Custom values available in the loader context. + */ + loader?: internals.Loader; + + /** + * Enable production optimizations or development hints. + */ + mode?: "development" | "production" | "none"; + + /** + * Options affecting the normal modules (`NormalModuleFactory`). + */ + module?: internals.ModuleOptions; + + /** + * Name of the configuration. Used when loading multiple configurations. + */ + name?: string; + + /** + * Include polyfills or mocks for various node stuff. + */ + node?: false | internals.NodeOptions; + + /** + * Enables/Disables integrated optimizations. + */ + optimization?: internals.Optimization; + + /** + * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. + */ + output?: internals.Output; + + /** + * The number of parallel processed modules in the compilation. + */ + parallelism?: number; + + /** + * Configuration for web performance recommendations. + */ + performance?: false | internals.PerformanceOptions; + + /** + * Add additional plugins to the compiler. + */ + plugins?: Array< + internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + >; + + /** + * Capture timing information for each module. + */ + profile?: boolean; + + /** + * Store compiler state to a json file. + */ + recordsInputPath?: string | false; + + /** + * Load compiler state from a json file. + */ + recordsOutputPath?: string | false; + + /** + * Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined. + */ + recordsPath?: string | false; + + /** + * Options for the resolver. + */ + resolve?: internals.ResolveOptions; + + /** + * Options for the resolver when resolving loaders. + */ + resolveLoader?: internals.ResolveOptions; + + /** + * Stats options object or preset name. + */ + stats?: + | boolean + | "none" + | "errors-only" + | "minimal" + | "normal" + | "detailed" + | "verbose" + | "errors-warnings" + | internals.StatsOptions; + + /** + * Environment to build for. + */ + target?: + | "web" + | "webworker" + | "node" + | "async-node" + | "node-webkit" + | "electron-main" + | "electron-renderer" + | "electron-preload" + | ((compiler: internals.Compiler) => void); + + /** + * Enter watch mode, which rebuilds on file change. + */ + watch?: boolean; + + /** + * Options for the watcher. + */ + watchOptions?: internals.WatchOptions; + } + export class WebpackOptionsApply extends internals.OptionsApply { + constructor(); + } + export class WebpackOptionsDefaulter { + constructor(); + process(options?: any): any; + } + + /** + * Normalized webpack options object. + */ + export interface WebpackOptionsNormalized { + /** + * Set the value of `require.amd` and `define.amd`. Or disable AMD support. + */ + amd?: false | { [index: string]: any }; + + /** + * Report the first error as a hard error instead of tolerating it. + */ + bail?: boolean; + + /** + * Cache generated modules and chunks to improve performance for multiple incremental builds. + */ + cache: false | internals.MemoryCacheOptions | internals.FileCacheOptions; + + /** + * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. + */ + context?: string; + + /** + * References to other configurations to depend on. + */ + dependencies?: Array; + + /** + * Options for the webpack-dev-server. + */ + devServer?: internals.DevServer; + + /** + * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + */ + devtool?: string | false; + + /** + * The entry point(s) of the compilation. + */ + entry: + | (() => Promise) + | internals.EntryStaticNormalized; + + /** + * Enables/Disables experiments (experimental features with relax SemVer compatibility). + */ + experiments: internals.Experiments; + + /** + * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. + */ + externals: + | string + | RegExp + | Array< + | string + | RegExp + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void) + > + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void); + + /** + * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value). + */ + externalsType?: + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; + + /** + * Options for infrastructure level logging. + */ + infrastructureLogging: internals.InfrastructureLogging; + + /** + * Custom values available in the loader context. + */ + loader?: internals.Loader; + + /** + * Enable production optimizations or development hints. + */ + mode?: "development" | "production" | "none"; + + /** + * Options affecting the normal modules (`NormalModuleFactory`). + */ + module: internals.ModuleOptions; + + /** + * Name of the configuration. Used when loading multiple configurations. + */ + name?: string; + + /** + * Include polyfills or mocks for various node stuff. + */ + node: false | internals.NodeOptions; + + /** + * Enables/Disables integrated optimizations. + */ + optimization: internals.Optimization; + + /** + * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. + */ + output: internals.OutputNormalized; + + /** + * The number of parallel processed modules in the compilation. + */ + parallelism?: number; + + /** + * Configuration for web performance recommendations. + */ + performance?: false | internals.PerformanceOptions; + + /** + * Add additional plugins to the compiler. + */ + plugins: Array< + internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + >; + + /** + * Capture timing information for each module. + */ + profile?: boolean; + + /** + * Store compiler state to a json file. + */ + recordsInputPath?: string | false; + + /** + * Load compiler state from a json file. + */ + recordsOutputPath?: string | false; + + /** + * Options for the resolver. + */ + resolve: internals.ResolveOptions; + + /** + * Options for the resolver when resolving loaders. + */ + resolveLoader: internals.ResolveOptions; + + /** + * Stats options object or preset name. + */ + stats: + | boolean + | "none" + | "errors-only" + | "minimal" + | "normal" + | "detailed" + | "verbose" + | "errors-warnings" + | internals.StatsOptions; + + /** + * Environment to build for. + */ + target?: + | "web" + | "webworker" + | "node" + | "async-node" + | "node-webkit" + | "electron-main" + | "electron-renderer" + | "electron-preload" + | ((compiler: internals.Compiler) => void); + + /** + * Enter watch mode, which rebuilds on file change. + */ + watch?: boolean; + + /** + * Options for the watcher. + */ + watchOptions: internals.WatchOptions; + } + + /** + * Plugin instance. + */ + export interface WebpackPluginInstance { + [index: string]: any; + + /** + * The run point of the plugin, required method. + */ + apply: (compiler: internals.Compiler) => void; + } + export interface WithId { + id: string | number; + } + export interface WithOptions { + /** + * create a resolver with additional/different options + */ + withOptions: (arg0?: any) => internals.Resolver & internals.WithOptions; + } + export interface WriteOnlySet { + add(item: T): void; + } + export namespace __TypeLibIndex { + export let webpack: ( + options: internals.WebpackOptions | Array, + callback: internals.CallbackWebpack< + internals.Stats | internals.MultiStats + > + ) => internals.Compiler | internals.MultiCompiler; + export let validate: any; + export let validateSchema: (schema?: any, options?: any) => void; + export let version: any; + export const WebpackOptionsValidationError: ValidationError; + export const ValidationError: ValidationError; + export { + WebpackOptionsApply, + cli, + AutomaticPrefetchPlugin, + BannerPlugin, + Cache, + Compilation, + Compiler, + ContextExclusionPlugin, + ContextReplacementPlugin, + DefinePlugin, + DelegatedPlugin, + Dependency, + DllPlugin, + DllReferencePlugin, + EntryPlugin, + EnvironmentPlugin, + EvalDevToolModulePlugin, + EvalSourceMapDevToolPlugin, + ExternalsPlugin, + Generator, + HotModuleReplacementPlugin, + IgnorePlugin, + JavascriptModulesPlugin, + LibManifestPlugin, + LibraryTemplatePlugin, + LoaderOptionsPlugin, + LoaderTargetPlugin, + Module, + ModuleFilenameHelpers, + NoEmitOnErrorsPlugin, + NormalModule, + NormalModuleReplacementPlugin, + MultiCompiler, + Parser, + PrefetchPlugin, + ProgressPlugin, + ProvidePlugin, + RuntimeGlobals, + RuntimeModule, + EntryPlugin as SingleEntryPlugin, + SourceMapDevToolPlugin, + Stats, + Template, + WatchIgnorePlugin, + WebpackOptionsDefaulter, + __TypeLiteral_12 as cache, + __TypeLiteral_1 as config, + __TypeLiteral_2 as ids, + __TypeLiteral_3 as javascript, + __TypeLiteral_4 as optimize, + __TypeLiteral_5 as web, + __TypeLiteral_6 as webworker, + __TypeLiteral_7 as node, + __TypeLiteral_8 as wasm, + __TypeLiteral_9 as library, + __TypeLiteral_10 as debug, + __TypeLiteral_11 as util + }; + } + export namespace __TypeLiteral_1 { + export const getNormalizedWebpackOptions: ( + config: internals.WebpackOptions + ) => internals.WebpackOptionsNormalized; + export const applyWebpackOptionsDefaults: ( + options: internals.WebpackOptionsNormalized + ) => void; + } + export namespace __TypeLiteral_10 { + export { ProfilingPlugin }; + } + export namespace __TypeLiteral_11 { + export const createHash: ( + algorithm: string | typeof internals.Hash + ) => internals.Hash; + export { comparators, serialization }; + } + export namespace __TypeLiteral_12 { + export { MemoryCachePlugin }; + } + export namespace __TypeLiteral_2 { + export { + ChunkModuleIdRangePlugin, + NaturalModuleIdsPlugin, + OccurrenceModuleIdsPlugin, + NamedModuleIdsPlugin, + DeterministicModuleIdsPlugin, + NamedChunkIdsPlugin, + OccurrenceChunkIdsPlugin, + HashedModuleIdsPlugin + }; + } + export namespace __TypeLiteral_3 { + export { JavascriptModulesPlugin }; + } + export namespace __TypeLiteral_4 { + export { + AggressiveMergingPlugin, + AggressiveSplittingPlugin, + LimitChunkCountPlugin, + MinChunkSizePlugin, + ModuleConcatenationPlugin, + RuntimeChunkPlugin, + SideEffectsFlagPlugin, + SplitChunksPlugin + }; + } + export namespace __TypeLiteral_5 { + export { FetchCompileWasmPlugin, JsonpTemplatePlugin }; + } + export namespace __TypeLiteral_6 { + export { WebWorkerTemplatePlugin }; + } + export namespace __TypeLiteral_7 { + export { + NodeEnvironmentPlugin, + NodeTemplatePlugin, + ReadFileCompileWasmPlugin + }; + } + export namespace __TypeLiteral_8 { + export { AsyncWebAssemblyModulesPlugin }; + } + export namespace __TypeLiteral_9 { + export { AbstractLibraryPlugin, EnableLibraryPlugin }; + } + type __TypeWebpackOptions = (data: {}) => + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: string | { [index: string]: any }; + } + | __TypeWebpackOptions + | Array; + export namespace cli { + export let getArguments: ( + schema?: any + ) => Record; + export let processArguments: ( + args: Record, + config: any, + values: Record< + string, + | string + | number + | boolean + | RegExp + | Array + > + ) => Array; + } + export namespace comparators { + export let compareChunksById: ( + a: internals.Chunk, + b: internals.Chunk + ) => 0 | 1 | -1; + export let compareModulesByIdentifier: ( + a: internals.Module, + b: internals.Module + ) => 0 | 1 | -1; + export let compareModulesById: ( + arg0: internals.ChunkGraph + ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + export let compareNumbers: (a: number, b: number) => 0 | 1 | -1; + export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1; + export let compareModulesByPostOrderIndexOrIdentifier: ( + arg0: internals.ModuleGraph + ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + export let compareModulesByPreOrderIndexOrIdentifier: ( + arg0: internals.ModuleGraph + ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + export let compareModulesByIdOrIdentifier: ( + arg0: internals.ChunkGraph + ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + export let compareChunks: ( + arg0: internals.ChunkGraph + ) => (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1; + export let compareIds: ( + a: string | number, + b: string | number + ) => 0 | 1 | -1; + export let compareChunkGroupsByIndex: ( + a: internals.ChunkGroup, + b: internals.ChunkGroup + ) => 0 | 1 | -1; + export let concatComparators: ( + c1: (arg0: T, arg1: T) => 0 | 1 | -1, + c2: (arg0: T, arg1: T) => 0 | 1 | -1, + ...cRest: Array<(arg0: T, arg1: T) => 0 | 1 | -1> + ) => (arg0: T, arg1: T) => 0 | 1 | -1; + export let compareSelect: ( + getter: (input: T) => R, + comparator: (arg0: R, arg1: R) => 0 | 1 | -1 + ) => (arg0: T, arg1: T) => 0 | 1 | -1; + export let compareIterables: ( + elementComparator: (arg0: T, arg1: T) => 0 | 1 | -1 + ) => (arg0: Iterable, arg1: Iterable) => 0 | 1 | -1; + export let keepOriginalOrder: ( + iterable: Iterable + ) => (arg0: T, arg1: T) => 0 | 1 | -1; + export let compareChunksNatural: ( + chunkGraph: internals.ChunkGraph + ) => (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1; + export let compareLocations: ( + a: + | internals.SyntheticDependencyLocation + | internals.RealDependencyLocation, + b: + | internals.SyntheticDependencyLocation + | internals.RealDependencyLocation + ) => 0 | 1 | -1; + } + export function exports( + options: internals.WebpackOptions | Array, + callback: internals.CallbackWebpack + ): internals.Compiler | internals.MultiCompiler; + export namespace exports { + export let webpack: ( + options: internals.WebpackOptions | Array, + callback: internals.CallbackWebpack< + internals.Stats | internals.MultiStats + > + ) => internals.Compiler | internals.MultiCompiler; + export let validate: any; + export let validateSchema: (schema?: any, options?: any) => void; + export let version: any; + export const WebpackOptionsValidationError: ValidationError; + export const ValidationError: ValidationError; + export { + WebpackOptionsApply, + cli, + AutomaticPrefetchPlugin, + BannerPlugin, + Cache, + Compilation, + Compiler, + ContextExclusionPlugin, + ContextReplacementPlugin, + DefinePlugin, + DelegatedPlugin, + Dependency, + DllPlugin, + DllReferencePlugin, + EntryPlugin, + EnvironmentPlugin, + EvalDevToolModulePlugin, + EvalSourceMapDevToolPlugin, + ExternalsPlugin, + Generator, + HotModuleReplacementPlugin, + IgnorePlugin, + JavascriptModulesPlugin, + LibManifestPlugin, + LibraryTemplatePlugin, + LoaderOptionsPlugin, + LoaderTargetPlugin, + Module, + ModuleFilenameHelpers, + NoEmitOnErrorsPlugin, + NormalModule, + NormalModuleReplacementPlugin, + MultiCompiler, + Parser, + PrefetchPlugin, + ProgressPlugin, + ProvidePlugin, + RuntimeGlobals, + RuntimeModule, + EntryPlugin as SingleEntryPlugin, + SourceMapDevToolPlugin, + Stats, + Template, + WatchIgnorePlugin, + WebpackOptionsDefaulter, + __TypeLiteral_12 as cache, + __TypeLiteral_1 as config, + __TypeLiteral_2 as ids, + __TypeLiteral_3 as javascript, + __TypeLiteral_4 as optimize, + __TypeLiteral_5 as web, + __TypeLiteral_6 as webworker, + __TypeLiteral_7 as node, + __TypeLiteral_8 as wasm, + __TypeLiteral_9 as library, + __TypeLiteral_10 as debug, + __TypeLiteral_11 as util, + WebpackOptions as Configuration + }; + } + export namespace serialization { + export let register: ( + Constructor: { new (...params: Array): any }, + request: string, + name: string, + serializer: internals.ObjectSerializer + ) => void; + export let registerLoader: ( + regExp: RegExp, + loader: (arg0: string) => boolean + ) => void; + export let registerNotSerializable: (Constructor: { + new (...params: Array): any; + }) => void; + export let NOT_SERIALIZABLE: {}; + export let buffersSerializer: internals.Serializer; + export let createFileSerializer: (fs?: any) => internals.Serializer; + export { MEASURE_START_OPERATION, MEASURE_END_OPERATION }; + } +} + +export = internals.exports; diff --git a/yarn.lock b/yarn.lock index 62f228fb1..2103623af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -448,7 +448,7 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" -"@jest/types@^25.4.0": +"@jest/types@^25.1.0", "@jest/types@^25.4.0": version "25.4.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.4.0.tgz#5afeb8f7e1cba153a28e5ac3c9fe3eede7206d59" integrity sha512-XBeaWNzw2PPnGW5aXvZt3+VO60M+34RY3XDsCK5tW7kyj3RK0XClRutCfjqcBuaR2aBQTbluEDME9b5MB9UAPw== @@ -552,6 +552,14 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" +"@types/jest@^25.1.5": + version "25.1.5" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.1.5.tgz#3c3c078b3cd19c6403e21277f1cfdc0ce5ebf9a9" + integrity sha512-FBmb9YZHoEOH56Xo/PIYtfuyTL0IzJLM3Hy0Sqc82nn5eqqXgefKcl/eMgChM8eSGVfoDee8cdlj7K74T8a6Yg== + dependencies: + jest-diff "25.1.0" + pretty-format "25.1.0" + "@types/json-schema@^7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" @@ -2205,7 +2213,7 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -diff-sequences@^25.2.6: +diff-sequences@^25.1.0, diff-sequences@^25.2.6: version "25.2.6" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== @@ -3722,6 +3730,16 @@ jest-config@^25.4.0: pretty-format "^25.4.0" realpath-native "^2.0.0" +jest-diff@25.1.0: + version "25.1.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.1.0.tgz#58b827e63edea1bc80c1de952b80cec9ac50e1ad" + integrity sha512-nepXgajT+h017APJTreSieh4zCqnSHEJ1iT8HDlewu630lSJ4Kjjr9KNzm+kzGwwcpsDE6Snx1GJGzzsefaEHw== + dependencies: + chalk "^3.0.0" + diff-sequences "^25.1.0" + jest-get-type "^25.1.0" + pretty-format "^25.1.0" + jest-diff@^25.1.0, jest-diff@^25.4.0: version "25.4.0" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.4.0.tgz#260b70f19a46c283adcad7f081cae71eb784a634" @@ -3779,7 +3797,7 @@ jest-get-type@^24.9.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== -jest-get-type@^25.2.6: +jest-get-type@^25.1.0, jest-get-type@^25.2.6: version "25.2.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== @@ -4156,7 +4174,7 @@ json-schema-ref-parser@^6.1.0: js-yaml "^3.12.1" ono "^4.0.11" -json-schema-to-typescript@^8.1.0: +json-schema-to-typescript@^8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/json-schema-to-typescript/-/json-schema-to-typescript-8.2.0.tgz#a859f836df89db63c5f17a6c9c2f1dea93e8dd9b" integrity sha512-yvi4v9oLeJzJCktt+Zta6kOgEu8R93gNMZUJYo83aAPxoG0qB+cXIxVg5xa6gmdNkyffjH9Ebw1rvyaJKIor5A== @@ -5434,6 +5452,16 @@ prettier@^1.19.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +pretty-format@25.1.0: + version "25.1.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.1.0.tgz#ed869bdaec1356fc5ae45de045e2c8ec7b07b0c8" + integrity sha512-46zLRSGLd02Rp+Lhad9zzuNZ+swunitn8zIpfD2B4OPCRLXbM87RJT2aBLBWYOznNUML/2l/ReMyWNC80PJBUQ== + dependencies: + "@jest/types" "^25.1.0" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + pretty-format@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" @@ -6737,6 +6765,16 @@ toml@^3.0.0: resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== +tooling@webpack/tooling: + version "1.0.0" + resolved "https://codeload.github.com/webpack/tooling/tar.gz/c960d3590c197b9a68a17c5f0ca4896623c6c0d6" + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + commondir "^1.0.1" + glob "^7.1.6" + json-schema-to-typescript "^8.2.0" + yargs "^15.3.1" + tough-cookie@^2.3.3: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" From 6178aea763e842943fd9f42ed927e451b430fc35 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 20 Apr 2020 07:36:55 +0200 Subject: [PATCH 22/30] improve typings and test them in CI lazy load all webpack exports --- declarations.test.d.ts | 18 + declarations/WebpackOptions.d.ts | 8 +- lib/index.js | 118 +- package.json | 6 +- schemas/WebpackOptions.json | 2 +- .../large-ast/webpack.config.js | 1 + .../libraries/webpack.config.js | 1 + .../many-chunks/webpack.config.js | 1 + .../many-modules-source-map/webpack.config.js | 1 + .../many-modules/webpack.config.js | 1 + .../additional-pass/simple/webpack.config.js | 2 + .../amd/disabled/webpack.config.js | 1 + .../asset-emitted/normal/webpack.config.js | 1 + .../assetModuleFilename/webpack.config.js | 1 + .../custom-condition/webpack.config.js | 1 + .../custom-encoder/webpack.config.js | 1 + .../asset-modules/data-url/webpack.config.js | 1 + .../file-loader/webpack.config.js | 1 + .../asset-modules/opus/webpack.config.js | 1 + .../overridePath/webpack.config.js | 1 + .../asset-modules/path/webpack.config.js | 1 + .../publicPath/webpack.config.js | 1 + .../asset-modules/source/webpack.config.js | 1 + .../asset-modules/types/webpack.config.js | 1 + .../all-selected/webpack.config.js | 1 + .../duplicate/webpack.config.js | 1 + .../existing-name/webpack.config.js | 1 + .../nested/webpack.config.js | 1 + .../node/webpack.config.js | 1 + .../simple/webpack.config.js | 1 + .../chunk-graph/issue-9634/webpack.config.js | 1 + .../order-multiple-entries/webpack.config.js | 18 +- .../harmony-pure-default/webpack.config.js | 1 + .../require-context-id/webpack.config.js | 1 + .../use-strict/webpack.config.js | 1 + .../error-not-found/webpack.config.js | 1 + .../load-chunk-function/webpack.config.js | 1 + .../rename-10168/webpack.config.js | 1 + .../webpack.config.js | 1 + .../simple/webpack.config.js | 1 + .../System.import/webpack.config.js | 1 + .../context-replacement/a/webpack.config.js | 1 + .../context-replacement/b/webpack.config.js | 1 + .../context-replacement/c/webpack.config.js | 1 + .../context-replacement/d/webpack.config.js | 1 + .../set-crossorigin/webpack.config.js | 1 + .../localization/webpack.config.js | 12 +- .../webpack.config.js | 1 + .../remove-export/webpack.config.js | 1 + .../immutable-config/webpack.config.js | 1 + .../delegated-hash/simple/webpack.config.js | 1 + .../delegated/simple/webpack.config.js | 1 + .../chunk-and-module/webpack.config.js | 8 +- .../chunk-files/webpack.config.js | 4 +- .../harmony-eval-source-map/webpack.config.js | 1 + .../devtools/harmony-eval/webpack.config.js | 1 + .../0-create-dll/webpack.config.js | 1 + .../1-use-dll/webpack.config.js | 1 + .../2-error-non-entry/webpack.config.js | 1 + .../0-create-dll/webpack.config.js | 1 + .../0-create-dll/webpack.config.js | 1 + .../1-use-dll/webpack.config.js | 1 + .../dll-plugin/0-create-dll/webpack.config.js | 1 + .../0-issue-10475/webpack.config.js | 1 + .../1-issue-10475/webpack.config.js | 1 + .../dll-plugin/1-use-dll/webpack.config.js | 1 + .../2-use-dll-without-scope/webpack.config.js | 1 + .../3-use-dll-with-hashid/webpack.config.js | 1 + .../ecmaVersion/2009/webpack.config.js | 1 + .../ecmaVersion/2015/webpack.config.js | 1 + .../ecmaVersion/5/webpack.config.js | 1 + .../ecmaVersion/6/webpack.config.js | 1 + .../different-source/webpack.config.js | 1 + .../emit-asset/equal-source/webpack.config.js | 1 + .../webpack.config.js | 1 + .../depend-on-advanced/webpack.config.js | 1 + .../entry/depend-on-simple/webpack.config.js | 1 + .../entry/descriptor/webpack.config.js | 1 + .../entry/function-promise/webpack.config.js | 1 + .../entry/function/webpack.config.js | 1 + .../entry/issue-1068/webpack.config.js | 1 + .../entry/issue-8110/webpack.config.js | 1 + .../require-entry-point/webpack.config.js | 1 + .../single-entry-point/webpack.config.js | 1 + .../webpack.config.js | 1 + .../errors/entry-not-found/webpack.config.js | 1 + .../webpack.config.js | 1 + .../errors/import-missing/webpack.config.js | 1 + .../webpack.config.js | 1 + .../errors/self-reexport/webpack.config.js | 1 + .../externals-in-chunk/webpack.config.js | 1 + .../webpack.config.js | 1 + .../externals-system/webpack.config.js | 1 + .../externals/global/webpack.config.js | 1 + .../externals/harmony/webpack.config.js | 1 + .../non-umd-externals-umd/webpack.config.js | 1 + .../non-umd-externals-umd2/webpack.config.js | 1 + .../optional-externals-cjs/webpack.config.js | 1 + .../optional-externals-root/webpack.config.js | 1 + .../optional-externals-umd/webpack.config.js | 1 + .../webpack.config.js | 1 + .../optional-externals-umd2/webpack.config.js | 1 + .../webpack.config.js | 1 + .../script-src-filename/webpack.config.js | 1 + .../split-chunks-filename/webpack.config.js | 1 + .../finish-modules/simple/webpack.config.js | 1 + .../output-filename/webpack.config.js | 1 + .../ignore/checkContext/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../ignore/false-alias/webpack.config.js | 1 + .../multiple-with-externals/webpack.config.js | 1 + .../only-resource-context/webpack.config.js | 1 + .../ignore/only-resource/webpack.config.js | 1 + .../webpack.config.js | 1 + .../resource-and-context/webpack.config.js | 1 + .../issues/issue-3596/webpack.config.js | 1 + .../tree-shaking-default/webpack.config.js | 1 + test/configCases/library/a/webpack.config.js | 1 + .../library/array-global/webpack.config.js | 1 + .../library/array-window/webpack.config.js | 1 + test/configCases/library/b/webpack.config.js | 1 + .../library/umd-array/webpack.config.js | 1 + .../configCases/library/umd/webpack.config.js | 1 + .../loaders/generate-ident/webpack.config.js | 1 + .../loaders/issue-3320/webpack.config.js | 1 + .../loaders/issue-9053/webpack.config.js | 1 + .../loaders/mode-default/webpack.config.js | 1 + .../mode-development/webpack.config.js | 1 + .../loaders/mode-none/webpack.config.js | 1 + .../loaders/mode-production/webpack.config.js | 1 + .../loaders/options/webpack.config.js | 1 + .../loaders/pre-post-loader/webpack.config.js | 1 + .../remaining-request/webpack.config.js | 1 + .../mangle-with-object-prop/webpack.config.js | 1 + .../mjs/esm-by-default/webpack.config.js | 1 + .../webpack.config.js | 1 + .../no-parse/module.exports/webpack.config.js | 1 + .../no-parse-function/webpack.config.js | 1 + .../hashed-module-ids/webpack.config.js | 1 + .../optimization/minimizer/webpack.config.js | 1 + .../named-modules/webpack.config.js | 1 + .../output/function/webpack.config.js | 1 + .../inner-dirs-entries/webpack.config.js | 1 + .../output/string/webpack.config.js | 1 + .../parsing/context/webpack.config.js | 1 + .../parsing/extended-api/webpack.config.js | 1 + .../parsing/harmony-global/webpack.config.js | 1 + .../harmony-this-concat/webpack.config.js | 1 + .../parsing/harmony-this/webpack.config.js | 1 + .../parsing/import-ignore/webpack.config.js | 1 + .../parsing/issue-2942/webpack.config.js | 1 + .../parsing/issue-336/webpack.config.js | 1 + .../parsing/issue-4857/webpack.config.js | 1 + .../parsing/issue-5624/webpack.config.js | 1 + .../parsing/issue-8293/webpack.config.js | 1 + .../parsing/issue-9042/webpack.config.js | 1 + .../parsing/issue-9156/webpack.config.js | 1 + .../node-source-plugin-off/webpack.config.js | 1 + .../node-stuff-plugin-off/webpack.config.js | 1 + .../relative-filedirname/webpack.config.js | 1 + .../parsing/require.main/webpack.config.js | 1 + .../parsing/requirejs/webpack.config.js | 1 + .../many-async-imports/webpack.config.js | 1 + .../many-exports/webpack.config.js | 1 + .../banner-plugin-hashing/webpack.config.js | 1 + .../plugins/banner-plugin/webpack.config.js | 1 + .../define-plugin-bigint/webpack.config.js | 1 + .../plugins/define-plugin/webpack.config.js | 1 + .../lib-manifest-plugin/webpack.config.js | 1 + .../loader-options-plugin/webpack.config.js | 1 + .../plugins/min-chunk-size/webpack.config.js | 1 + .../mini-css-extract-plugin/webpack.config.js | 1 + .../plugins/progress-plugin/data.js | 2 +- .../plugins/progress-plugin/webpack.config.js | 1 + .../plugins/provide-plugin/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../plugins/terser-plugin/webpack.config.js | 1 + .../load-module/webpack.config.js | 1 + .../records/issue-295/webpack.config.js | 1 + .../records/issue-2991/webpack.config.js | 1 + .../records/issue-7339/webpack.config.js | 1 + .../records/issue-7492/webpack.config.js | 1 + .../records/stable-sort/webpack.config.js | 1 + .../resolve/multi-alias/webpack.config.js | 1 + .../rule-set/chaining/webpack.config.js | 1 + .../rule-set/compiler/webpack.config.js | 1 + .../rule-set/custom/webpack.config.js | 1 + .../rule-set/query/webpack.config.js | 1 + .../resolve-options/webpack.config.js | 1 + .../simple-use-array-fn/webpack.config.js | 1 + .../simple-use-fn-array/webpack.config.js | 1 + .../rule-set/simple/webpack.config.js | 1 + .../undefined-values/webpack.config.js | 1 + .../invalid-esm-export/webpack.config.js | 1 + .../runtime/opt-in-finally/webpack.config.js | 1 + .../class-naming/webpack.config.js | 1 + .../create-dll-plugin/webpack.config.js | 1 + .../dll-plugin/webpack.config.js | 1 + .../scope-hoisting/esModule/webpack.config.js | 1 + .../export-global/webpack.config.js | 1 + .../harmony-pure-default/webpack.config.js | 1 + .../named-modules/webpack.config.js | 1 + .../webpack.config.js | 1 + .../side-effects-override/webpack.config.js | 1 + .../side-effects-values/webpack.config.js | 1 + .../simple/empty-config/webpack.config.js | 1 + .../webpack.config.js | 1 + .../array-as-output-library/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../source-map/module-names/webpack.config.js | 1 + .../webpack.config.js | 1 + .../namespace-source-path/webpack.config.js | 1 + .../source-map/nosources/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../correct-order/webpack.config.js | 1 + .../webpack.config.js | 1 + .../hot-multi/webpack.config.js | 1 + .../split-chunks-common/hot/webpack.config.js | 1 + .../inverted-order/webpack.config.js | 1 + .../move-entry/webpack.config.js | 1 + .../move-to-grandparent/webpack.config.js | 1 + .../simple/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../custom-filename/webpack.config.js | 1 + .../entry-point-error/webpack.config.js | 1 + .../incorrect-chunk-reuse/webpack.config.js | 1 + .../split-chunks/issue-8908/webpack.config.js | 1 + .../split-chunks/issue-9491/webpack.config.js | 1 + .../module-type-filter/webpack.config.js | 1 + .../split-chunks/no-options/webpack.config.js | 1 + .../reuse-chunk-name/webpack.config.js | 1 + .../runtime-chunk-no-async/webpack.config.js | 1 + .../runtime-chunk/webpack.config.js | 1 + .../target/amd-named/webpack.config.js | 1 + .../target/amd-require/webpack.config.js | 1 + .../target/amd-unnamed/webpack.config.js | 1 + .../electron-renderer/webpack.config.js | 1 + .../node-dynamic-import/webpack.config.js | 1 + .../strict-mode-global/webpack.config.js | 1 + .../target/system-context/webpack.config.js | 1 + .../target/system-export/webpack.config.js | 1 + .../webpack.config.js | 1 + .../target/system-named/webpack.config.js | 1 + .../target/system-unnamed/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../target/umd-named-define/webpack.config.js | 1 + .../utils/lazy-set/webpack.config.js | 1 + .../export-imported-global/webpack.config.js | 1 + .../wasm/identical/webpack.config.js | 1 + .../wasm/import-wasm-wasm/webpack.config.js | 1 + .../webpack.config.js | 1 + .../web/node-source/webpack.config.js | 1 + .../web/prefetch-preload/webpack.config.js | 1 + .../prefetch-split-chunks/webpack.config.js | 1 + .../web/retry-failed-import/webpack.config.js | 1 + .../web/unique-jsonp/webpack.config.js | 1 + .../reload-compat-flag/webpack.config.js | 1 + .../concat/reload-external/webpack.config.js | 1 + .../define/issue-6962/webpack.config.js | 1 + .../numeric-ids/production/webpack.config.js | 1 + test/hotPlayground/webpack.config.js | 1 + .../webpack.config.js | 1 + test/statsCases/asset/webpack.config.js | 1 + .../async-commons-chunk/webpack.config.js | 1 + .../chunk-module-id-range/webpack.config.js | 1 + .../chunks-development/webpack.config.js | 1 + test/statsCases/chunks/webpack.config.js | 1 + .../circular-correctness/webpack.config.js | 1 + .../color-disabled/webpack.config.js | 1 + .../color-enabled-custom/webpack.config.js | 1 + .../color-enabled/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../concat-and-sideeffects/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../entry-filename/webpack.config.js | 1 + .../exclude-with-loader/webpack.config.js | 1 + test/statsCases/external/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + test/statsCases/graph-roots/webpack.config.js | 1 + test/statsCases/immutable/webpack.config.js | 1 + .../import-context-filter/webpack.config.js | 1 + test/statsCases/import-weak/webpack.config.js | 1 + .../webpack.config.js | 1 + test/statsCases/logging/webpack.config.js | 1 + .../max-modules-default/webpack.config.js | 1 + test/statsCases/max-modules/webpack.config.js | 1 + .../module-assets/webpack.config.js | 1 + .../webpack.config.js | 1 + .../module-deduplication/webpack.config.js | 1 + .../module-not-found-error/webpack.config.js | 1 + .../module-reasons/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 32 +- .../named-chunks-plugin/webpack.config.js | 1 + .../TestChildCompilationFailurePlugin.js | 2 +- .../webpack.config.js | 1 + .../optimize-chunks/webpack.config.js | 1 + test/statsCases/parse-error/webpack.config.js | 1 + .../performance-disabled/webpack.config.js | 1 + .../performance-error/webpack.config.js | 1 + .../webpack.config.js | 1 + .../performance-no-hints/webpack.config.js | 1 + .../webpack.config.js | 1 + .../prefetch-preload-mixed/webpack.config.js | 1 + test/statsCases/prefetch/webpack.config.js | 1 + test/statsCases/preload/webpack.config.js | 1 + .../preset-detailed/webpack.config.js | 1 + .../webpack.config.js | 1 + .../preset-errors-only/webpack.config.js | 1 + .../preset-errors-warnings/webpack.config.js | 1 + .../preset-minimal-simple/webpack.config.js | 1 + .../preset-minimal/webpack.config.js | 1 + .../preset-none-error/webpack.config.js | 1 + test/statsCases/preset-none/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../preset-normal/webpack.config.js | 1 + .../preset-verbose/webpack.config.js | 1 + .../resolve-plugin-context/webpack.config.js | 1 + .../reverse-sort-modules/webpack.config.js | 1 + .../webpack.config.js | 1 + .../runtime-chunk-single/webpack.config.js | 1 + .../runtime-chunk/webpack.config.js | 1 + .../scope-hoisting-bailouts/webpack.config.js | 1 + .../side-effects-issue-7428/webpack.config.js | 1 + .../webpack.config.js | 1 + .../simple-more-info/webpack.config.js | 1 + .../webpack.config.js | 1 + .../split-chunks-chunk-name/webpack.config.js | 1 + .../webpack.config.js | 1 + .../split-chunks-issue-6413/webpack.config.js | 1 + .../split-chunks-issue-6696/webpack.config.js | 1 + .../split-chunks-issue-7401/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../statsCases/tree-shaking/webpack.config.js | 1 + .../warnings-terser/webpack.config.js | 1 + .../webpack.config.js | 1 + .../cache/managedPath/webpack.config.js | 1 + .../issue-8766/webpack.config.js | 1 + .../webpack.config.js | 1 + .../plugins/define-plugin/webpack.config.js | 1 + .../dll-reference-plugin/webpack.config.js | 1 + .../webpack.config.js | 1 + .../watch-ignore-plugin/webpack.config.js | 1 + .../runtime/dynamic-import/webpack.config.js | 1 + .../runtime/static-import/webpack.config.js | 1 + .../caching-inner-source/webpack.config.js | 1 + .../side-effects/issue-7400/webpack.config.js | 1 + .../watchCases/wasm/caching/webpack.config.js | 1 + tsconfig.test.json | 2 +- types.d.ts | 2784 ++++++++--------- yarn.lock | 4 +- 372 files changed, 1867 insertions(+), 1511 deletions(-) create mode 100644 declarations.test.d.ts diff --git a/declarations.test.d.ts b/declarations.test.d.ts new file mode 100644 index 000000000..68aa7f449 --- /dev/null +++ b/declarations.test.d.ts @@ -0,0 +1,18 @@ +declare module "*.json"; + +declare namespace jest { + interface Matchers { + toBeTypeOf: ( + expected: + | "string" + | "number" + | "bigint" + | "boolean" + | "symbol" + | "undefined" + | "object" + | "function" + ) => void; + toEndWith: (expected: string) => void; + } +} diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index ee4bfdd40..146fcdc8e 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -242,7 +242,13 @@ export type RuleSetLoaderOptions = */ export type RuleSetUse = | RuleSetUseItem[] - | ((data: object) => RuleSetUseItem[]) + | ((data: { + resource: string; + realResource: string; + resourceQuery: string; + issuer: string; + compiler: string; + }) => RuleSetUseItem[]) | RuleSetUseItem; /** * A description of an applied loader. diff --git a/lib/index.js b/lib/index.js index 9185a72b6..8577bd0b4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,23 +5,78 @@ "use strict"; -const validate = require("schema-utils"); const util = require("util"); -const { version } = require("../package.json"); -const webpackOptionsSchema = require("../schemas/WebpackOptions.json"); -const WebpackOptionsApply = require("./WebpackOptionsApply"); const memorize = require("./util/memorize"); -const validateSchema = require("./validateSchema"); -const webpack = require("./webpack"); /** @typedef {import("../declarations/WebpackOptions").WebpackOptions} Configuration */ +/** @typedef {import("../declarations/WebpackOptions").WebpackPluginFunction} WebpackPluginFunction */ +/** @typedef {import("../declarations/WebpackOptions").WebpackPluginInstance} WebpackPluginInstance */ +/** @typedef {import("./Parser").ParserState} ParserState */ -module.exports = Object.assign(webpack, { - webpack, - WebpackOptionsApply, - validate: validateSchema.bind(null, webpackOptionsSchema), - validateSchema, - version, +/** + * @template {Function} T + * @param {function(): T} factory factory function + * @returns {T} function + */ +const lazyFunction = factory => { + const fac = memorize(factory); + const f = /** @type {any} */ ((...args) => { + return fac()(...args); + }); + return /** @type {T} */ (f); +}; + +/** + * @template A + * @template B + * @param {A} obj input a + * @param {B} exports input b + * @returns {A & B} merged + */ +const mergeExports = (obj, exports) => { + const descriptors = Object.getOwnPropertyDescriptors(exports); + for (const name of Object.keys(descriptors)) { + const descriptor = descriptors[name]; + if (descriptor.get) { + const fn = descriptor.get; + Object.defineProperty(obj, name, { + configurable: false, + enumerable: true, + get: memorize(fn) + }); + } else if (typeof descriptor.value === "object") { + Object.defineProperty(obj, name, { + configurable: false, + enumerable: true, + writable: false, + value: mergeExports({}, descriptor.value) + }); + } else { + throw new Error( + "Exposed values must be either a getter or an nested object" + ); + } + } + return /** @type {A & B} */ (Object.freeze(obj)); +}; + +const fn = lazyFunction(() => require("./webpack")); +module.exports = mergeExports(fn, { + get webpack() { + return require("./webpack"); + }, + get validate() { + const validateSchema = require("./validateSchema"); + const webpackOptionsSchema = require("../schemas/WebpackOptions.json"); + return validateSchema.bind(null, webpackOptionsSchema); + }, + get validateSchema() { + const validateSchema = require("./validateSchema"); + return validateSchema; + }, + get version() { + return require("../package.json").version; + }, get cli() { return require("./cli"); @@ -35,6 +90,12 @@ module.exports = Object.assign(webpack, { get Cache() { return require("./Cache"); }, + get Chunk() { + return require("./Chunk"); + }, + get ChunkGraph() { + return require("./ChunkGraph"); + }, get Compilation() { return require("./Compilation"); }, @@ -74,6 +135,9 @@ module.exports = Object.assign(webpack, { get EvalSourceMapDevToolPlugin() { return require("./EvalSourceMapDevToolPlugin"); }, + get ExternalModule() { + return require("./ExternalModule"); + }, get ExternalsPlugin() { return require("./ExternalsPlugin"); }, @@ -115,6 +179,9 @@ module.exports = Object.assign(webpack, { get ModuleFilenameHelpers() { return require("./ModuleFilenameHelpers"); }, + get ModuleGraph() { + return require("./ModuleGraph"); + }, get NoEmitOnErrorsPlugin() { return require("./NoEmitOnErrorsPlugin"); }, @@ -164,6 +231,9 @@ module.exports = Object.assign(webpack, { get WatchIgnorePlugin() { return require("./WatchIgnorePlugin"); }, + get WebpackOptionsApply() { + return require("./WebpackOptionsApply"); + }, get WebpackOptionsDefaulter() { return util.deprecate( () => require("./WebpackOptionsDefaulter"), @@ -173,10 +243,10 @@ module.exports = Object.assign(webpack, { }, // TODO webpack 6 deprecate get WebpackOptionsValidationError() { - return validate.ValidationError; + return require("schema-utils").ValidationError; }, get ValidationError() { - return validate.ValidationError; + return require("schema-utils").ValidationError; }, cache: { @@ -318,23 +388,3 @@ module.exports = Object.assign(webpack, { } } }); - -const finishExports = obj => { - const descriptors = Object.getOwnPropertyDescriptors(obj); - for (const name of Object.keys(descriptors)) { - const descriptor = descriptors[name]; - if (descriptor.get) { - const fn = descriptor.get; - Object.defineProperty(obj, name, { - configurable: false, - enumerable: true, - get: memorize(fn) - }); - } else if (typeof descriptor.value === "object") { - finishExports(descriptor.value); - } - } - Object.freeze(obj); -}; - -finishExports(module.exports); diff --git a/package.json b/package.json index abe73b2fb..c95660694 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "strip-ansi": "^6.0.0", "style-loader": "^1.0.0", "toml": "^3.0.0", - "tooling": "webpack/tooling", + "tooling": "webpack/tooling#v1.0.0", "ts-loader": "^6.0.4", "typescript": "^3.6.4", "url-loader": "^2.1.0", @@ -131,10 +131,10 @@ "type-report": "rimraf coverage && yarn cover:types && yarn cover:report && open-cli coverage/lcov-report/index.html", "pretest": "yarn lint", "prelint": "yarn setup", - "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn pretty-lint && yarn spellcheck", + "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-lint && yarn pretty-lint && yarn spellcheck", "code-lint": "eslint . --ext '.js' --cache", "type-lint": "tsc", - "test:types": "tsc -p tsconfig.test.json", + "typings-lint": "tsc -p tsconfig.test.json", "spellcheck": "cspell \"{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}\" \"*.md\"", "special-lint": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/generate-types", "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/generate-types --write", diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 9f6dfcb0d..4a22e03d9 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -2572,7 +2572,7 @@ }, { "instanceof": "Function", - "tsType": "((data: object) => RuleSetUseItem[])" + "tsType": "((data: { resource: string, realResource: string, resourceQuery: string, issuer: string, compiler: string }) => RuleSetUseItem[])" }, { "$ref": "#/definitions/RuleSetUseItem" diff --git a/test/benchmarkCases/large-ast/webpack.config.js b/test/benchmarkCases/large-ast/webpack.config.js index d0c9ec47c..306cc71d9 100644 --- a/test/benchmarkCases/large-ast/webpack.config.js +++ b/test/benchmarkCases/large-ast/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: ["./index", "./index2"] }; diff --git a/test/benchmarkCases/libraries/webpack.config.js b/test/benchmarkCases/libraries/webpack.config.js index 7c4ed5c64..48485fde0 100644 --- a/test/benchmarkCases/libraries/webpack.config.js +++ b/test/benchmarkCases/libraries/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: ["react", "react-dom", "lodash"] }; diff --git a/test/benchmarkCases/many-chunks/webpack.config.js b/test/benchmarkCases/many-chunks/webpack.config.js index 8c31ec4d7..4c111be6a 100644 --- a/test/benchmarkCases/many-chunks/webpack.config.js +++ b/test/benchmarkCases/many-chunks/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: "./index" }; diff --git a/test/benchmarkCases/many-modules-source-map/webpack.config.js b/test/benchmarkCases/many-modules-source-map/webpack.config.js index a61015f48..3f433b473 100644 --- a/test/benchmarkCases/many-modules-source-map/webpack.config.js +++ b/test/benchmarkCases/many-modules-source-map/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: "./index", devtool: "eval-cheap-module-source-map" diff --git a/test/benchmarkCases/many-modules/webpack.config.js b/test/benchmarkCases/many-modules/webpack.config.js index 8c31ec4d7..4c111be6a 100644 --- a/test/benchmarkCases/many-modules/webpack.config.js +++ b/test/benchmarkCases/many-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: "./index" }; diff --git a/test/configCases/additional-pass/simple/webpack.config.js b/test/configCases/additional-pass/simple/webpack.config.js index 4cd7ee753..36318c9ba 100644 --- a/test/configCases/additional-pass/simple/webpack.config.js +++ b/test/configCases/additional-pass/simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").WebpackPluginFunction} */ var testPlugin = function () { var counter = 1; this.hooks.compilation.tap("TestPlugin", compilation => { @@ -8,6 +9,7 @@ var testPlugin = function () { }); }; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [testPlugin] }; diff --git a/test/configCases/amd/disabled/webpack.config.js b/test/configCases/amd/disabled/webpack.config.js index 33fa3a5fb..d28e3ce5a 100644 --- a/test/configCases/amd/disabled/webpack.config.js +++ b/test/configCases/amd/disabled/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { amd: false }; diff --git a/test/configCases/asset-emitted/normal/webpack.config.js b/test/configCases/asset-emitted/normal/webpack.config.js index ad122d5e3..63eaa7b5d 100644 --- a/test/configCases/asset-emitted/normal/webpack.config.js +++ b/test/configCases/asset-emitted/normal/webpack.config.js @@ -1,6 +1,7 @@ const Compilation = require("../../../../").Compilation; const Source = require("webpack-sources").Source; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ compiler => { diff --git a/test/configCases/asset-modules/assetModuleFilename/webpack.config.js b/test/configCases/asset-modules/assetModuleFilename/webpack.config.js index 00907ffa6..99baa04d7 100644 --- a/test/configCases/asset-modules/assetModuleFilename/webpack.config.js +++ b/test/configCases/asset-modules/assetModuleFilename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/asset-modules/custom-condition/webpack.config.js b/test/configCases/asset-modules/custom-condition/webpack.config.js index 58310ed1b..bb0895768 100644 --- a/test/configCases/asset-modules/custom-condition/webpack.config.js +++ b/test/configCases/asset-modules/custom-condition/webpack.config.js @@ -1,6 +1,7 @@ const path = require("path"); const NormalModule = require("../../../../").NormalModule; +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/custom-encoder/webpack.config.js b/test/configCases/asset-modules/custom-encoder/webpack.config.js index 9529813f2..86ac26b83 100644 --- a/test/configCases/asset-modules/custom-encoder/webpack.config.js +++ b/test/configCases/asset-modules/custom-encoder/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/data-url/webpack.config.js b/test/configCases/asset-modules/data-url/webpack.config.js index 28a3e882a..de87d5817 100644 --- a/test/configCases/asset-modules/data-url/webpack.config.js +++ b/test/configCases/asset-modules/data-url/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/file-loader/webpack.config.js b/test/configCases/asset-modules/file-loader/webpack.config.js index 6455cb7d9..835a3c38e 100644 --- a/test/configCases/asset-modules/file-loader/webpack.config.js +++ b/test/configCases/asset-modules/file-loader/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/opus/webpack.config.js b/test/configCases/asset-modules/opus/webpack.config.js index 8a8f3c45a..6966d01e2 100644 --- a/test/configCases/asset-modules/opus/webpack.config.js +++ b/test/configCases/asset-modules/opus/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/overridePath/webpack.config.js b/test/configCases/asset-modules/overridePath/webpack.config.js index a4cb22be2..fa4a01def 100644 --- a/test/configCases/asset-modules/overridePath/webpack.config.js +++ b/test/configCases/asset-modules/overridePath/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/asset-modules/path/webpack.config.js b/test/configCases/asset-modules/path/webpack.config.js index a09504b58..cbf6b2eba 100644 --- a/test/configCases/asset-modules/path/webpack.config.js +++ b/test/configCases/asset-modules/path/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/asset-modules/publicPath/webpack.config.js b/test/configCases/asset-modules/publicPath/webpack.config.js index d04ad5ec7..4962cb1ec 100644 --- a/test/configCases/asset-modules/publicPath/webpack.config.js +++ b/test/configCases/asset-modules/publicPath/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/asset-modules/source/webpack.config.js b/test/configCases/asset-modules/source/webpack.config.js index 8c96cd457..5a81c18d0 100644 --- a/test/configCases/asset-modules/source/webpack.config.js +++ b/test/configCases/asset-modules/source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/types/webpack.config.js b/test/configCases/asset-modules/types/webpack.config.js index 3fdbd70cc..b1de2ea22 100644 --- a/test/configCases/asset-modules/types/webpack.config.js +++ b/test/configCases/asset-modules/types/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/async-commons-chunk/all-selected/webpack.config.js b/test/configCases/async-commons-chunk/all-selected/webpack.config.js index fd4fbccbf..4224dbc77 100644 --- a/test/configCases/async-commons-chunk/all-selected/webpack.config.js +++ b/test/configCases/async-commons-chunk/all-selected/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { splitChunks: { diff --git a/test/configCases/async-commons-chunk/duplicate/webpack.config.js b/test/configCases/async-commons-chunk/duplicate/webpack.config.js index fd4fbccbf..4224dbc77 100644 --- a/test/configCases/async-commons-chunk/duplicate/webpack.config.js +++ b/test/configCases/async-commons-chunk/duplicate/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { splitChunks: { diff --git a/test/configCases/async-commons-chunk/existing-name/webpack.config.js b/test/configCases/async-commons-chunk/existing-name/webpack.config.js index 79f659d52..bf5d082bf 100644 --- a/test/configCases/async-commons-chunk/existing-name/webpack.config.js +++ b/test/configCases/async-commons-chunk/existing-name/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { performance: { hints: false diff --git a/test/configCases/async-commons-chunk/nested/webpack.config.js b/test/configCases/async-commons-chunk/nested/webpack.config.js index fd4fbccbf..4224dbc77 100644 --- a/test/configCases/async-commons-chunk/nested/webpack.config.js +++ b/test/configCases/async-commons-chunk/nested/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { splitChunks: { diff --git a/test/configCases/async-commons-chunk/node/webpack.config.js b/test/configCases/async-commons-chunk/node/webpack.config.js index 8de27bd03..d25903acd 100644 --- a/test/configCases/async-commons-chunk/node/webpack.config.js +++ b/test/configCases/async-commons-chunk/node/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "none", entry: { diff --git a/test/configCases/async-commons-chunk/simple/webpack.config.js b/test/configCases/async-commons-chunk/simple/webpack.config.js index fd4fbccbf..4224dbc77 100644 --- a/test/configCases/async-commons-chunk/simple/webpack.config.js +++ b/test/configCases/async-commons-chunk/simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { splitChunks: { diff --git a/test/configCases/chunk-graph/issue-9634/webpack.config.js b/test/configCases/chunk-graph/issue-9634/webpack.config.js index db3b667a0..42a875cba 100644 --- a/test/configCases/chunk-graph/issue-9634/webpack.config.js +++ b/test/configCases/chunk-graph/issue-9634/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { b: "./entry-b", diff --git a/test/configCases/chunk-index/order-multiple-entries/webpack.config.js b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js index b0dc1d869..1a27301af 100644 --- a/test/configCases/chunk-index/order-multiple-entries/webpack.config.js +++ b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js @@ -1,6 +1,7 @@ /** @typedef {import("../../../../").Compilation} Compilation */ /** @typedef {import("../../../../").Module} Module */ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { entry1: "./entry1", @@ -22,6 +23,7 @@ module.exports = { for (const [name, group] of compilation.namedChunkGroups) { /** @type {Map} */ const modules = new Map(); + /** @type {Map} */ const modules2 = new Map(); for (const chunk of group.chunks) { for (const module of compilation.chunkGraph.getChunkModulesIterable( @@ -75,7 +77,13 @@ module.exports = { asyncIndex2: "0: ./async.js" }); const indices = Array.from(compilation.modules) - .map(m => [moduleGraph.getPreOrderIndex(m), m]) + .map( + m => + /** @type {[number, Module]} */ ([ + moduleGraph.getPreOrderIndex(m), + m + ]) + ) .filter(p => typeof p[0] === "number") .sort((a, b) => a[0] - b[0]) .map( @@ -84,7 +92,13 @@ module.exports = { ) .join(", "); const indices2 = Array.from(compilation.modules) - .map(m => [moduleGraph.getPostOrderIndex(m), m]) + .map( + m => + /** @type {[number, Module]} */ ([ + moduleGraph.getPostOrderIndex(m), + m + ]) + ) .filter(p => typeof p[0] === "number") .sort((a, b) => a[0] - b[0]) .map( diff --git a/test/configCases/code-generation/harmony-pure-default/webpack.config.js b/test/configCases/code-generation/harmony-pure-default/webpack.config.js index 94fea42dc..2ec858900 100644 --- a/test/configCases/code-generation/harmony-pure-default/webpack.config.js +++ b/test/configCases/code-generation/harmony-pure-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/configCases/code-generation/require-context-id/webpack.config.js b/test/configCases/code-generation/require-context-id/webpack.config.js index 80e9e2199..e3f2e0b3b 100644 --- a/test/configCases/code-generation/require-context-id/webpack.config.js +++ b/test/configCases/code-generation/require-context-id/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "hashed" diff --git a/test/configCases/code-generation/use-strict/webpack.config.js b/test/configCases/code-generation/use-strict/webpack.config.js index 430664cf3..877d7411e 100644 --- a/test/configCases/code-generation/use-strict/webpack.config.js +++ b/test/configCases/code-generation/use-strict/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/compiletime/error-not-found/webpack.config.js b/test/configCases/compiletime/error-not-found/webpack.config.js index 4b24c0e9f..e3128523e 100644 --- a/test/configCases/compiletime/error-not-found/webpack.config.js +++ b/test/configCases/compiletime/error-not-found/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictExportPresence: true diff --git a/test/configCases/concatenate-modules/load-chunk-function/webpack.config.js b/test/configCases/concatenate-modules/load-chunk-function/webpack.config.js index 97c8c7496..1a64af2a3 100644 --- a/test/configCases/concatenate-modules/load-chunk-function/webpack.config.js +++ b/test/configCases/concatenate-modules/load-chunk-function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { entry1: "./entry1", diff --git a/test/configCases/concatenate-modules/rename-10168/webpack.config.js b/test/configCases/concatenate-modules/rename-10168/webpack.config.js index 59e948b12..c939ba33f 100644 --- a/test/configCases/concatenate-modules/rename-10168/webpack.config.js +++ b/test/configCases/concatenate-modules/rename-10168/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { concatenateModules: true diff --git a/test/configCases/concatenate-modules/split-chunk-entry-module/webpack.config.js b/test/configCases/concatenate-modules/split-chunk-entry-module/webpack.config.js index b9c7c5310..16ed8a8d8 100644 --- a/test/configCases/concatenate-modules/split-chunk-entry-module/webpack.config.js +++ b/test/configCases/concatenate-modules/split-chunk-entry-module/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index" diff --git a/test/configCases/context-exclusion/simple/webpack.config.js b/test/configCases/context-exclusion/simple/webpack.config.js index 914088d01..355aaf856 100644 --- a/test/configCases/context-exclusion/simple/webpack.config.js +++ b/test/configCases/context-exclusion/simple/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [new webpack.ContextExclusionPlugin(/dont/)] }; diff --git a/test/configCases/context-replacement/System.import/webpack.config.js b/test/configCases/context-replacement/System.import/webpack.config.js index dd3a95923..3b5569bcc 100644 --- a/test/configCases/context-replacement/System.import/webpack.config.js +++ b/test/configCases/context-replacement/System.import/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.ContextReplacementPlugin( diff --git a/test/configCases/context-replacement/a/webpack.config.js b/test/configCases/context-replacement/a/webpack.config.js index effb49f41..49a7297f2 100644 --- a/test/configCases/context-replacement/a/webpack.config.js +++ b/test/configCases/context-replacement/a/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.ContextReplacementPlugin( diff --git a/test/configCases/context-replacement/b/webpack.config.js b/test/configCases/context-replacement/b/webpack.config.js index 90555063f..9c04b12f3 100644 --- a/test/configCases/context-replacement/b/webpack.config.js +++ b/test/configCases/context-replacement/b/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.ContextReplacementPlugin(/context-replacement.b$/, /^\.\/only/) diff --git a/test/configCases/context-replacement/c/webpack.config.js b/test/configCases/context-replacement/c/webpack.config.js index 6a7c2c314..6850f3784 100644 --- a/test/configCases/context-replacement/c/webpack.config.js +++ b/test/configCases/context-replacement/c/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.ContextReplacementPlugin( diff --git a/test/configCases/context-replacement/d/webpack.config.js b/test/configCases/context-replacement/d/webpack.config.js index 21b667c52..9710b14a8 100644 --- a/test/configCases/context-replacement/d/webpack.config.js +++ b/test/configCases/context-replacement/d/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/crossorigin/set-crossorigin/webpack.config.js b/test/configCases/crossorigin/set-crossorigin/webpack.config.js index 68eeb96a5..f76ae2a4f 100644 --- a/test/configCases/crossorigin/set-crossorigin/webpack.config.js +++ b/test/configCases/crossorigin/set-crossorigin/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/custom-source-type/localization/webpack.config.js b/test/configCases/custom-source-type/localization/webpack.config.js index cc2718da7..de405aa31 100644 --- a/test/configCases/custom-source-type/localization/webpack.config.js +++ b/test/configCases/custom-source-type/localization/webpack.config.js @@ -6,11 +6,19 @@ const Parser = require("../../../../").Parser; const webpack = require("../../../../"); /** @typedef {import("../../../../").Compiler} Compiler */ +/** @typedef {import("../../../../").ParserState} ParserState */ class LocalizationParser extends Parser { - parse(source, { module }) { + /** + * @param {string | Buffer | Record} source input source + * @param {ParserState} state state + * @returns {ParserState} state + */ + parse(source, state) { + if (typeof source !== "string") throw new Error("Unexpected input"); + const { module } = state; module.buildInfo.content = JSON.parse(source); - return true; + return state; } } diff --git a/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js b/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js index 7255f049c..8d73a4314 100644 --- a/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js +++ b/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js @@ -1,5 +1,6 @@ /** @typedef {import("../../../../").Compilation} Compilation */ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { usedExports: true, diff --git a/test/configCases/deep-scope-analysis/remove-export/webpack.config.js b/test/configCases/deep-scope-analysis/remove-export/webpack.config.js index b47212d58..13509d7e8 100644 --- a/test/configCases/deep-scope-analysis/remove-export/webpack.config.js +++ b/test/configCases/deep-scope-analysis/remove-export/webpack.config.js @@ -1,5 +1,6 @@ /** @typedef {import("../../../../").Compilation} Compilation */ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { usedExports: true, diff --git a/test/configCases/defaulter/immutable-config/webpack.config.js b/test/configCases/defaulter/immutable-config/webpack.config.js index ede6057b0..6d3016604 100644 --- a/test/configCases/defaulter/immutable-config/webpack.config.js +++ b/test/configCases/defaulter/immutable-config/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { resolve: Object.freeze({}) // this fails to compile when the object is not cloned diff --git a/test/configCases/delegated-hash/simple/webpack.config.js b/test/configCases/delegated-hash/simple/webpack.config.js index 9efb736a0..ed0e52f8a 100644 --- a/test/configCases/delegated-hash/simple/webpack.config.js +++ b/test/configCases/delegated-hash/simple/webpack.config.js @@ -1,4 +1,5 @@ var DelegatedPlugin = require("../../../../").DelegatedPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "hashed" diff --git a/test/configCases/delegated/simple/webpack.config.js b/test/configCases/delegated/simple/webpack.config.js index 7e3861243..8a538c2f4 100644 --- a/test/configCases/delegated/simple/webpack.config.js +++ b/test/configCases/delegated/simple/webpack.config.js @@ -1,4 +1,5 @@ var DelegatedPlugin = require("../../../../").DelegatedPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new DelegatedPlugin({ diff --git a/test/configCases/deprecations/chunk-and-module/webpack.config.js b/test/configCases/deprecations/chunk-and-module/webpack.config.js index 45e183027..b9df69a0f 100644 --- a/test/configCases/deprecations/chunk-and-module/webpack.config.js +++ b/test/configCases/deprecations/chunk-and-module/webpack.config.js @@ -1,5 +1,5 @@ -const ExternalModule = require("../../../../lib/ExternalModule"); -const ChunkGraph = require("../../../../lib/ChunkGraph"); +const { ChunkGraph, ExternalModule } = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ compiler => { @@ -44,7 +44,9 @@ module.exports = { expect(m.issuer).toBe(null); m.issuer = module; expect(m.issuer).toBe(module); - expect([...m.usedExports]).toEqual(["testExport"]); + expect( + typeof m.usedExports === "boolean" ? [] : [...m.usedExports] + ).toEqual(["testExport"]); expect(m.optimizationBailout).toEqual([]); expect(m.optional).toBe(false); expect(m.isInChunk(chunk)).toBe(true); diff --git a/test/configCases/deprecations/chunk-files/webpack.config.js b/test/configCases/deprecations/chunk-files/webpack.config.js index bca499c60..9ce909941 100644 --- a/test/configCases/deprecations/chunk-files/webpack.config.js +++ b/test/configCases/deprecations/chunk-files/webpack.config.js @@ -1,8 +1,10 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ compiler => { compiler.hooks.done.tap("Test", ({ compilation }) => { - for (const chunk of compilation.chunks) { + for (const c of compilation.chunks) { + const chunk = /** @type {{ files: string[] } & import("../../../../").Chunk} */ (c); expect(chunk.files.length).toBe(chunk.files.size); expect(chunk.files[0]).toBe(Array.from(chunk.files)[0]); expect(chunk.files.join(",")).toBe(Array.from(chunk.files).join(",")); diff --git a/test/configCases/devtools/harmony-eval-source-map/webpack.config.js b/test/configCases/devtools/harmony-eval-source-map/webpack.config.js index 21e4f13b4..568d999d5 100644 --- a/test/configCases/devtools/harmony-eval-source-map/webpack.config.js +++ b/test/configCases/devtools/harmony-eval-source-map/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "eval-source-map" }; diff --git a/test/configCases/devtools/harmony-eval/webpack.config.js b/test/configCases/devtools/harmony-eval/webpack.config.js index 8c6a61a3d..4b28913b1 100644 --- a/test/configCases/devtools/harmony-eval/webpack.config.js +++ b/test/configCases/devtools/harmony-eval/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "eval" }; diff --git a/test/configCases/dll-plugin-entry/0-create-dll/webpack.config.js b/test/configCases/dll-plugin-entry/0-create-dll/webpack.config.js index 5ca9a0e6d..4c7b8f17d 100644 --- a/test/configCases/dll-plugin-entry/0-create-dll/webpack.config.js +++ b/test/configCases/dll-plugin-entry/0-create-dll/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["."], output: { diff --git a/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js b/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js index 5be05e9c9..461b1dc69 100644 --- a/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named" diff --git a/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js b/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js index 5be05e9c9..461b1dc69 100644 --- a/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js +++ b/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named" diff --git a/test/configCases/dll-plugin-format/0-create-dll/webpack.config.js b/test/configCases/dll-plugin-format/0-create-dll/webpack.config.js index a9739e313..12ec47dad 100644 --- a/test/configCases/dll-plugin-format/0-create-dll/webpack.config.js +++ b/test/configCases/dll-plugin-format/0-create-dll/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["."], resolve: { diff --git a/test/configCases/dll-plugin-side-effects/0-create-dll/webpack.config.js b/test/configCases/dll-plugin-side-effects/0-create-dll/webpack.config.js index e55c9f3aa..75cfeeda7 100644 --- a/test/configCases/dll-plugin-side-effects/0-create-dll/webpack.config.js +++ b/test/configCases/dll-plugin-side-effects/0-create-dll/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./index"], output: { diff --git a/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js b/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js index 8d1738807..14b447481 100644 --- a/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DllReferencePlugin({ diff --git a/test/configCases/dll-plugin/0-create-dll/webpack.config.js b/test/configCases/dll-plugin/0-create-dll/webpack.config.js index eecba8898..d81c4d7c3 100644 --- a/test/configCases/dll-plugin/0-create-dll/webpack.config.js +++ b/test/configCases/dll-plugin/0-create-dll/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./a", "./b", "./_d", "./_e", "./f", "./g.abc", "./h"], resolve: { diff --git a/test/configCases/dll-plugin/0-issue-10475/webpack.config.js b/test/configCases/dll-plugin/0-issue-10475/webpack.config.js index 04ed7a06a..f02da70d8 100644 --- a/test/configCases/dll-plugin/0-issue-10475/webpack.config.js +++ b/test/configCases/dll-plugin/0-issue-10475/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./index.js"], output: { diff --git a/test/configCases/dll-plugin/1-issue-10475/webpack.config.js b/test/configCases/dll-plugin/1-issue-10475/webpack.config.js index 06546bf81..d1cf3a50e 100644 --- a/test/configCases/dll-plugin/1-issue-10475/webpack.config.js +++ b/test/configCases/dll-plugin/1-issue-10475/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DllReferencePlugin({ diff --git a/test/configCases/dll-plugin/1-use-dll/webpack.config.js b/test/configCases/dll-plugin/1-use-dll/webpack.config.js index 5cbe50f33..dc432da78 100644 --- a/test/configCases/dll-plugin/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin/1-use-dll/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named" diff --git a/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js b/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js index 7a4dd3ee4..0f5072756 100644 --- a/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js +++ b/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js b/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js index 97edd0588..a065fa625 100644 --- a/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js +++ b/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/ecmaVersion/2009/webpack.config.js b/test/configCases/ecmaVersion/2009/webpack.config.js index e06a4890c..1f0ecf71c 100644 --- a/test/configCases/ecmaVersion/2009/webpack.config.js +++ b/test/configCases/ecmaVersion/2009/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 2009 diff --git a/test/configCases/ecmaVersion/2015/webpack.config.js b/test/configCases/ecmaVersion/2015/webpack.config.js index 63ea4672e..592cca00c 100644 --- a/test/configCases/ecmaVersion/2015/webpack.config.js +++ b/test/configCases/ecmaVersion/2015/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 2015 diff --git a/test/configCases/ecmaVersion/5/webpack.config.js b/test/configCases/ecmaVersion/5/webpack.config.js index 2eeb5a078..45ee727ee 100644 --- a/test/configCases/ecmaVersion/5/webpack.config.js +++ b/test/configCases/ecmaVersion/5/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 5 diff --git a/test/configCases/ecmaVersion/6/webpack.config.js b/test/configCases/ecmaVersion/6/webpack.config.js index 537a8594e..4364c0605 100644 --- a/test/configCases/ecmaVersion/6/webpack.config.js +++ b/test/configCases/ecmaVersion/6/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 6 diff --git a/test/configCases/emit-asset/different-source/webpack.config.js b/test/configCases/emit-asset/different-source/webpack.config.js index 48a8987ca..c124af721 100644 --- a/test/configCases/emit-asset/different-source/webpack.config.js +++ b/test/configCases/emit-asset/different-source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/emit-asset/equal-source/webpack.config.js b/test/configCases/emit-asset/equal-source/webpack.config.js index 48a8987ca..c124af721 100644 --- a/test/configCases/emit-asset/equal-source/webpack.config.js +++ b/test/configCases/emit-asset/equal-source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/entry/adding-multiple-entry-points/webpack.config.js b/test/configCases/entry/adding-multiple-entry-points/webpack.config.js index d152588fc..994b605b4 100644 --- a/test/configCases/entry/adding-multiple-entry-points/webpack.config.js +++ b/test/configCases/entry/adding-multiple-entry-points/webpack.config.js @@ -1,4 +1,5 @@ const EntryPlugin = require("../../../../").EntryPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: () => ({}), optimization: { diff --git a/test/configCases/entry/depend-on-advanced/webpack.config.js b/test/configCases/entry/depend-on-advanced/webpack.config.js index ac0c0bdca..0bb6c323e 100644 --- a/test/configCases/entry/depend-on-advanced/webpack.config.js +++ b/test/configCases/entry/depend-on-advanced/webpack.config.js @@ -3,6 +3,7 @@ /** @typedef {import("../../../../").Configuration} Configuration */ /** @type {Configuration} */ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return Promise.resolve({ diff --git a/test/configCases/entry/depend-on-simple/webpack.config.js b/test/configCases/entry/depend-on-simple/webpack.config.js index ba29edb8e..157f6ce2a 100644 --- a/test/configCases/entry/depend-on-simple/webpack.config.js +++ b/test/configCases/entry/depend-on-simple/webpack.config.js @@ -1,6 +1,7 @@ /** @typedef {import("../../../../").Compiler} Compiler */ /** @typedef {import("../../../../").Compilation} Compilation */ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { app: { import: "./app.js", dependOn: "react-vendors" }, diff --git a/test/configCases/entry/descriptor/webpack.config.js b/test/configCases/entry/descriptor/webpack.config.js index 12645e335..d6e64eb6e 100644 --- a/test/configCases/entry/descriptor/webpack.config.js +++ b/test/configCases/entry/descriptor/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return { diff --git a/test/configCases/entry/function-promise/webpack.config.js b/test/configCases/entry/function-promise/webpack.config.js index 51f96abb8..50d4e4308 100644 --- a/test/configCases/entry/function-promise/webpack.config.js +++ b/test/configCases/entry/function-promise/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return Promise.resolve({ diff --git a/test/configCases/entry/function/webpack.config.js b/test/configCases/entry/function/webpack.config.js index aaeba7d0f..b7bf7cdd8 100644 --- a/test/configCases/entry/function/webpack.config.js +++ b/test/configCases/entry/function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return { diff --git a/test/configCases/entry/issue-1068/webpack.config.js b/test/configCases/entry/issue-1068/webpack.config.js index 9f42fbd69..e1229c307 100644 --- a/test/configCases/entry/issue-1068/webpack.config.js +++ b/test/configCases/entry/issue-1068/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: [ "./a", diff --git a/test/configCases/entry/issue-8110/webpack.config.js b/test/configCases/entry/issue-8110/webpack.config.js index ca8fd308d..1954865e2 100644 --- a/test/configCases/entry/issue-8110/webpack.config.js +++ b/test/configCases/entry/issue-8110/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./a", diff --git a/test/configCases/entry/require-entry-point/webpack.config.js b/test/configCases/entry/require-entry-point/webpack.config.js index 54b25366f..f8d4436d2 100644 --- a/test/configCases/entry/require-entry-point/webpack.config.js +++ b/test/configCases/entry/require-entry-point/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./require-entry-point", diff --git a/test/configCases/entry/single-entry-point/webpack.config.js b/test/configCases/entry/single-entry-point/webpack.config.js index d663ad3c4..777b9f6bd 100644 --- a/test/configCases/entry/single-entry-point/webpack.config.js +++ b/test/configCases/entry/single-entry-point/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./single-entry-point" }; diff --git a/test/configCases/entry/usage-info-in-multiple-entry-points/webpack.config.js b/test/configCases/entry/usage-info-in-multiple-entry-points/webpack.config.js index 5ccd21b88..294adb67d 100644 --- a/test/configCases/entry/usage-info-in-multiple-entry-points/webpack.config.js +++ b/test/configCases/entry/usage-info-in-multiple-entry-points/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./a", "./b"] }; diff --git a/test/configCases/errors/entry-not-found/webpack.config.js b/test/configCases/errors/entry-not-found/webpack.config.js index f053ebf79..3583b70a3 100644 --- a/test/configCases/errors/entry-not-found/webpack.config.js +++ b/test/configCases/errors/entry-not-found/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration} */ module.exports = {}; diff --git a/test/configCases/errors/exception-in-chunk-renderer/webpack.config.js b/test/configCases/errors/exception-in-chunk-renderer/webpack.config.js index 6a98bf6eb..9319d3db6 100644 --- a/test/configCases/errors/exception-in-chunk-renderer/webpack.config.js +++ b/test/configCases/errors/exception-in-chunk-renderer/webpack.config.js @@ -11,6 +11,7 @@ class ThrowsExceptionInRender { } } +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [new ThrowsExceptionInRender()] }; diff --git a/test/configCases/errors/import-missing/webpack.config.js b/test/configCases/errors/import-missing/webpack.config.js index 51f1a5d59..61694bc09 100644 --- a/test/configCases/errors/import-missing/webpack.config.js +++ b/test/configCases/errors/import-missing/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { bail: true }; diff --git a/test/configCases/errors/multi-entry-missing-module/webpack.config.js b/test/configCases/errors/multi-entry-missing-module/webpack.config.js index baf2b177a..9799f5c71 100644 --- a/test/configCases/errors/multi-entry-missing-module/webpack.config.js +++ b/test/configCases/errors/multi-entry-missing-module/webpack.config.js @@ -1,4 +1,5 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./intentionally-missing-module.js", diff --git a/test/configCases/errors/self-reexport/webpack.config.js b/test/configCases/errors/self-reexport/webpack.config.js index b913c78ab..dffc81bba 100644 --- a/test/configCases/errors/self-reexport/webpack.config.js +++ b/test/configCases/errors/self-reexport/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production" }; diff --git a/test/configCases/externals/externals-in-chunk/webpack.config.js b/test/configCases/externals/externals-in-chunk/webpack.config.js index ee8d99ce3..f147c9f5b 100644 --- a/test/configCases/externals/externals-in-chunk/webpack.config.js +++ b/test/configCases/externals/externals-in-chunk/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { externals: { external: "1+2", diff --git a/test/configCases/externals/externals-in-commons-chunk/webpack.config.js b/test/configCases/externals/externals-in-commons-chunk/webpack.config.js index 6cb5b9d6a..67937d5e7 100644 --- a/test/configCases/externals/externals-in-commons-chunk/webpack.config.js +++ b/test/configCases/externals/externals-in-commons-chunk/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index", diff --git a/test/configCases/externals/externals-system/webpack.config.js b/test/configCases/externals/externals-system/webpack.config.js index c333f47c4..283a0ba49 100644 --- a/test/configCases/externals/externals-system/webpack.config.js +++ b/test/configCases/externals/externals-system/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "system" diff --git a/test/configCases/externals/global/webpack.config.js b/test/configCases/externals/global/webpack.config.js index 5e9889bf3..0396bdef9 100644 --- a/test/configCases/externals/global/webpack.config.js +++ b/test/configCases/externals/global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { externals: { external: "global EXTERNAL_TEST_GLOBAL" diff --git a/test/configCases/externals/harmony/webpack.config.js b/test/configCases/externals/harmony/webpack.config.js index 77dccfd43..471b2a5ce 100644 --- a/test/configCases/externals/harmony/webpack.config.js +++ b/test/configCases/externals/harmony/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { externals: { external: "var 'abc'" diff --git a/test/configCases/externals/non-umd-externals-umd/webpack.config.js b/test/configCases/externals/non-umd-externals-umd/webpack.config.js index acbfaa925..bbb4c9b03 100644 --- a/test/configCases/externals/non-umd-externals-umd/webpack.config.js +++ b/test/configCases/externals/non-umd-externals-umd/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd" diff --git a/test/configCases/externals/non-umd-externals-umd2/webpack.config.js b/test/configCases/externals/non-umd-externals-umd2/webpack.config.js index edca25ee9..423ba3992 100644 --- a/test/configCases/externals/non-umd-externals-umd2/webpack.config.js +++ b/test/configCases/externals/non-umd-externals-umd2/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd2" diff --git a/test/configCases/externals/optional-externals-cjs/webpack.config.js b/test/configCases/externals/optional-externals-cjs/webpack.config.js index 6cffaf1c6..59b592cac 100644 --- a/test/configCases/externals/optional-externals-cjs/webpack.config.js +++ b/test/configCases/externals/optional-externals-cjs/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "commonjs2" diff --git a/test/configCases/externals/optional-externals-root/webpack.config.js b/test/configCases/externals/optional-externals-root/webpack.config.js index 8e541fe7e..cb1a0c126 100644 --- a/test/configCases/externals/optional-externals-root/webpack.config.js +++ b/test/configCases/externals/optional-externals-root/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { externalsType: "var", externals: { diff --git a/test/configCases/externals/optional-externals-umd/webpack.config.js b/test/configCases/externals/optional-externals-umd/webpack.config.js index fe8423e05..ec8b33938 100644 --- a/test/configCases/externals/optional-externals-umd/webpack.config.js +++ b/test/configCases/externals/optional-externals-umd/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd" diff --git a/test/configCases/externals/optional-externals-umd2-mixed/webpack.config.js b/test/configCases/externals/optional-externals-umd2-mixed/webpack.config.js index 1c34a176b..f27ef3ea2 100644 --- a/test/configCases/externals/optional-externals-umd2-mixed/webpack.config.js +++ b/test/configCases/externals/optional-externals-umd2-mixed/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd2" diff --git a/test/configCases/externals/optional-externals-umd2/webpack.config.js b/test/configCases/externals/optional-externals-umd2/webpack.config.js index a89a36f3c..d8f15c437 100644 --- a/test/configCases/externals/optional-externals-umd2/webpack.config.js +++ b/test/configCases/externals/optional-externals-umd2/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd2" diff --git a/test/configCases/filename-template/module-filename-template/webpack.config.js b/test/configCases/filename-template/module-filename-template/webpack.config.js index 735502fc3..b42c6bc33 100644 --- a/test/configCases/filename-template/module-filename-template/webpack.config.js +++ b/test/configCases/filename-template/module-filename-template/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/filename-template/script-src-filename/webpack.config.js b/test/configCases/filename-template/script-src-filename/webpack.config.js index dd02ada1f..8152f6c76 100644 --- a/test/configCases/filename-template/script-src-filename/webpack.config.js +++ b/test/configCases/filename-template/script-src-filename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development" }; diff --git a/test/configCases/filename-template/split-chunks-filename/webpack.config.js b/test/configCases/filename-template/split-chunks-filename/webpack.config.js index 9ea115219..b86d3f1b1 100644 --- a/test/configCases/filename-template/split-chunks-filename/webpack.config.js +++ b/test/configCases/filename-template/split-chunks-filename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", node: { diff --git a/test/configCases/finish-modules/simple/webpack.config.js b/test/configCases/finish-modules/simple/webpack.config.js index c0a1e91e6..af4d4907f 100644 --- a/test/configCases/finish-modules/simple/webpack.config.js +++ b/test/configCases/finish-modules/simple/webpack.config.js @@ -12,6 +12,7 @@ var testPlugin = function () { }); }; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [testPlugin] }; diff --git a/test/configCases/hash-length/output-filename/webpack.config.js b/test/configCases/hash-length/output-filename/webpack.config.js index f7130eec7..be0211d9d 100644 --- a/test/configCases/hash-length/output-filename/webpack.config.js +++ b/test/configCases/hash-length/output-filename/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { name: "hash with length in publicPath", diff --git a/test/configCases/ignore/checkContext/webpack.config.js b/test/configCases/ignore/checkContext/webpack.config.js index 9fe886d3d..e7481af6c 100644 --- a/test/configCases/ignore/checkContext/webpack.config.js +++ b/test/configCases/ignore/checkContext/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/checkResource-one-argument/webpack.config.js b/test/configCases/ignore/checkResource-one-argument/webpack.config.js index b468d0c92..557cdc49c 100644 --- a/test/configCases/ignore/checkResource-one-argument/webpack.config.js +++ b/test/configCases/ignore/checkResource-one-argument/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/checkResource-two-arguments/webpack.config.js b/test/configCases/ignore/checkResource-two-arguments/webpack.config.js index 9fe886d3d..e7481af6c 100644 --- a/test/configCases/ignore/checkResource-two-arguments/webpack.config.js +++ b/test/configCases/ignore/checkResource-two-arguments/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/false-alias/webpack.config.js b/test/configCases/ignore/false-alias/webpack.config.js index 2aa45293d..2ab026773 100644 --- a/test/configCases/ignore/false-alias/webpack.config.js +++ b/test/configCases/ignore/false-alias/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", resolve: { diff --git a/test/configCases/ignore/multiple-with-externals/webpack.config.js b/test/configCases/ignore/multiple-with-externals/webpack.config.js index 5e383d114..b8a3a7343 100644 --- a/test/configCases/ignore/multiple-with-externals/webpack.config.js +++ b/test/configCases/ignore/multiple-with-externals/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", externals: { diff --git a/test/configCases/ignore/only-resource-context/webpack.config.js b/test/configCases/ignore/only-resource-context/webpack.config.js index 0c9f86cf2..d0210ba16 100644 --- a/test/configCases/ignore/only-resource-context/webpack.config.js +++ b/test/configCases/ignore/only-resource-context/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/only-resource/webpack.config.js b/test/configCases/ignore/only-resource/webpack.config.js index 0c9f86cf2..d0210ba16 100644 --- a/test/configCases/ignore/only-resource/webpack.config.js +++ b/test/configCases/ignore/only-resource/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/resource-and-context-contextmodule/webpack.config.js b/test/configCases/ignore/resource-and-context-contextmodule/webpack.config.js index 01bd02bc9..5c9f6cbe2 100644 --- a/test/configCases/ignore/resource-and-context-contextmodule/webpack.config.js +++ b/test/configCases/ignore/resource-and-context-contextmodule/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/resource-and-context/webpack.config.js b/test/configCases/ignore/resource-and-context/webpack.config.js index 01bd02bc9..5c9f6cbe2 100644 --- a/test/configCases/ignore/resource-and-context/webpack.config.js +++ b/test/configCases/ignore/resource-and-context/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/issues/issue-3596/webpack.config.js b/test/configCases/issues/issue-3596/webpack.config.js index 34cf32437..d03f4fdc1 100644 --- a/test/configCases/issues/issue-3596/webpack.config.js +++ b/test/configCases/issues/issue-3596/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./index", diff --git a/test/configCases/json/tree-shaking-default/webpack.config.js b/test/configCases/json/tree-shaking-default/webpack.config.js index f727276b3..5e6a2dea4 100644 --- a/test/configCases/json/tree-shaking-default/webpack.config.js +++ b/test/configCases/json/tree-shaking-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", node: { diff --git a/test/configCases/library/a/webpack.config.js b/test/configCases/library/a/webpack.config.js index bcd111fb1..d6284c7ac 100644 --- a/test/configCases/library/a/webpack.config.js +++ b/test/configCases/library/a/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "this" diff --git a/test/configCases/library/array-global/webpack.config.js b/test/configCases/library/array-global/webpack.config.js index bc177f6b5..2e6d8a1e2 100644 --- a/test/configCases/library/array-global/webpack.config.js +++ b/test/configCases/library/array-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: ["a", "b"] diff --git a/test/configCases/library/array-window/webpack.config.js b/test/configCases/library/array-window/webpack.config.js index 010ed97f1..0a58ae241 100644 --- a/test/configCases/library/array-window/webpack.config.js +++ b/test/configCases/library/array-window/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/library/b/webpack.config.js b/test/configCases/library/b/webpack.config.js index 92f8b666b..e2f1eaa2d 100644 --- a/test/configCases/library/b/webpack.config.js +++ b/test/configCases/library/b/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "global" diff --git a/test/configCases/library/umd-array/webpack.config.js b/test/configCases/library/umd-array/webpack.config.js index fba3d5e17..73b14934a 100644 --- a/test/configCases/library/umd-array/webpack.config.js +++ b/test/configCases/library/umd-array/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd", diff --git a/test/configCases/library/umd/webpack.config.js b/test/configCases/library/umd/webpack.config.js index 4ce89d69c..815908500 100644 --- a/test/configCases/library/umd/webpack.config.js +++ b/test/configCases/library/umd/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd", diff --git a/test/configCases/loaders/generate-ident/webpack.config.js b/test/configCases/loaders/generate-ident/webpack.config.js index 0f1384495..c316a6a0a 100644 --- a/test/configCases/loaders/generate-ident/webpack.config.js +++ b/test/configCases/loaders/generate-ident/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/loaders/issue-3320/webpack.config.js b/test/configCases/loaders/issue-3320/webpack.config.js index e2b3d79d2..f943c051e 100644 --- a/test/configCases/loaders/issue-3320/webpack.config.js +++ b/test/configCases/loaders/issue-3320/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { resolveLoader: { alias: { diff --git a/test/configCases/loaders/issue-9053/webpack.config.js b/test/configCases/loaders/issue-9053/webpack.config.js index b77f86881..fc77b7765 100644 --- a/test/configCases/loaders/issue-9053/webpack.config.js +++ b/test/configCases/loaders/issue-9053/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/loaders/mode-default/webpack.config.js b/test/configCases/loaders/mode-default/webpack.config.js index 87ef526b9..b991738c0 100644 --- a/test/configCases/loaders/mode-default/webpack.config.js +++ b/test/configCases/loaders/mode-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/loaders/mode-development/webpack.config.js b/test/configCases/loaders/mode-development/webpack.config.js index 5d7d3bf9b..7184f5d44 100644 --- a/test/configCases/loaders/mode-development/webpack.config.js +++ b/test/configCases/loaders/mode-development/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/loaders/mode-none/webpack.config.js b/test/configCases/loaders/mode-none/webpack.config.js index ba5a8fb0a..a0b076d51 100644 --- a/test/configCases/loaders/mode-none/webpack.config.js +++ b/test/configCases/loaders/mode-none/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "none", module: { diff --git a/test/configCases/loaders/mode-production/webpack.config.js b/test/configCases/loaders/mode-production/webpack.config.js index 20f3afada..09b14d843 100644 --- a/test/configCases/loaders/mode-production/webpack.config.js +++ b/test/configCases/loaders/mode-production/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", module: { diff --git a/test/configCases/loaders/options/webpack.config.js b/test/configCases/loaders/options/webpack.config.js index c7870d8e6..6b5d57233 100644 --- a/test/configCases/loaders/options/webpack.config.js +++ b/test/configCases/loaders/options/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "none", module: { diff --git a/test/configCases/loaders/pre-post-loader/webpack.config.js b/test/configCases/loaders/pre-post-loader/webpack.config.js index 5a229d44a..c460255ce 100644 --- a/test/configCases/loaders/pre-post-loader/webpack.config.js +++ b/test/configCases/loaders/pre-post-loader/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/loaders/remaining-request/webpack.config.js b/test/configCases/loaders/remaining-request/webpack.config.js index 7109dba99..081789a6f 100644 --- a/test/configCases/loaders/remaining-request/webpack.config.js +++ b/test/configCases/loaders/remaining-request/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/mangle/mangle-with-object-prop/webpack.config.js b/test/configCases/mangle/mangle-with-object-prop/webpack.config.js index fee2bf64a..3d405a2e2 100644 --- a/test/configCases/mangle/mangle-with-object-prop/webpack.config.js +++ b/test/configCases/mangle/mangle-with-object-prop/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { mangleExports: true, diff --git a/test/configCases/mjs/esm-by-default/webpack.config.js b/test/configCases/mjs/esm-by-default/webpack.config.js index f053ebf79..3583b70a3 100644 --- a/test/configCases/mjs/esm-by-default/webpack.config.js +++ b/test/configCases/mjs/esm-by-default/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration} */ module.exports = {}; diff --git a/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js b/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js index 6527d721c..e86db6268 100644 --- a/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js +++ b/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", entry: ["./a", "./b", "./test"], diff --git a/test/configCases/no-parse/module.exports/webpack.config.js b/test/configCases/no-parse/module.exports/webpack.config.js index 5588dd0a1..b63c4511a 100644 --- a/test/configCases/no-parse/module.exports/webpack.config.js +++ b/test/configCases/no-parse/module.exports/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { noParse: /not-parsed/ diff --git a/test/configCases/no-parse/no-parse-function/webpack.config.js b/test/configCases/no-parse/no-parse-function/webpack.config.js index 2180c19f7..c40613062 100644 --- a/test/configCases/no-parse/no-parse-function/webpack.config.js +++ b/test/configCases/no-parse/no-parse-function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { noParse: function (content) { diff --git a/test/configCases/optimization/hashed-module-ids/webpack.config.js b/test/configCases/optimization/hashed-module-ids/webpack.config.js index 80e9e2199..e3f2e0b3b 100644 --- a/test/configCases/optimization/hashed-module-ids/webpack.config.js +++ b/test/configCases/optimization/hashed-module-ids/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "hashed" diff --git a/test/configCases/optimization/minimizer/webpack.config.js b/test/configCases/optimization/minimizer/webpack.config.js index 06ee86158..e15c2ba44 100644 --- a/test/configCases/optimization/minimizer/webpack.config.js +++ b/test/configCases/optimization/minimizer/webpack.config.js @@ -1,5 +1,6 @@ const Compiler = require("../../../../").Compiler; +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { minimize: true, diff --git a/test/configCases/optimization/named-modules/webpack.config.js b/test/configCases/optimization/named-modules/webpack.config.js index eef5638fa..15fb81f1b 100644 --- a/test/configCases/optimization/named-modules/webpack.config.js +++ b/test/configCases/optimization/named-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named" diff --git a/test/configCases/output/function/webpack.config.js b/test/configCases/output/function/webpack.config.js index 2cfbedfe1..85fe19d42 100644 --- a/test/configCases/output/function/webpack.config.js +++ b/test/configCases/output/function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return { diff --git a/test/configCases/output/inner-dirs-entries/webpack.config.js b/test/configCases/output/inner-dirs-entries/webpack.config.js index 1348a226f..74d71fbfc 100644 --- a/test/configCases/output/inner-dirs-entries/webpack.config.js +++ b/test/configCases/output/inner-dirs-entries/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "none", entry: { diff --git a/test/configCases/output/string/webpack.config.js b/test/configCases/output/string/webpack.config.js index 113bc4282..d96ec181e 100644 --- a/test/configCases/output/string/webpack.config.js +++ b/test/configCases/output/string/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return { diff --git a/test/configCases/parsing/context/webpack.config.js b/test/configCases/parsing/context/webpack.config.js index cac06dfd0..91e80ba3b 100644 --- a/test/configCases/parsing/context/webpack.config.js +++ b/test/configCases/parsing/context/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { unknownContextRegExp: /^\.\//, diff --git a/test/configCases/parsing/extended-api/webpack.config.js b/test/configCases/parsing/extended-api/webpack.config.js index 4e7044c97..111b9e76b 100644 --- a/test/configCases/parsing/extended-api/webpack.config.js +++ b/test/configCases/parsing/extended-api/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { other: "./index" diff --git a/test/configCases/parsing/harmony-global/webpack.config.js b/test/configCases/parsing/harmony-global/webpack.config.js index a65179e2b..7bb5f004c 100644 --- a/test/configCases/parsing/harmony-global/webpack.config.js +++ b/test/configCases/parsing/harmony-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", performance: { diff --git a/test/configCases/parsing/harmony-this-concat/webpack.config.js b/test/configCases/parsing/harmony-this-concat/webpack.config.js index dfb1984cf..8c13599c6 100644 --- a/test/configCases/parsing/harmony-this-concat/webpack.config.js +++ b/test/configCases/parsing/harmony-this-concat/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictThisContextOnImports: true diff --git a/test/configCases/parsing/harmony-this/webpack.config.js b/test/configCases/parsing/harmony-this/webpack.config.js index 3877e9e67..2423e135e 100644 --- a/test/configCases/parsing/harmony-this/webpack.config.js +++ b/test/configCases/parsing/harmony-this/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictThisContextOnImports: true diff --git a/test/configCases/parsing/import-ignore/webpack.config.js b/test/configCases/parsing/import-ignore/webpack.config.js index 4fcaf47ef..a824d9201 100644 --- a/test/configCases/parsing/import-ignore/webpack.config.js +++ b/test/configCases/parsing/import-ignore/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./index.js", diff --git a/test/configCases/parsing/issue-2942/webpack.config.js b/test/configCases/parsing/issue-2942/webpack.config.js index 0570b6f2f..cb87a26bb 100644 --- a/test/configCases/parsing/issue-2942/webpack.config.js +++ b/test/configCases/parsing/issue-2942/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/parsing/issue-336/webpack.config.js b/test/configCases/parsing/issue-336/webpack.config.js index acaf8803c..987365418 100644 --- a/test/configCases/parsing/issue-336/webpack.config.js +++ b/test/configCases/parsing/issue-336/webpack.config.js @@ -1,4 +1,5 @@ var ProvidePlugin = require("../../../../").ProvidePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new ProvidePlugin({ diff --git a/test/configCases/parsing/issue-4857/webpack.config.js b/test/configCases/parsing/issue-4857/webpack.config.js index 61e31872c..e30e85e93 100644 --- a/test/configCases/parsing/issue-4857/webpack.config.js +++ b/test/configCases/parsing/issue-4857/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { minimize: false diff --git a/test/configCases/parsing/issue-5624/webpack.config.js b/test/configCases/parsing/issue-5624/webpack.config.js index dfb1984cf..8c13599c6 100644 --- a/test/configCases/parsing/issue-5624/webpack.config.js +++ b/test/configCases/parsing/issue-5624/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictThisContextOnImports: true diff --git a/test/configCases/parsing/issue-8293/webpack.config.js b/test/configCases/parsing/issue-8293/webpack.config.js index da6af6d20..09541e8dc 100644 --- a/test/configCases/parsing/issue-8293/webpack.config.js +++ b/test/configCases/parsing/issue-8293/webpack.config.js @@ -1,5 +1,6 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./index.js", diff --git a/test/configCases/parsing/issue-9042/webpack.config.js b/test/configCases/parsing/issue-9042/webpack.config.js index 47da81765..0a96337dc 100644 --- a/test/configCases/parsing/issue-9042/webpack.config.js +++ b/test/configCases/parsing/issue-9042/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", node: { diff --git a/test/configCases/parsing/issue-9156/webpack.config.js b/test/configCases/parsing/issue-9156/webpack.config.js index 9f1a00b55..0c8b672e3 100644 --- a/test/configCases/parsing/issue-9156/webpack.config.js +++ b/test/configCases/parsing/issue-9156/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", node: false diff --git a/test/configCases/parsing/node-source-plugin-off/webpack.config.js b/test/configCases/parsing/node-source-plugin-off/webpack.config.js index 9f1a00b55..0c8b672e3 100644 --- a/test/configCases/parsing/node-source-plugin-off/webpack.config.js +++ b/test/configCases/parsing/node-source-plugin-off/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", node: false diff --git a/test/configCases/parsing/node-stuff-plugin-off/webpack.config.js b/test/configCases/parsing/node-stuff-plugin-off/webpack.config.js index 9f1a00b55..0c8b672e3 100644 --- a/test/configCases/parsing/node-stuff-plugin-off/webpack.config.js +++ b/test/configCases/parsing/node-stuff-plugin-off/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", node: false diff --git a/test/configCases/parsing/relative-filedirname/webpack.config.js b/test/configCases/parsing/relative-filedirname/webpack.config.js index 3381b779e..14316147f 100644 --- a/test/configCases/parsing/relative-filedirname/webpack.config.js +++ b/test/configCases/parsing/relative-filedirname/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __filename: true, diff --git a/test/configCases/parsing/require.main/webpack.config.js b/test/configCases/parsing/require.main/webpack.config.js index f053ebf79..3583b70a3 100644 --- a/test/configCases/parsing/require.main/webpack.config.js +++ b/test/configCases/parsing/require.main/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration} */ module.exports = {}; diff --git a/test/configCases/parsing/requirejs/webpack.config.js b/test/configCases/parsing/requirejs/webpack.config.js index 44b2c6f35..8da4d0ff7 100644 --- a/test/configCases/parsing/requirejs/webpack.config.js +++ b/test/configCases/parsing/requirejs/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/performance/many-async-imports/webpack.config.js b/test/configCases/performance/many-async-imports/webpack.config.js index 61e31872c..e30e85e93 100644 --- a/test/configCases/performance/many-async-imports/webpack.config.js +++ b/test/configCases/performance/many-async-imports/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { minimize: false diff --git a/test/configCases/performance/many-exports/webpack.config.js b/test/configCases/performance/many-exports/webpack.config.js index 61e31872c..e30e85e93 100644 --- a/test/configCases/performance/many-exports/webpack.config.js +++ b/test/configCases/performance/many-exports/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { minimize: false diff --git a/test/configCases/plugins/banner-plugin-hashing/webpack.config.js b/test/configCases/plugins/banner-plugin-hashing/webpack.config.js index 48dc816c2..5d62b4121 100644 --- a/test/configCases/plugins/banner-plugin-hashing/webpack.config.js +++ b/test/configCases/plugins/banner-plugin-hashing/webpack.config.js @@ -2,6 +2,7 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/plugins/banner-plugin/webpack.config.js b/test/configCases/plugins/banner-plugin/webpack.config.js index da65d83f9..ced05eea1 100644 --- a/test/configCases/plugins/banner-plugin/webpack.config.js +++ b/test/configCases/plugins/banner-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/plugins/define-plugin-bigint/webpack.config.js b/test/configCases/plugins/define-plugin-bigint/webpack.config.js index 456650581..b5b8cca1c 100644 --- a/test/configCases/plugins/define-plugin-bigint/webpack.config.js +++ b/test/configCases/plugins/define-plugin-bigint/webpack.config.js @@ -1,5 +1,6 @@ var DefinePlugin = require("../../../../").DefinePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 11 diff --git a/test/configCases/plugins/define-plugin/webpack.config.js b/test/configCases/plugins/define-plugin/webpack.config.js index 8b85abe12..4f202b594 100644 --- a/test/configCases/plugins/define-plugin/webpack.config.js +++ b/test/configCases/plugins/define-plugin/webpack.config.js @@ -1,5 +1,6 @@ var DefinePlugin = require("../../../../").DefinePlugin; const Module = require("../../../../").Module; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new DefinePlugin({ diff --git a/test/configCases/plugins/lib-manifest-plugin/webpack.config.js b/test/configCases/plugins/lib-manifest-plugin/webpack.config.js index 471c797ab..db7a115a5 100644 --- a/test/configCases/plugins/lib-manifest-plugin/webpack.config.js +++ b/test/configCases/plugins/lib-manifest-plugin/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var LibManifestPlugin = require("../../../../").LibManifestPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: ["./"] diff --git a/test/configCases/plugins/loader-options-plugin/webpack.config.js b/test/configCases/plugins/loader-options-plugin/webpack.config.js index 57efbcfad..4f644b0d6 100644 --- a/test/configCases/plugins/loader-options-plugin/webpack.config.js +++ b/test/configCases/plugins/loader-options-plugin/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.LoaderOptionsPlugin({ diff --git a/test/configCases/plugins/min-chunk-size/webpack.config.js b/test/configCases/plugins/min-chunk-size/webpack.config.js index 9ab2871e4..2464a9a3e 100644 --- a/test/configCases/plugins/min-chunk-size/webpack.config.js +++ b/test/configCases/plugins/min-chunk-size/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.optimize.MinChunkSizePlugin({ diff --git a/test/configCases/plugins/mini-css-extract-plugin/webpack.config.js b/test/configCases/plugins/mini-css-extract-plugin/webpack.config.js index 97589b2d1..37397dd24 100644 --- a/test/configCases/plugins/mini-css-extract-plugin/webpack.config.js +++ b/test/configCases/plugins/mini-css-extract-plugin/webpack.config.js @@ -1,5 +1,6 @@ var MCEP = require("mini-css-extract-plugin"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/plugins/progress-plugin/data.js b/test/configCases/plugins/progress-plugin/data.js index e0a30c5df..747c818b0 100644 --- a/test/configCases/plugins/progress-plugin/data.js +++ b/test/configCases/plugins/progress-plugin/data.js @@ -1 +1 @@ -module.exports = []; +module.exports = /** @type {string[]} */ ([]); diff --git a/test/configCases/plugins/progress-plugin/webpack.config.js b/test/configCases/plugins/progress-plugin/webpack.config.js index ddcf06368..3fc4768be 100644 --- a/test/configCases/plugins/progress-plugin/webpack.config.js +++ b/test/configCases/plugins/progress-plugin/webpack.config.js @@ -1,6 +1,7 @@ const path = require("path"); const webpack = require("../../../../"); const data = require("./data"); +/** @type {import("../../../../").Configuration} */ module.exports = { externals: { data: "commonjs " + path.resolve(__dirname, "data.js") diff --git a/test/configCases/plugins/provide-plugin/webpack.config.js b/test/configCases/plugins/provide-plugin/webpack.config.js index bbabf3dc1..bf040faf1 100644 --- a/test/configCases/plugins/provide-plugin/webpack.config.js +++ b/test/configCases/plugins/provide-plugin/webpack.config.js @@ -1,4 +1,5 @@ var ProvidePlugin = require("../../../../").ProvidePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new ProvidePlugin({ diff --git a/test/configCases/plugins/source-map-dev-tool-plugin/webpack.config.js b/test/configCases/plugins/source-map-dev-tool-plugin/webpack.config.js index 59bb25d2a..1e0012a05 100644 --- a/test/configCases/plugins/source-map-dev-tool-plugin/webpack.config.js +++ b/test/configCases/plugins/source-map-dev-tool-plugin/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); var TerserPlugin = require("terser-webpack-plugin"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/plugins/source-map-dev-tool-plugin~append/webpack.config.js b/test/configCases/plugins/source-map-dev-tool-plugin~append/webpack.config.js index 6942bf0dd..3fff92b5c 100644 --- a/test/configCases/plugins/source-map-dev-tool-plugin~append/webpack.config.js +++ b/test/configCases/plugins/source-map-dev-tool-plugin~append/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); var TerserPlugin = require("terser-webpack-plugin"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/plugins/terser-plugin/webpack.config.js b/test/configCases/plugins/terser-plugin/webpack.config.js index 6e8384f21..04c63a9a9 100644 --- a/test/configCases/plugins/terser-plugin/webpack.config.js +++ b/test/configCases/plugins/terser-plugin/webpack.config.js @@ -1,4 +1,5 @@ const TerserPlugin = require("terser-webpack-plugin"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/race-conditions/load-module/webpack.config.js b/test/configCases/race-conditions/load-module/webpack.config.js index e39f50108..40427f860 100644 --- a/test/configCases/race-conditions/load-module/webpack.config.js +++ b/test/configCases/race-conditions/load-module/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { parallelism: 1 }; diff --git a/test/configCases/records/issue-295/webpack.config.js b/test/configCases/records/issue-295/webpack.config.js index 987f3640b..f285f7279 100644 --- a/test/configCases/records/issue-295/webpack.config.js +++ b/test/configCases/records/issue-295/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test", recordsPath: path.resolve( diff --git a/test/configCases/records/issue-2991/webpack.config.js b/test/configCases/records/issue-2991/webpack.config.js index 3d017931f..06e85654a 100644 --- a/test/configCases/records/issue-2991/webpack.config.js +++ b/test/configCases/records/issue-2991/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test", recordsOutputPath: path.resolve( diff --git a/test/configCases/records/issue-7339/webpack.config.js b/test/configCases/records/issue-7339/webpack.config.js index 0d7b9410f..51fca1dd2 100644 --- a/test/configCases/records/issue-7339/webpack.config.js +++ b/test/configCases/records/issue-7339/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test", recordsOutputPath: path.resolve( diff --git a/test/configCases/records/issue-7492/webpack.config.js b/test/configCases/records/issue-7492/webpack.config.js index 32bbc5f69..f7e9c7b3f 100644 --- a/test/configCases/records/issue-7492/webpack.config.js +++ b/test/configCases/records/issue-7492/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", recordsInputPath: path.resolve(__dirname, "records.json"), diff --git a/test/configCases/records/stable-sort/webpack.config.js b/test/configCases/records/stable-sort/webpack.config.js index d44a32f15..94f54c2e5 100644 --- a/test/configCases/records/stable-sort/webpack.config.js +++ b/test/configCases/records/stable-sort/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", entry: "./test", diff --git a/test/configCases/resolve/multi-alias/webpack.config.js b/test/configCases/resolve/multi-alias/webpack.config.js index 7e5109376..5d07a1386 100644 --- a/test/configCases/resolve/multi-alias/webpack.config.js +++ b/test/configCases/resolve/multi-alias/webpack.config.js @@ -1,4 +1,5 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { resolve: { alias: { diff --git a/test/configCases/rule-set/chaining/webpack.config.js b/test/configCases/rule-set/chaining/webpack.config.js index 908eda0c5..88c052b57 100644 --- a/test/configCases/rule-set/chaining/webpack.config.js +++ b/test/configCases/rule-set/chaining/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/compiler/webpack.config.js b/test/configCases/rule-set/compiler/webpack.config.js index 3b42db9b0..11c0be4e0 100644 --- a/test/configCases/rule-set/compiler/webpack.config.js +++ b/test/configCases/rule-set/compiler/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { name: "compiler-name", module: { diff --git a/test/configCases/rule-set/custom/webpack.config.js b/test/configCases/rule-set/custom/webpack.config.js index 6c1851b2f..dd898aebc 100644 --- a/test/configCases/rule-set/custom/webpack.config.js +++ b/test/configCases/rule-set/custom/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/query/webpack.config.js b/test/configCases/rule-set/query/webpack.config.js index cfa3e696e..589fd6fe6 100644 --- a/test/configCases/rule-set/query/webpack.config.js +++ b/test/configCases/rule-set/query/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/resolve-options/webpack.config.js b/test/configCases/rule-set/resolve-options/webpack.config.js index 7808abf02..cf15580f0 100644 --- a/test/configCases/rule-set/resolve-options/webpack.config.js +++ b/test/configCases/rule-set/resolve-options/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { resolve: { alias: { diff --git a/test/configCases/rule-set/simple-use-array-fn/webpack.config.js b/test/configCases/rule-set/simple-use-array-fn/webpack.config.js index 852de277a..5e3b61809 100644 --- a/test/configCases/rule-set/simple-use-array-fn/webpack.config.js +++ b/test/configCases/rule-set/simple-use-array-fn/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/simple-use-fn-array/webpack.config.js b/test/configCases/rule-set/simple-use-fn-array/webpack.config.js index b58ddda2c..6ac920770 100644 --- a/test/configCases/rule-set/simple-use-fn-array/webpack.config.js +++ b/test/configCases/rule-set/simple-use-fn-array/webpack.config.js @@ -22,6 +22,7 @@ var useArray = createFunctionArrayFromUseArray([ } ]); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/simple/webpack.config.js b/test/configCases/rule-set/simple/webpack.config.js index 5447ed4e1..663137217 100644 --- a/test/configCases/rule-set/simple/webpack.config.js +++ b/test/configCases/rule-set/simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/undefined-values/webpack.config.js b/test/configCases/rule-set/undefined-values/webpack.config.js index c130e4148..0b3933fba 100644 --- a/test/configCases/rule-set/undefined-values/webpack.config.js +++ b/test/configCases/rule-set/undefined-values/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/runtime/invalid-esm-export/webpack.config.js b/test/configCases/runtime/invalid-esm-export/webpack.config.js index dd02ada1f..8152f6c76 100644 --- a/test/configCases/runtime/invalid-esm-export/webpack.config.js +++ b/test/configCases/runtime/invalid-esm-export/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development" }; diff --git a/test/configCases/runtime/opt-in-finally/webpack.config.js b/test/configCases/runtime/opt-in-finally/webpack.config.js index 15a47b1f6..b98edea7f 100644 --- a/test/configCases/runtime/opt-in-finally/webpack.config.js +++ b/test/configCases/runtime/opt-in-finally/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { strictModuleExceptionHandling: true diff --git a/test/configCases/scope-hoisting/class-naming/webpack.config.js b/test/configCases/scope-hoisting/class-naming/webpack.config.js index 59e948b12..c939ba33f 100644 --- a/test/configCases/scope-hoisting/class-naming/webpack.config.js +++ b/test/configCases/scope-hoisting/class-naming/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { concatenateModules: true diff --git a/test/configCases/scope-hoisting/create-dll-plugin/webpack.config.js b/test/configCases/scope-hoisting/create-dll-plugin/webpack.config.js index f169ea12e..7727d1499 100644 --- a/test/configCases/scope-hoisting/create-dll-plugin/webpack.config.js +++ b/test/configCases/scope-hoisting/create-dll-plugin/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./index.js"], plugins: [ diff --git a/test/configCases/scope-hoisting/dll-plugin/webpack.config.js b/test/configCases/scope-hoisting/dll-plugin/webpack.config.js index b79c4000a..a001ff03c 100644 --- a/test/configCases/scope-hoisting/dll-plugin/webpack.config.js +++ b/test/configCases/scope-hoisting/dll-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DllReferencePlugin({ diff --git a/test/configCases/scope-hoisting/esModule/webpack.config.js b/test/configCases/scope-hoisting/esModule/webpack.config.js index b5fcc43ed..363b516ca 100644 --- a/test/configCases/scope-hoisting/esModule/webpack.config.js +++ b/test/configCases/scope-hoisting/esModule/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", devtool: false, diff --git a/test/configCases/scope-hoisting/export-global/webpack.config.js b/test/configCases/scope-hoisting/export-global/webpack.config.js index 59e948b12..c939ba33f 100644 --- a/test/configCases/scope-hoisting/export-global/webpack.config.js +++ b/test/configCases/scope-hoisting/export-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { concatenateModules: true diff --git a/test/configCases/scope-hoisting/harmony-pure-default/webpack.config.js b/test/configCases/scope-hoisting/harmony-pure-default/webpack.config.js index e963f0342..7d36a68c1 100644 --- a/test/configCases/scope-hoisting/harmony-pure-default/webpack.config.js +++ b/test/configCases/scope-hoisting/harmony-pure-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/configCases/scope-hoisting/named-modules/webpack.config.js b/test/configCases/scope-hoisting/named-modules/webpack.config.js index 4f053bf10..4a7373bf9 100644 --- a/test/configCases/scope-hoisting/named-modules/webpack.config.js +++ b/test/configCases/scope-hoisting/named-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named", diff --git a/test/configCases/scope-hoisting/strictThisContextOnImports/webpack.config.js b/test/configCases/scope-hoisting/strictThisContextOnImports/webpack.config.js index 9cd2bdf56..4b05152b1 100644 --- a/test/configCases/scope-hoisting/strictThisContextOnImports/webpack.config.js +++ b/test/configCases/scope-hoisting/strictThisContextOnImports/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictThisContextOnImports: true diff --git a/test/configCases/side-effects/side-effects-override/webpack.config.js b/test/configCases/side-effects/side-effects-override/webpack.config.js index 789ad53cf..8270d6220 100644 --- a/test/configCases/side-effects/side-effects-override/webpack.config.js +++ b/test/configCases/side-effects/side-effects-override/webpack.config.js @@ -1,4 +1,5 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", module: { diff --git a/test/configCases/side-effects/side-effects-values/webpack.config.js b/test/configCases/side-effects/side-effects-values/webpack.config.js index c5fce2d1b..5e498c669 100644 --- a/test/configCases/side-effects/side-effects-values/webpack.config.js +++ b/test/configCases/side-effects/side-effects-values/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", module: { diff --git a/test/configCases/simple/empty-config/webpack.config.js b/test/configCases/simple/empty-config/webpack.config.js index f053ebf79..3583b70a3 100644 --- a/test/configCases/simple/empty-config/webpack.config.js +++ b/test/configCases/simple/empty-config/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration} */ module.exports = {}; diff --git a/test/configCases/source-map/array-as-output-library-in-object-output/webpack.config.js b/test/configCases/source-map/array-as-output-library-in-object-output/webpack.config.js index d9c8900e5..5adb84b32 100644 --- a/test/configCases/source-map/array-as-output-library-in-object-output/webpack.config.js +++ b/test/configCases/source-map/array-as-output-library-in-object-output/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "source-map", output: { diff --git a/test/configCases/source-map/array-as-output-library/webpack.config.js b/test/configCases/source-map/array-as-output-library/webpack.config.js index ee3cbe39b..81087b112 100644 --- a/test/configCases/source-map/array-as-output-library/webpack.config.js +++ b/test/configCases/source-map/array-as-output-library/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "source-map", output: { diff --git a/test/configCases/source-map/default-filename-extensions-css/webpack.config.js b/test/configCases/source-map/default-filename-extensions-css/webpack.config.js index 1b969d38d..ae476c291 100644 --- a/test/configCases/source-map/default-filename-extensions-css/webpack.config.js +++ b/test/configCases/source-map/default-filename-extensions-css/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/default-filename-extensions-js/webpack.config.js b/test/configCases/source-map/default-filename-extensions-js/webpack.config.js index 597a81501..63d1ba55a 100644 --- a/test/configCases/source-map/default-filename-extensions-js/webpack.config.js +++ b/test/configCases/source-map/default-filename-extensions-js/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js b/test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js index 9f5b271c0..a4ea70713 100644 --- a/test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js +++ b/test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/exclude-chunks-source-map/webpack.config.js b/test/configCases/source-map/exclude-chunks-source-map/webpack.config.js index 3e69a12fe..e84cbb332 100644 --- a/test/configCases/source-map/exclude-chunks-source-map/webpack.config.js +++ b/test/configCases/source-map/exclude-chunks-source-map/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", devtool: false, diff --git a/test/configCases/source-map/exclude-modules-source-map/webpack.config.js b/test/configCases/source-map/exclude-modules-source-map/webpack.config.js index 028743e5c..c78370dd6 100644 --- a/test/configCases/source-map/exclude-modules-source-map/webpack.config.js +++ b/test/configCases/source-map/exclude-modules-source-map/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/source-map/module-names/webpack.config.js b/test/configCases/source-map/module-names/webpack.config.js index 961eb67d9..249cf04c4 100644 --- a/test/configCases/source-map/module-names/webpack.config.js +++ b/test/configCases/source-map/module-names/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/namespace-source-path.library/webpack.config.js b/test/configCases/source-map/namespace-source-path.library/webpack.config.js index ae84e5f4b..71e95006f 100644 --- a/test/configCases/source-map/namespace-source-path.library/webpack.config.js +++ b/test/configCases/source-map/namespace-source-path.library/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/namespace-source-path/webpack.config.js b/test/configCases/source-map/namespace-source-path/webpack.config.js index 37c0d2642..12407607a 100644 --- a/test/configCases/source-map/namespace-source-path/webpack.config.js +++ b/test/configCases/source-map/namespace-source-path/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/nosources/webpack.config.js b/test/configCases/source-map/nosources/webpack.config.js index 07b6b6160..3cf657210 100644 --- a/test/configCases/source-map/nosources/webpack.config.js +++ b/test/configCases/source-map/nosources/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", node: { diff --git a/test/configCases/source-map/object-as-output-library/webpack.config.js b/test/configCases/source-map/object-as-output-library/webpack.config.js index 13662dafd..5da44457e 100644 --- a/test/configCases/source-map/object-as-output-library/webpack.config.js +++ b/test/configCases/source-map/object-as-output-library/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "source-map", output: { diff --git a/test/configCases/source-map/relative-source-map-path/webpack.config.js b/test/configCases/source-map/relative-source-map-path/webpack.config.js index 07b079a42..ccfc9bff6 100644 --- a/test/configCases/source-map/relative-source-map-path/webpack.config.js +++ b/test/configCases/source-map/relative-source-map-path/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/relative-source-maps-by-loader/webpack.config.js b/test/configCases/source-map/relative-source-maps-by-loader/webpack.config.js index 628f31af6..c0a285cd1 100644 --- a/test/configCases/source-map/relative-source-maps-by-loader/webpack.config.js +++ b/test/configCases/source-map/relative-source-maps-by-loader/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", node: { diff --git a/test/configCases/source-map/source-map-filename-contenthash/webpack.config.js b/test/configCases/source-map/source-map-filename-contenthash/webpack.config.js index 01478ecd9..1926f4f11 100644 --- a/test/configCases/source-map/source-map-filename-contenthash/webpack.config.js +++ b/test/configCases/source-map/source-map-filename-contenthash/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", node: { diff --git a/test/configCases/source-map/source-map-with-profiling-plugin/webpack.config.js b/test/configCases/source-map/source-map-with-profiling-plugin/webpack.config.js index ecc013f88..8c475bd85 100644 --- a/test/configCases/source-map/source-map-with-profiling-plugin/webpack.config.js +++ b/test/configCases/source-map/source-map-with-profiling-plugin/webpack.config.js @@ -2,6 +2,7 @@ var webpack = require("../../../../"); var path = require("path"); var os = require("os"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/source-map/sources-array-production/webpack.config.js b/test/configCases/source-map/sources-array-production/webpack.config.js index acbb8608c..e741f449e 100644 --- a/test/configCases/source-map/sources-array-production/webpack.config.js +++ b/test/configCases/source-map/sources-array-production/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/split-chunks-common/correct-order/webpack.config.js b/test/configCases/split-chunks-common/correct-order/webpack.config.js index cc7e99cd6..65bafc0f6 100644 --- a/test/configCases/split-chunks-common/correct-order/webpack.config.js +++ b/test/configCases/split-chunks-common/correct-order/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["./a"], diff --git a/test/configCases/split-chunks-common/extract-async-from-entry/webpack.config.js b/test/configCases/split-chunks-common/extract-async-from-entry/webpack.config.js index 39260c23c..715e35bdb 100644 --- a/test/configCases/split-chunks-common/extract-async-from-entry/webpack.config.js +++ b/test/configCases/split-chunks-common/extract-async-from-entry/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index", diff --git a/test/configCases/split-chunks-common/hot-multi/webpack.config.js b/test/configCases/split-chunks-common/hot-multi/webpack.config.js index 10a7fc60a..62a60e069 100644 --- a/test/configCases/split-chunks-common/hot-multi/webpack.config.js +++ b/test/configCases/split-chunks-common/hot-multi/webpack.config.js @@ -1,5 +1,6 @@ var HotModuleReplacementPlugin = require("../../../../") .HotModuleReplacementPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { first: ["./shared", "./first"], diff --git a/test/configCases/split-chunks-common/hot/webpack.config.js b/test/configCases/split-chunks-common/hot/webpack.config.js index 3319ff9ac..e5d5f87c7 100644 --- a/test/configCases/split-chunks-common/hot/webpack.config.js +++ b/test/configCases/split-chunks-common/hot/webpack.config.js @@ -1,5 +1,6 @@ var HotModuleReplacementPlugin = require("../../../../") .HotModuleReplacementPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index" diff --git a/test/configCases/split-chunks-common/inverted-order/webpack.config.js b/test/configCases/split-chunks-common/inverted-order/webpack.config.js index cc7e99cd6..65bafc0f6 100644 --- a/test/configCases/split-chunks-common/inverted-order/webpack.config.js +++ b/test/configCases/split-chunks-common/inverted-order/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["./a"], diff --git a/test/configCases/split-chunks-common/move-entry/webpack.config.js b/test/configCases/split-chunks-common/move-entry/webpack.config.js index 9310be1c3..36226f722 100644 --- a/test/configCases/split-chunks-common/move-entry/webpack.config.js +++ b/test/configCases/split-chunks-common/move-entry/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index?0", diff --git a/test/configCases/split-chunks-common/move-to-grandparent/webpack.config.js b/test/configCases/split-chunks-common/move-to-grandparent/webpack.config.js index 520f039b2..183a1227e 100644 --- a/test/configCases/split-chunks-common/move-to-grandparent/webpack.config.js +++ b/test/configCases/split-chunks-common/move-to-grandparent/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index", diff --git a/test/configCases/split-chunks-common/simple/webpack.config.js b/test/configCases/split-chunks-common/simple/webpack.config.js index cc7e99cd6..65bafc0f6 100644 --- a/test/configCases/split-chunks-common/simple/webpack.config.js +++ b/test/configCases/split-chunks-common/simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["./a"], diff --git a/test/configCases/split-chunks/chunk-filename-delimiter-default/webpack.config.js b/test/configCases/split-chunks/chunk-filename-delimiter-default/webpack.config.js index 437704f50..1395d0976 100644 --- a/test/configCases/split-chunks/chunk-filename-delimiter-default/webpack.config.js +++ b/test/configCases/split-chunks/chunk-filename-delimiter-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/configCases/split-chunks/chunk-filename-delimiter/webpack.config.js b/test/configCases/split-chunks/chunk-filename-delimiter/webpack.config.js index 0214b8486..968fd8fc9 100644 --- a/test/configCases/split-chunks/chunk-filename-delimiter/webpack.config.js +++ b/test/configCases/split-chunks/chunk-filename-delimiter/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/configCases/split-chunks/custom-filename-function/webpack.config.js b/test/configCases/split-chunks/custom-filename-function/webpack.config.js index e54b5b878..91d2a24b5 100644 --- a/test/configCases/split-chunks/custom-filename-function/webpack.config.js +++ b/test/configCases/split-chunks/custom-filename-function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/split-chunks/custom-filename-many-custom/webpack.config.js b/test/configCases/split-chunks/custom-filename-many-custom/webpack.config.js index f398c1169..46accefd6 100644 --- a/test/configCases/split-chunks/custom-filename-many-custom/webpack.config.js +++ b/test/configCases/split-chunks/custom-filename-many-custom/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/split-chunks/custom-filename/webpack.config.js b/test/configCases/split-chunks/custom-filename/webpack.config.js index f398c1169..46accefd6 100644 --- a/test/configCases/split-chunks/custom-filename/webpack.config.js +++ b/test/configCases/split-chunks/custom-filename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/split-chunks/entry-point-error/webpack.config.js b/test/configCases/split-chunks/entry-point-error/webpack.config.js index fb8410004..dacba3864 100644 --- a/test/configCases/split-chunks/entry-point-error/webpack.config.js +++ b/test/configCases/split-chunks/entry-point-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendors: ["./module"], diff --git a/test/configCases/split-chunks/incorrect-chunk-reuse/webpack.config.js b/test/configCases/split-chunks/incorrect-chunk-reuse/webpack.config.js index 9c635ed7c..5704fc5c5 100644 --- a/test/configCases/split-chunks/incorrect-chunk-reuse/webpack.config.js +++ b/test/configCases/split-chunks/incorrect-chunk-reuse/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", optimization: { diff --git a/test/configCases/split-chunks/issue-8908/webpack.config.js b/test/configCases/split-chunks/issue-8908/webpack.config.js index b0cf6df96..c7307692c 100644 --- a/test/configCases/split-chunks/issue-8908/webpack.config.js +++ b/test/configCases/split-chunks/issue-8908/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/split-chunks/issue-9491/webpack.config.js b/test/configCases/split-chunks/issue-9491/webpack.config.js index a77f03a66..bfced90ac 100644 --- a/test/configCases/split-chunks/issue-9491/webpack.config.js +++ b/test/configCases/split-chunks/issue-9491/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { constructor: "./index" diff --git a/test/configCases/split-chunks/module-type-filter/webpack.config.js b/test/configCases/split-chunks/module-type-filter/webpack.config.js index 3a6eac218..3b2df399f 100644 --- a/test/configCases/split-chunks/module-type-filter/webpack.config.js +++ b/test/configCases/split-chunks/module-type-filter/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index" diff --git a/test/configCases/split-chunks/no-options/webpack.config.js b/test/configCases/split-chunks/no-options/webpack.config.js index 3298c5aae..2fec23d7f 100644 --- a/test/configCases/split-chunks/no-options/webpack.config.js +++ b/test/configCases/split-chunks/no-options/webpack.config.js @@ -1,5 +1,6 @@ const { SplitChunksPlugin } = require("../../../../").optimize; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["./a"], diff --git a/test/configCases/split-chunks/reuse-chunk-name/webpack.config.js b/test/configCases/split-chunks/reuse-chunk-name/webpack.config.js index 773d3304c..a31736a39 100644 --- a/test/configCases/split-chunks/reuse-chunk-name/webpack.config.js +++ b/test/configCases/split-chunks/reuse-chunk-name/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { filename: "[name].js" diff --git a/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js b/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js index 5f4da7943..b8fb043d7 100644 --- a/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js +++ b/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index" diff --git a/test/configCases/split-chunks/runtime-chunk/webpack.config.js b/test/configCases/split-chunks/runtime-chunk/webpack.config.js index c3b3f6110..180a47ff5 100644 --- a/test/configCases/split-chunks/runtime-chunk/webpack.config.js +++ b/test/configCases/split-chunks/runtime-chunk/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/target/amd-named/webpack.config.js b/test/configCases/target/amd-named/webpack.config.js index f80f8f3a0..426146503 100644 --- a/test/configCases/target/amd-named/webpack.config.js +++ b/test/configCases/target/amd-named/webpack.config.js @@ -1,4 +1,5 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "NamedLibrary", diff --git a/test/configCases/target/amd-require/webpack.config.js b/test/configCases/target/amd-require/webpack.config.js index 1bb3b0ac2..a280fb2a0 100644 --- a/test/configCases/target/amd-require/webpack.config.js +++ b/test/configCases/target/amd-require/webpack.config.js @@ -1,4 +1,5 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "amd-require" diff --git a/test/configCases/target/amd-unnamed/webpack.config.js b/test/configCases/target/amd-unnamed/webpack.config.js index 494051b75..3f02249eb 100644 --- a/test/configCases/target/amd-unnamed/webpack.config.js +++ b/test/configCases/target/amd-unnamed/webpack.config.js @@ -1,4 +1,5 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "amd" diff --git a/test/configCases/target/electron-renderer/webpack.config.js b/test/configCases/target/electron-renderer/webpack.config.js index 55a90182f..e7d1ecf5c 100644 --- a/test/configCases/target/electron-renderer/webpack.config.js +++ b/test/configCases/target/electron-renderer/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "electron-renderer", optimization: { diff --git a/test/configCases/target/node-dynamic-import/webpack.config.js b/test/configCases/target/node-dynamic-import/webpack.config.js index 85beb01b7..411eb1af1 100644 --- a/test/configCases/target/node-dynamic-import/webpack.config.js +++ b/test/configCases/target/node-dynamic-import/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "node", performance: { diff --git a/test/configCases/target/strict-mode-global/webpack.config.js b/test/configCases/target/strict-mode-global/webpack.config.js index 7105dc09e..03c779ee0 100644 --- a/test/configCases/target/strict-mode-global/webpack.config.js +++ b/test/configCases/target/strict-mode-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web" }; diff --git a/test/configCases/target/system-context/webpack.config.js b/test/configCases/target/system-context/webpack.config.js index 063b49207..2d1a8001f 100644 --- a/test/configCases/target/system-context/webpack.config.js +++ b/test/configCases/target/system-context/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "system" diff --git a/test/configCases/target/system-export/webpack.config.js b/test/configCases/target/system-export/webpack.config.js index 063b49207..2d1a8001f 100644 --- a/test/configCases/target/system-export/webpack.config.js +++ b/test/configCases/target/system-export/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "system" diff --git a/test/configCases/target/system-named-assets-path/webpack.config.js b/test/configCases/target/system-named-assets-path/webpack.config.js index 16bbc7f12..4dc791678 100644 --- a/test/configCases/target/system-named-assets-path/webpack.config.js +++ b/test/configCases/target/system-named-assets-path/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "named-system-module-[name]", diff --git a/test/configCases/target/system-named/webpack.config.js b/test/configCases/target/system-named/webpack.config.js index 1f4b76b0c..fef28f250 100644 --- a/test/configCases/target/system-named/webpack.config.js +++ b/test/configCases/target/system-named/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "named-system-module", diff --git a/test/configCases/target/system-unnamed/webpack.config.js b/test/configCases/target/system-unnamed/webpack.config.js index 063b49207..2d1a8001f 100644 --- a/test/configCases/target/system-unnamed/webpack.config.js +++ b/test/configCases/target/system-unnamed/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "system" diff --git a/test/configCases/target/umd-auxiliary-comments-object/webpack.config.js b/test/configCases/target/umd-auxiliary-comments-object/webpack.config.js index 194732838..43147101b 100644 --- a/test/configCases/target/umd-auxiliary-comments-object/webpack.config.js +++ b/test/configCases/target/umd-auxiliary-comments-object/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "NamedLibrary", diff --git a/test/configCases/target/umd-auxiliary-comments-string/webpack.config.js b/test/configCases/target/umd-auxiliary-comments-string/webpack.config.js index 82e0dfe1e..739c67f4f 100644 --- a/test/configCases/target/umd-auxiliary-comments-string/webpack.config.js +++ b/test/configCases/target/umd-auxiliary-comments-string/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "NamedLibrary", diff --git a/test/configCases/target/umd-named-define/webpack.config.js b/test/configCases/target/umd-named-define/webpack.config.js index be904c79d..bfe025995 100644 --- a/test/configCases/target/umd-named-define/webpack.config.js +++ b/test/configCases/target/umd-named-define/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "NamedLibrary", diff --git a/test/configCases/utils/lazy-set/webpack.config.js b/test/configCases/utils/lazy-set/webpack.config.js index 39ff2ee83..5a23d98af 100644 --- a/test/configCases/utils/lazy-set/webpack.config.js +++ b/test/configCases/utils/lazy-set/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ compiler => { diff --git a/test/configCases/wasm/export-imported-global/webpack.config.js b/test/configCases/wasm/export-imported-global/webpack.config.js index 7ac4a3ab7..63567a475 100644 --- a/test/configCases/wasm/export-imported-global/webpack.config.js +++ b/test/configCases/wasm/export-imported-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", module: { diff --git a/test/configCases/wasm/identical/webpack.config.js b/test/configCases/wasm/identical/webpack.config.js index 614dd5574..1e48ea814 100644 --- a/test/configCases/wasm/identical/webpack.config.js +++ b/test/configCases/wasm/identical/webpack.config.js @@ -3,6 +3,7 @@ const { AsyncWebAssemblyModulesPlugin } = require("../../../../").wasm; /** @typedef {import("../../../../").Compiler} Compiler */ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/wasm/import-wasm-wasm/webpack.config.js b/test/configCases/wasm/import-wasm-wasm/webpack.config.js index 7ac4a3ab7..63567a475 100644 --- a/test/configCases/wasm/import-wasm-wasm/webpack.config.js +++ b/test/configCases/wasm/import-wasm-wasm/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", module: { diff --git a/test/configCases/wasm/wasm-in-initial-chunk-error/webpack.config.js b/test/configCases/wasm/wasm-in-initial-chunk-error/webpack.config.js index bc80a015f..13e314096 100644 --- a/test/configCases/wasm/wasm-in-initial-chunk-error/webpack.config.js +++ b/test/configCases/wasm/wasm-in-initial-chunk-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", module: { diff --git a/test/configCases/web/node-source/webpack.config.js b/test/configCases/web/node-source/webpack.config.js index 721e519b0..6524ff2c4 100644 --- a/test/configCases/web/node-source/webpack.config.js +++ b/test/configCases/web/node-source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", entry: "./index.mjs", diff --git a/test/configCases/web/prefetch-preload/webpack.config.js b/test/configCases/web/prefetch-preload/webpack.config.js index 34460c414..08945539a 100644 --- a/test/configCases/web/prefetch-preload/webpack.config.js +++ b/test/configCases/web/prefetch-preload/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/web/prefetch-split-chunks/webpack.config.js b/test/configCases/web/prefetch-split-chunks/webpack.config.js index 6a2f545c4..392e26644 100644 --- a/test/configCases/web/prefetch-split-chunks/webpack.config.js +++ b/test/configCases/web/prefetch-split-chunks/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/web/retry-failed-import/webpack.config.js b/test/configCases/web/retry-failed-import/webpack.config.js index c9b63678b..f7950dc53 100644 --- a/test/configCases/web/retry-failed-import/webpack.config.js +++ b/test/configCases/web/retry-failed-import/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/web/unique-jsonp/webpack.config.js b/test/configCases/web/unique-jsonp/webpack.config.js index 6094bc126..681dcca65 100644 --- a/test/configCases/web/unique-jsonp/webpack.config.js +++ b/test/configCases/web/unique-jsonp/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/hotCases/concat/reload-compat-flag/webpack.config.js b/test/hotCases/concat/reload-compat-flag/webpack.config.js index 1e91d5bfb..af38831a6 100644 --- a/test/hotCases/concat/reload-compat-flag/webpack.config.js +++ b/test/hotCases/concat/reload-compat-flag/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/hotCases/concat/reload-external/webpack.config.js b/test/hotCases/concat/reload-external/webpack.config.js index 1e91d5bfb..af38831a6 100644 --- a/test/hotCases/concat/reload-external/webpack.config.js +++ b/test/hotCases/concat/reload-external/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/hotCases/define/issue-6962/webpack.config.js b/test/hotCases/define/issue-6962/webpack.config.js index 3d212ee5e..933fa42c9 100644 --- a/test/hotCases/define/issue-6962/webpack.config.js +++ b/test/hotCases/define/issue-6962/webpack.config.js @@ -2,6 +2,7 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DefinePlugin({ diff --git a/test/hotCases/numeric-ids/production/webpack.config.js b/test/hotCases/numeric-ids/production/webpack.config.js index 1e91d5bfb..af38831a6 100644 --- a/test/hotCases/numeric-ids/production/webpack.config.js +++ b/test/hotCases/numeric-ids/production/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/hotPlayground/webpack.config.js b/test/hotPlayground/webpack.config.js index 65d1d9bd6..c27afdd64 100644 --- a/test/hotPlayground/webpack.config.js +++ b/test/hotPlayground/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../"); +/** @type {import("../../").Configuration} */ module.exports = { entry: ["../../hot/dev-server", "./index.js"], output: { diff --git a/test/statsCases/aggressive-splitting-on-demand/webpack.config.js b/test/statsCases/aggressive-splitting-on-demand/webpack.config.js index 0abc3b5bf..1af9f4056 100644 --- a/test/statsCases/aggressive-splitting-on-demand/webpack.config.js +++ b/test/statsCases/aggressive-splitting-on-demand/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/asset/webpack.config.js b/test/statsCases/asset/webpack.config.js index 3b8a08504..be774ea86 100644 --- a/test/statsCases/asset/webpack.config.js +++ b/test/statsCases/asset/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index.js", diff --git a/test/statsCases/async-commons-chunk/webpack.config.js b/test/statsCases/async-commons-chunk/webpack.config.js index e694033c4..aee3af004 100644 --- a/test/statsCases/async-commons-chunk/webpack.config.js +++ b/test/statsCases/async-commons-chunk/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./", diff --git a/test/statsCases/chunk-module-id-range/webpack.config.js b/test/statsCases/chunk-module-id-range/webpack.config.js index 106510f42..e1f2fa4a4 100644 --- a/test/statsCases/chunk-module-id-range/webpack.config.js +++ b/test/statsCases/chunk-module-id-range/webpack.config.js @@ -1,5 +1,6 @@ const webpack = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "none", entry: { diff --git a/test/statsCases/chunks-development/webpack.config.js b/test/statsCases/chunks-development/webpack.config.js index 861efcb11..0bb545053 100644 --- a/test/statsCases/chunks-development/webpack.config.js +++ b/test/statsCases/chunks-development/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: "./index", diff --git a/test/statsCases/chunks/webpack.config.js b/test/statsCases/chunks/webpack.config.js index c9d18ec9b..77e3fd4f9 100644 --- a/test/statsCases/chunks/webpack.config.js +++ b/test/statsCases/chunks/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/circular-correctness/webpack.config.js b/test/statsCases/circular-correctness/webpack.config.js index e23a3870e..ca513b287 100644 --- a/test/statsCases/circular-correctness/webpack.config.js +++ b/test/statsCases/circular-correctness/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/color-disabled/webpack.config.js b/test/statsCases/color-disabled/webpack.config.js index 1ef4d9dca..5d1378233 100644 --- a/test/statsCases/color-disabled/webpack.config.js +++ b/test/statsCases/color-disabled/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/color-enabled-custom/webpack.config.js b/test/statsCases/color-enabled-custom/webpack.config.js index 92a8a2296..a8cf451ed 100644 --- a/test/statsCases/color-enabled-custom/webpack.config.js +++ b/test/statsCases/color-enabled-custom/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/color-enabled/webpack.config.js b/test/statsCases/color-enabled/webpack.config.js index e2970ecca..8db94e736 100644 --- a/test/statsCases/color-enabled/webpack.config.js +++ b/test/statsCases/color-enabled/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/commons-chunk-min-size-0/webpack.config.js b/test/statsCases/commons-chunk-min-size-0/webpack.config.js index 7a7759a70..a68deca16 100644 --- a/test/statsCases/commons-chunk-min-size-0/webpack.config.js +++ b/test/statsCases/commons-chunk-min-size-0/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/commons-chunk-min-size-Infinity/webpack.config.js b/test/statsCases/commons-chunk-min-size-Infinity/webpack.config.js index 38d753566..b4b0364a3 100644 --- a/test/statsCases/commons-chunk-min-size-Infinity/webpack.config.js +++ b/test/statsCases/commons-chunk-min-size-Infinity/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/concat-and-sideeffects/webpack.config.js b/test/statsCases/concat-and-sideeffects/webpack.config.js index 82aa88389..14ef0be99 100644 --- a/test/statsCases/concat-and-sideeffects/webpack.config.js +++ b/test/statsCases/concat-and-sideeffects/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/dll-reference-plugin-issue-7624-error/webpack.config.js b/test/statsCases/dll-reference-plugin-issue-7624-error/webpack.config.js index aa0403c26..66cb016c3 100644 --- a/test/statsCases/dll-reference-plugin-issue-7624-error/webpack.config.js +++ b/test/statsCases/dll-reference-plugin-issue-7624-error/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./entry.js", diff --git a/test/statsCases/dll-reference-plugin-issue-7624/webpack.config.js b/test/statsCases/dll-reference-plugin-issue-7624/webpack.config.js index cfd2bfe93..d23d0a6a9 100644 --- a/test/statsCases/dll-reference-plugin-issue-7624/webpack.config.js +++ b/test/statsCases/dll-reference-plugin-issue-7624/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./entry.js", diff --git a/test/statsCases/entry-filename/webpack.config.js b/test/statsCases/entry-filename/webpack.config.js index d04fbcd00..c5f9cf1a8 100644 --- a/test/statsCases/entry-filename/webpack.config.js +++ b/test/statsCases/entry-filename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/exclude-with-loader/webpack.config.js b/test/statsCases/exclude-with-loader/webpack.config.js index 46ce565d5..973691d20 100644 --- a/test/statsCases/exclude-with-loader/webpack.config.js +++ b/test/statsCases/exclude-with-loader/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/external/webpack.config.js b/test/statsCases/external/webpack.config.js index 24daca96b..9dcff537b 100644 --- a/test/statsCases/external/webpack.config.js +++ b/test/statsCases/external/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/graph-correctness-entries/webpack.config.js b/test/statsCases/graph-correctness-entries/webpack.config.js index 3e7aec2ab..9730d47fd 100644 --- a/test/statsCases/graph-correctness-entries/webpack.config.js +++ b/test/statsCases/graph-correctness-entries/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/graph-correctness-modules/webpack.config.js b/test/statsCases/graph-correctness-modules/webpack.config.js index 3e7aec2ab..9730d47fd 100644 --- a/test/statsCases/graph-correctness-modules/webpack.config.js +++ b/test/statsCases/graph-correctness-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/graph-roots/webpack.config.js b/test/statsCases/graph-roots/webpack.config.js index 2fb6a9a36..2a5d6a4b7 100644 --- a/test/statsCases/graph-roots/webpack.config.js +++ b/test/statsCases/graph-roots/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: "./index.js", diff --git a/test/statsCases/immutable/webpack.config.js b/test/statsCases/immutable/webpack.config.js index 99361f45e..2bbf3aa2c 100644 --- a/test/statsCases/immutable/webpack.config.js +++ b/test/statsCases/immutable/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: "./index.js", diff --git a/test/statsCases/import-context-filter/webpack.config.js b/test/statsCases/import-context-filter/webpack.config.js index 070e43028..250f8f5e6 100644 --- a/test/statsCases/import-context-filter/webpack.config.js +++ b/test/statsCases/import-context-filter/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/import-weak/webpack.config.js b/test/statsCases/import-weak/webpack.config.js index 070e43028..250f8f5e6 100644 --- a/test/statsCases/import-weak/webpack.config.js +++ b/test/statsCases/import-weak/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/import-with-invalid-options-comments/webpack.config.js b/test/statsCases/import-with-invalid-options-comments/webpack.config.js index 4a36fba10..29bbb8551 100644 --- a/test/statsCases/import-with-invalid-options-comments/webpack.config.js +++ b/test/statsCases/import-with-invalid-options-comments/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/logging/webpack.config.js b/test/statsCases/logging/webpack.config.js index 8d89f8f6a..e3e086af9 100644 --- a/test/statsCases/logging/webpack.config.js +++ b/test/statsCases/logging/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/max-modules-default/webpack.config.js b/test/statsCases/max-modules-default/webpack.config.js index 069d6d62d..30e8de2c0 100644 --- a/test/statsCases/max-modules-default/webpack.config.js +++ b/test/statsCases/max-modules-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/max-modules/webpack.config.js b/test/statsCases/max-modules/webpack.config.js index c2f9c5fdd..9336217b1 100644 --- a/test/statsCases/max-modules/webpack.config.js +++ b/test/statsCases/max-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-assets/webpack.config.js b/test/statsCases/module-assets/webpack.config.js index ce6ab4d08..2f4363315 100644 --- a/test/statsCases/module-assets/webpack.config.js +++ b/test/statsCases/module-assets/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-deduplication-named/webpack.config.js b/test/statsCases/module-deduplication-named/webpack.config.js index 039f03011..5d2d91f08 100644 --- a/test/statsCases/module-deduplication-named/webpack.config.js +++ b/test/statsCases/module-deduplication-named/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/module-deduplication/webpack.config.js b/test/statsCases/module-deduplication/webpack.config.js index 039f03011..5d2d91f08 100644 --- a/test/statsCases/module-deduplication/webpack.config.js +++ b/test/statsCases/module-deduplication/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/module-not-found-error/webpack.config.js b/test/statsCases/module-not-found-error/webpack.config.js index 7f65a6052..04f99c809 100644 --- a/test/statsCases/module-not-found-error/webpack.config.js +++ b/test/statsCases/module-not-found-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-reasons/webpack.config.js b/test/statsCases/module-reasons/webpack.config.js index 3ff01eb5c..db7b8b180 100644 --- a/test/statsCases/module-reasons/webpack.config.js +++ b/test/statsCases/module-reasons/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-trace-disabled-in-error/webpack.config.js b/test/statsCases/module-trace-disabled-in-error/webpack.config.js index cb5614a81..c860373b9 100644 --- a/test/statsCases/module-trace-disabled-in-error/webpack.config.js +++ b/test/statsCases/module-trace-disabled-in-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-trace-enabled-in-error/webpack.config.js b/test/statsCases/module-trace-enabled-in-error/webpack.config.js index d282e7799..f4751ec1b 100644 --- a/test/statsCases/module-trace-enabled-in-error/webpack.config.js +++ b/test/statsCases/module-trace-enabled-in-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/named-chunks-plugin-async/webpack.config.js b/test/statsCases/named-chunks-plugin-async/webpack.config.js index 9464080e2..e43559383 100644 --- a/test/statsCases/named-chunks-plugin-async/webpack.config.js +++ b/test/statsCases/named-chunks-plugin-async/webpack.config.js @@ -1,37 +1,15 @@ "use strict"; -const webpack = require("../../../"); -const RequestShortener = require("../../../lib/RequestShortener"); -const { compareModulesByIdentifier } = require("../../../lib/util/comparators"); +const { + ids: { NamedChunkIdsPlugin } +} = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", optimization: { chunkIds: false }, entry: { entry: "./entry" }, - plugins: [ - new webpack.ids.NamedChunkIdsPlugin((chunk, { chunkGraph }) => { - if (chunk.name) { - return chunk.name; - } - const chunkModulesToName = chunk => - Array.from( - chunkGraph.getOrderedChunkModulesIterable( - chunk, - compareModulesByIdentifier - ), - mod => { - const rs = new RequestShortener(mod.context); - return rs.shorten(mod.request).replace(/[./\\]/g, "_"); - } - ).join("-"); - - if (chunkGraph.getNumberOfChunkModules(chunk) > 0) { - return `chunk-containing-${chunkModulesToName(chunk)}`; - } - - return null; - }) - ] + plugins: [new NamedChunkIdsPlugin()] }; diff --git a/test/statsCases/named-chunks-plugin/webpack.config.js b/test/statsCases/named-chunks-plugin/webpack.config.js index 25b43be57..b358371ed 100644 --- a/test/statsCases/named-chunks-plugin/webpack.config.js +++ b/test/statsCases/named-chunks-plugin/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/no-emit-on-errors-plugin-with-child-error/TestChildCompilationFailurePlugin.js b/test/statsCases/no-emit-on-errors-plugin-with-child-error/TestChildCompilationFailurePlugin.js index 2c5f1ce1a..886ccc49b 100644 --- a/test/statsCases/no-emit-on-errors-plugin-with-child-error/TestChildCompilationFailurePlugin.js +++ b/test/statsCases/no-emit-on-errors-plugin-with-child-error/TestChildCompilationFailurePlugin.js @@ -1,6 +1,6 @@ "use strict"; -var EntryPlugin = require("../../../lib/EntryPlugin"); +var EntryPlugin = require("../../../").EntryPlugin; /** * Runs a child compilation which produces an error in order to test that NoEmitErrorsPlugin diff --git a/test/statsCases/no-emit-on-errors-plugin-with-child-error/webpack.config.js b/test/statsCases/no-emit-on-errors-plugin-with-child-error/webpack.config.js index 427b1b0a6..f63e085ff 100644 --- a/test/statsCases/no-emit-on-errors-plugin-with-child-error/webpack.config.js +++ b/test/statsCases/no-emit-on-errors-plugin-with-child-error/webpack.config.js @@ -3,6 +3,7 @@ var NoEmitOnErrorsPlugin = require("../../../").NoEmitOnErrorsPlugin; var TestChildCompilationFailurePlugin = require("./TestChildCompilationFailurePlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { entry: "./index", output: { diff --git a/test/statsCases/optimize-chunks/webpack.config.js b/test/statsCases/optimize-chunks/webpack.config.js index 8c46b3ed4..3e8414aa5 100644 --- a/test/statsCases/optimize-chunks/webpack.config.js +++ b/test/statsCases/optimize-chunks/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/parse-error/webpack.config.js b/test/statsCases/parse-error/webpack.config.js index 1bc2a16d0..a5a7c03fe 100644 --- a/test/statsCases/parse-error/webpack.config.js +++ b/test/statsCases/parse-error/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/performance-disabled/webpack.config.js b/test/statsCases/performance-disabled/webpack.config.js index 801f4a8da..49d169952 100644 --- a/test/statsCases/performance-disabled/webpack.config.js +++ b/test/statsCases/performance-disabled/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/performance-error/webpack.config.js b/test/statsCases/performance-error/webpack.config.js index 285444ea3..2a53b9837 100644 --- a/test/statsCases/performance-error/webpack.config.js +++ b/test/statsCases/performance-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/performance-no-async-chunks-shown/webpack.config.js b/test/statsCases/performance-no-async-chunks-shown/webpack.config.js index d015fde10..1147c3f18 100644 --- a/test/statsCases/performance-no-async-chunks-shown/webpack.config.js +++ b/test/statsCases/performance-no-async-chunks-shown/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/performance-no-hints/webpack.config.js b/test/statsCases/performance-no-hints/webpack.config.js index 1aed48513..793fe03db 100644 --- a/test/statsCases/performance-no-hints/webpack.config.js +++ b/test/statsCases/performance-no-hints/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/performance-oversize-limit-error/webpack.config.js b/test/statsCases/performance-oversize-limit-error/webpack.config.js index 9e37f0aef..79b0915ec 100644 --- a/test/statsCases/performance-oversize-limit-error/webpack.config.js +++ b/test/statsCases/performance-oversize-limit-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/prefetch-preload-mixed/webpack.config.js b/test/statsCases/prefetch-preload-mixed/webpack.config.js index f5306974b..d864bc6af 100644 --- a/test/statsCases/prefetch-preload-mixed/webpack.config.js +++ b/test/statsCases/prefetch-preload-mixed/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/prefetch/webpack.config.js b/test/statsCases/prefetch/webpack.config.js index 6c11dc3dd..3d0b86864 100644 --- a/test/statsCases/prefetch/webpack.config.js +++ b/test/statsCases/prefetch/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preload/webpack.config.js b/test/statsCases/preload/webpack.config.js index 17dba56db..98ab976d6 100644 --- a/test/statsCases/preload/webpack.config.js +++ b/test/statsCases/preload/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-detailed/webpack.config.js b/test/statsCases/preset-detailed/webpack.config.js index 27d988981..b3f4ace1f 100644 --- a/test/statsCases/preset-detailed/webpack.config.js +++ b/test/statsCases/preset-detailed/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-errors-only-error/webpack.config.js b/test/statsCases/preset-errors-only-error/webpack.config.js index 0f4a73577..a07357dda 100644 --- a/test/statsCases/preset-errors-only-error/webpack.config.js +++ b/test/statsCases/preset-errors-only-error/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-errors-only/webpack.config.js b/test/statsCases/preset-errors-only/webpack.config.js index 7f65a6052..04f99c809 100644 --- a/test/statsCases/preset-errors-only/webpack.config.js +++ b/test/statsCases/preset-errors-only/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-errors-warnings/webpack.config.js b/test/statsCases/preset-errors-warnings/webpack.config.js index 7697cda4e..68ce0928c 100644 --- a/test/statsCases/preset-errors-warnings/webpack.config.js +++ b/test/statsCases/preset-errors-warnings/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-minimal-simple/webpack.config.js b/test/statsCases/preset-minimal-simple/webpack.config.js index 53931799c..c4fb6fdc0 100644 --- a/test/statsCases/preset-minimal-simple/webpack.config.js +++ b/test/statsCases/preset-minimal-simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-minimal/webpack.config.js b/test/statsCases/preset-minimal/webpack.config.js index 85a5515e2..7ba0caf0a 100644 --- a/test/statsCases/preset-minimal/webpack.config.js +++ b/test/statsCases/preset-minimal/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-none-error/webpack.config.js b/test/statsCases/preset-none-error/webpack.config.js index e99589235..fc5edb6b4 100644 --- a/test/statsCases/preset-none-error/webpack.config.js +++ b/test/statsCases/preset-none-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-none/webpack.config.js b/test/statsCases/preset-none/webpack.config.js index 750ca8a51..54cc4b2d3 100644 --- a/test/statsCases/preset-none/webpack.config.js +++ b/test/statsCases/preset-none/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/webpack.config.js b/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/webpack.config.js index a15145c2a..919599037 100644 --- a/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/webpack.config.js +++ b/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", devtool: "source-map", diff --git a/test/statsCases/preset-normal-performance/webpack.config.js b/test/statsCases/preset-normal-performance/webpack.config.js index bc76bd698..1de6394e5 100644 --- a/test/statsCases/preset-normal-performance/webpack.config.js +++ b/test/statsCases/preset-normal-performance/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-normal/webpack.config.js b/test/statsCases/preset-normal/webpack.config.js index ae534acc1..6b76a5c3b 100644 --- a/test/statsCases/preset-normal/webpack.config.js +++ b/test/statsCases/preset-normal/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-verbose/webpack.config.js b/test/statsCases/preset-verbose/webpack.config.js index b4e977e78..912534b99 100644 --- a/test/statsCases/preset-verbose/webpack.config.js +++ b/test/statsCases/preset-verbose/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/resolve-plugin-context/webpack.config.js b/test/statsCases/resolve-plugin-context/webpack.config.js index 5d7be1fe4..34ed2f09c 100644 --- a/test/statsCases/resolve-plugin-context/webpack.config.js +++ b/test/statsCases/resolve-plugin-context/webpack.config.js @@ -1,5 +1,6 @@ var ResolvePackageFromRootPlugin = require("./ResolvePackageFromRootPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/reverse-sort-modules/webpack.config.js b/test/statsCases/reverse-sort-modules/webpack.config.js index f1f2620ec..58fb498c8 100644 --- a/test/statsCases/reverse-sort-modules/webpack.config.js +++ b/test/statsCases/reverse-sort-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/runtime-chunk-issue-7382/webpack.config.js b/test/statsCases/runtime-chunk-issue-7382/webpack.config.js index ba14189a1..b44443f50 100644 --- a/test/statsCases/runtime-chunk-issue-7382/webpack.config.js +++ b/test/statsCases/runtime-chunk-issue-7382/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/statsCases/runtime-chunk-single/webpack.config.js b/test/statsCases/runtime-chunk-single/webpack.config.js index d221181ec..f5b3476f7 100644 --- a/test/statsCases/runtime-chunk-single/webpack.config.js +++ b/test/statsCases/runtime-chunk-single/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/statsCases/runtime-chunk/webpack.config.js b/test/statsCases/runtime-chunk/webpack.config.js index 0abe241e7..8bbebaa7b 100644 --- a/test/statsCases/runtime-chunk/webpack.config.js +++ b/test/statsCases/runtime-chunk/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/statsCases/scope-hoisting-bailouts/webpack.config.js b/test/statsCases/scope-hoisting-bailouts/webpack.config.js index 780993d09..61a8acc6d 100644 --- a/test/statsCases/scope-hoisting-bailouts/webpack.config.js +++ b/test/statsCases/scope-hoisting-bailouts/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/side-effects-issue-7428/webpack.config.js b/test/statsCases/side-effects-issue-7428/webpack.config.js index ad3db197d..7d6f086d6 100644 --- a/test/statsCases/side-effects-issue-7428/webpack.config.js +++ b/test/statsCases/side-effects-issue-7428/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "none", entry: "./main.js", diff --git a/test/statsCases/side-effects-simple-unused/webpack.config.js b/test/statsCases/side-effects-simple-unused/webpack.config.js index 3f2af3b91..f41626e10 100644 --- a/test/statsCases/side-effects-simple-unused/webpack.config.js +++ b/test/statsCases/side-effects-simple-unused/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/simple-more-info/webpack.config.js b/test/statsCases/simple-more-info/webpack.config.js index 3ac8e8d8b..b26ccc2f4 100644 --- a/test/statsCases/simple-more-info/webpack.config.js +++ b/test/statsCases/simple-more-info/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/split-chunks-automatic-name/webpack.config.js b/test/statsCases/split-chunks-automatic-name/webpack.config.js index 7f4361afe..fc73caaf9 100644 --- a/test/statsCases/split-chunks-automatic-name/webpack.config.js +++ b/test/statsCases/split-chunks-automatic-name/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { name: "production", mode: "production", diff --git a/test/statsCases/split-chunks-chunk-name/webpack.config.js b/test/statsCases/split-chunks-chunk-name/webpack.config.js index c9bbde44b..eedc456bb 100644 --- a/test/statsCases/split-chunks-chunk-name/webpack.config.js +++ b/test/statsCases/split-chunks-chunk-name/webpack.config.js @@ -10,6 +10,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/split-chunks-combinations/webpack.config.js b/test/statsCases/split-chunks-combinations/webpack.config.js index 505244e9c..da6f5b22d 100644 --- a/test/statsCases/split-chunks-combinations/webpack.config.js +++ b/test/statsCases/split-chunks-combinations/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/split-chunks-issue-6413/webpack.config.js b/test/statsCases/split-chunks-issue-6413/webpack.config.js index dc64cbc5c..ba523d3f0 100644 --- a/test/statsCases/split-chunks-issue-6413/webpack.config.js +++ b/test/statsCases/split-chunks-issue-6413/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { name: "default", mode: "production", diff --git a/test/statsCases/split-chunks-issue-6696/webpack.config.js b/test/statsCases/split-chunks-issue-6696/webpack.config.js index c7e0a3547..5cdafb245 100644 --- a/test/statsCases/split-chunks-issue-6696/webpack.config.js +++ b/test/statsCases/split-chunks-issue-6696/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { name: "default", mode: "production", diff --git a/test/statsCases/split-chunks-issue-7401/webpack.config.js b/test/statsCases/split-chunks-issue-7401/webpack.config.js index c0d98f4a1..891845a83 100644 --- a/test/statsCases/split-chunks-issue-7401/webpack.config.js +++ b/test/statsCases/split-chunks-issue-7401/webpack.config.js @@ -10,6 +10,7 @@ const stats = { chunkGroups: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { name: "default", mode: "production", diff --git a/test/statsCases/split-chunks-keep-remaining-size/webpack.config.js b/test/statsCases/split-chunks-keep-remaining-size/webpack.config.js index c9bbde44b..eedc456bb 100644 --- a/test/statsCases/split-chunks-keep-remaining-size/webpack.config.js +++ b/test/statsCases/split-chunks-keep-remaining-size/webpack.config.js @@ -10,6 +10,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/split-chunks-prefer-bigger-splits/webpack.config.js b/test/statsCases/split-chunks-prefer-bigger-splits/webpack.config.js index 628d02a95..49a833b9f 100644 --- a/test/statsCases/split-chunks-prefer-bigger-splits/webpack.config.js +++ b/test/statsCases/split-chunks-prefer-bigger-splits/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/tree-shaking/webpack.config.js b/test/statsCases/tree-shaking/webpack.config.js index 5de0fe940..018c4209c 100644 --- a/test/statsCases/tree-shaking/webpack.config.js +++ b/test/statsCases/tree-shaking/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/warnings-terser/webpack.config.js b/test/statsCases/warnings-terser/webpack.config.js index 19487004a..ab35f8345 100644 --- a/test/statsCases/warnings-terser/webpack.config.js +++ b/test/statsCases/warnings-terser/webpack.config.js @@ -1,4 +1,5 @@ const TerserPlugin = require("terser-webpack-plugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/wasm-explorer-examples-sync/webpack.config.js b/test/statsCases/wasm-explorer-examples-sync/webpack.config.js index ae6b26888..9efd5d0c8 100644 --- a/test/statsCases/wasm-explorer-examples-sync/webpack.config.js +++ b/test/statsCases/wasm-explorer-examples-sync/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/watchCases/cache/managedPath/webpack.config.js b/test/watchCases/cache/managedPath/webpack.config.js index 124df2152..fbaa23d88 100644 --- a/test/watchCases/cache/managedPath/webpack.config.js +++ b/test/watchCases/cache/managedPath/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", cache: { diff --git a/test/watchCases/long-term-caching/issue-8766/webpack.config.js b/test/watchCases/long-term-caching/issue-8766/webpack.config.js index 8ee17130d..b3c40d339 100644 --- a/test/watchCases/long-term-caching/issue-8766/webpack.config.js +++ b/test/watchCases/long-term-caching/issue-8766/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", output: { diff --git a/test/watchCases/plugins/automatic-prefetch-plugin/webpack.config.js b/test/watchCases/plugins/automatic-prefetch-plugin/webpack.config.js index a33728b6c..70e0b4f38 100644 --- a/test/watchCases/plugins/automatic-prefetch-plugin/webpack.config.js +++ b/test/watchCases/plugins/automatic-prefetch-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [new webpack.AutomaticPrefetchPlugin()] }; diff --git a/test/watchCases/plugins/define-plugin/webpack.config.js b/test/watchCases/plugins/define-plugin/webpack.config.js index ffca20082..3aa0f9f09 100644 --- a/test/watchCases/plugins/define-plugin/webpack.config.js +++ b/test/watchCases/plugins/define-plugin/webpack.config.js @@ -5,6 +5,7 @@ const valueFile = path.resolve( __dirname, "../../../js/watch-src/plugins/define-plugin/value.txt" ); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DefinePlugin({ diff --git a/test/watchCases/plugins/dll-reference-plugin/webpack.config.js b/test/watchCases/plugins/dll-reference-plugin/webpack.config.js index 14a6d08cc..dd41f3827 100644 --- a/test/watchCases/plugins/dll-reference-plugin/webpack.config.js +++ b/test/watchCases/plugins/dll-reference-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DllReferencePlugin({ diff --git a/test/watchCases/plugins/module-concatenation-plugin/webpack.config.js b/test/watchCases/plugins/module-concatenation-plugin/webpack.config.js index b913c78ab..dffc81bba 100644 --- a/test/watchCases/plugins/module-concatenation-plugin/webpack.config.js +++ b/test/watchCases/plugins/module-concatenation-plugin/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production" }; diff --git a/test/watchCases/plugins/watch-ignore-plugin/webpack.config.js b/test/watchCases/plugins/watch-ignore-plugin/webpack.config.js index 81c7a169c..814c0459e 100644 --- a/test/watchCases/plugins/watch-ignore-plugin/webpack.config.js +++ b/test/watchCases/plugins/watch-ignore-plugin/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [new webpack.WatchIgnorePlugin({ paths: [/file\.js$/, /foo$/] })] }; diff --git a/test/watchCases/runtime/dynamic-import/webpack.config.js b/test/watchCases/runtime/dynamic-import/webpack.config.js index 019baa474..b536f6cfe 100644 --- a/test/watchCases/runtime/dynamic-import/webpack.config.js +++ b/test/watchCases/runtime/dynamic-import/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { chunkFilename: "[name].[chunkhash].js" diff --git a/test/watchCases/runtime/static-import/webpack.config.js b/test/watchCases/runtime/static-import/webpack.config.js index 22f0a470f..c95208c17 100644 --- a/test/watchCases/runtime/static-import/webpack.config.js +++ b/test/watchCases/runtime/static-import/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { filename: "[name].js" diff --git a/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js b/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js index 59e948b12..c939ba33f 100644 --- a/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js +++ b/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { concatenateModules: true diff --git a/test/watchCases/side-effects/issue-7400/webpack.config.js b/test/watchCases/side-effects/issue-7400/webpack.config.js index 2bd35aa7c..58251b86a 100644 --- a/test/watchCases/side-effects/issue-7400/webpack.config.js +++ b/test/watchCases/side-effects/issue-7400/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { sideEffects: true diff --git a/test/watchCases/wasm/caching/webpack.config.js b/test/watchCases/wasm/caching/webpack.config.js index 20364aea7..d2aff73f7 100644 --- a/test/watchCases/wasm/caching/webpack.config.js +++ b/test/watchCases/wasm/caching/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { experiments: { asyncWebAssembly: true diff --git a/tsconfig.test.json b/tsconfig.test.json index 8c9e7177c..23a3c6e6f 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -12,5 +12,5 @@ "types": ["node", "jest"], "esModuleInterop": true }, - "include": ["test/**/webpack.config.js", "types.d.ts"] + "include": ["test/**/webpack.config.js", "declarations.test.d.ts"] } diff --git a/types.d.ts b/types.d.ts index 954a27e5f..ed3f44644 100644 --- a/types.d.ts +++ b/types.d.ts @@ -75,7 +75,7 @@ import { SyncWaterfallHook } from "tapable"; -declare namespace internals { +declare namespace webpack { export class AbstractLibraryPlugin { constructor(__0: { /** @@ -107,27 +107,27 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; - parseOptions(library: internals.LibraryOptions): false | T; + apply(compiler: webpack.Compiler): void; + parseOptions(library: webpack.LibraryOptions): false | T; finishEntryModule( - module: internals.Module, - libraryContext: internals.LibraryContext + module: webpack.Module, + libraryContext: webpack.LibraryContext ): void; runtimeRequirements( - chunk: internals.Chunk, + chunk: webpack.Chunk, set: Set, - libraryContext: internals.LibraryContext + libraryContext: webpack.LibraryContext ): void; render( - source: internals.Source, - renderContext: internals.RenderContextJavascriptModulesPlugin, - libraryContext: internals.LibraryContext - ): internals.Source; + source: webpack.Source, + renderContext: webpack.RenderContextJavascriptModulesPlugin, + libraryContext: webpack.LibraryContext + ): webpack.Source; chunkHash( - chunk: internals.Chunk, - hash: internals.Hash, - chunkHashContext: internals.ChunkHashContext, - libraryContext: internals.LibraryContext + chunk: webpack.Chunk, + hash: webpack.Hash, + chunkHashContext: webpack.ChunkHashContext, + libraryContext: webpack.LibraryContext ): void; } export class AggressiveMergingPlugin { @@ -137,17 +137,17 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class AggressiveSplittingPlugin { - constructor(options?: internals.AggressiveSplittingPluginOptions); - options: internals.AggressiveSplittingPluginOptions; + constructor(options?: webpack.AggressiveSplittingPluginOptions); + options: webpack.AggressiveSplittingPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; - static wasChunkRecorded(chunk: internals.Chunk): boolean; + apply(compiler: webpack.Compiler): void; + static wasChunkRecorded(chunk: webpack.Chunk): boolean; } /** @@ -181,7 +181,7 @@ declare namespace internals { description: string; simpleType: "string" | "number" | "boolean"; multiple: boolean; - configs: Array; + configs: Array; } export interface ArgumentConfig { description: string; @@ -206,17 +206,17 @@ declare namespace internals { /** * source of the asset */ - source: internals.Source; + source: webpack.Source; /** * info about the asset */ - info: internals.AssetInfo; + info: webpack.AssetInfo; } export interface AssetEmittedInfo { content: Buffer; - source: internals.Source; - compilation: internals.Compilation; + source: webpack.Source; + compilation: webpack.Compilation; outputPath: string; targetPath: string; } @@ -243,21 +243,16 @@ declare namespace internals { } export type AssetModuleFilename = | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); - export abstract class AsyncDependenciesBlock extends internals.DependenciesBlock { + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); + export abstract class AsyncDependenciesBlock extends webpack.DependenciesBlock { groupOptions: { preloadOrder?: number; prefetchOrder?: number; name: string; }; - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation; + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; request: string; - parent: internals.DependenciesBlock; + parent: webpack.DependenciesBlock; chunkName: string; module: any; } @@ -269,7 +264,7 @@ declare namespace internals { started: SyncHook<[T], void>; result: SyncHook<[T, Error, R], void>; }; - add(item: T, callback: internals.CallbackCompiler): void; + add(item: T, callback: webpack.CallbackCompiler): void; invalidate(item: T): void; stop(): void; increaseParallelism(): void; @@ -285,11 +280,11 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; renderModule(module?: any, renderContext?: any, hooks?: any): any; static getCompilationHooks( - compilation: internals.Compilation - ): internals.CompilationHooksAsyncWebAssemblyModulesPlugin; + compilation: webpack.Compilation + ): webpack.CompilationHooksAsyncWebAssemblyModulesPlugin; } export class AutomaticPrefetchPlugin { constructor(); @@ -297,40 +292,38 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export type AuxiliaryComment = - | string - | internals.LibraryCustomUmdCommentObject; + export type AuxiliaryComment = string | webpack.LibraryCustomUmdCommentObject; export class BannerPlugin { constructor( options: | string - | internals.BannerPluginOptions + | webpack.BannerPluginOptions | ((data: { hash: string; - chunk: internals.Chunk; + chunk: webpack.Chunk; filename: string; }) => string) ); - options: internals.BannerPluginOptions; + options: webpack.BannerPluginOptions; banner: (data: { hash: string; - chunk: internals.Chunk; + chunk: webpack.Chunk; filename: string; }) => string; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type BannerPluginArgument = | string - | internals.BannerPluginOptions + | webpack.BannerPluginOptions | ((data: { hash: string; - chunk: internals.Chunk; + chunk: webpack.Chunk; filename: string; }) => string); export interface BannerPluginOptions { @@ -341,7 +334,7 @@ declare namespace internals { | string | ((data: { hash: string; - chunk: internals.Chunk; + chunk: webpack.Chunk; filename: string; }) => string); @@ -408,38 +401,38 @@ declare namespace internals { isFalsy(): boolean; asBool(): any; asString(): any; - setString(string?: any): internals.BasicEvaluatedExpression; - setNull(): internals.BasicEvaluatedExpression; - setNumber(number?: any): internals.BasicEvaluatedExpression; - setBigInt(bigint?: any): internals.BasicEvaluatedExpression; - setBoolean(bool?: any): internals.BasicEvaluatedExpression; - setRegExp(regExp?: any): internals.BasicEvaluatedExpression; + setString(string?: any): webpack.BasicEvaluatedExpression; + setNull(): webpack.BasicEvaluatedExpression; + setNumber(number?: any): webpack.BasicEvaluatedExpression; + setBigInt(bigint?: any): webpack.BasicEvaluatedExpression; + setBoolean(bool?: any): webpack.BasicEvaluatedExpression; + setRegExp(regExp?: any): webpack.BasicEvaluatedExpression; setIdentifier( identifier?: any, rootInfo?: any, getMembers?: any - ): internals.BasicEvaluatedExpression; + ): webpack.BasicEvaluatedExpression; setWrapped( prefix?: any, postfix?: any, innerExpressions?: any - ): internals.BasicEvaluatedExpression; - setOptions(options?: any): internals.BasicEvaluatedExpression; - addOptions(options?: any): internals.BasicEvaluatedExpression; - setItems(items?: any): internals.BasicEvaluatedExpression; - setArray(array?: any): internals.BasicEvaluatedExpression; + ): webpack.BasicEvaluatedExpression; + setOptions(options?: any): webpack.BasicEvaluatedExpression; + addOptions(options?: any): webpack.BasicEvaluatedExpression; + setItems(items?: any): webpack.BasicEvaluatedExpression; + setArray(array?: any): webpack.BasicEvaluatedExpression; setTemplateString( quasis?: any, parts?: any, kind?: any - ): internals.BasicEvaluatedExpression; + ): webpack.BasicEvaluatedExpression; templateStringKind: any; - setTruthy(): internals.BasicEvaluatedExpression; - setFalsy(): internals.BasicEvaluatedExpression; - setRange(range?: any): internals.BasicEvaluatedExpression; - setExpression(expression?: any): internals.BasicEvaluatedExpression; + setTruthy(): webpack.BasicEvaluatedExpression; + setFalsy(): webpack.BasicEvaluatedExpression; + setRange(range?: any): webpack.BasicEvaluatedExpression; + setExpression(expression?: any): webpack.BasicEvaluatedExpression; } - export abstract class ByTypeGenerator extends internals.Generator { + export abstract class ByTypeGenerator extends webpack.Generator { map: any; } export class Cache { @@ -448,12 +441,12 @@ declare namespace internals { get: AsyncSeriesBailHook< [ string, - internals.Etag, - Array<(result: any, stats: internals.CallbackCache) => void> + webpack.Etag, + Array<(result: any, stats: webpack.CallbackCache) => void> ], any >; - store: AsyncParallelHook<[string, internals.Etag, any]>; + store: AsyncParallelHook<[string, webpack.Etag, any]>; storeBuildDependencies: AsyncParallelHook<[Iterable]>; beginIdle: SyncHook<[], void>; endIdle: AsyncParallelHook<[]>; @@ -461,14 +454,14 @@ declare namespace internals { }; get( identifier: string, - etag: internals.Etag, - callback: internals.CallbackCache + etag: webpack.Etag, + callback: webpack.CallbackCache ): void; store( identifier: string, - etag: internals.Etag, + etag: webpack.Etag, data: T, - callback: internals.CallbackCache + callback: webpack.CallbackCache ): void; /** @@ -476,11 +469,11 @@ declare namespace internals { */ storeBuildDependencies( dependencies: Iterable, - callback: internals.CallbackCache + callback: webpack.CallbackCache ): void; beginIdle(): void; - endIdle(callback: internals.CallbackCache): void; - shutdown(callback: internals.CallbackCache): void; + endIdle(callback: webpack.CallbackCache): void; + shutdown(callback: webpack.CallbackCache): void; static STAGE_MEMORY: number; static STAGE_DEFAULT: number; static STAGE_DISK: number; @@ -490,11 +483,11 @@ declare namespace internals { key?: string; priority?: number; getName?: ( - module?: internals.Module, - chunks?: Array, + module?: webpack.Module, + chunks?: Array, key?: string ) => string; - chunksFilter?: (chunk: internals.Chunk) => boolean; + chunksFilter?: (chunk: webpack.Chunk) => boolean; enforce?: boolean; minSize: Record; minRemainingSize: Record; @@ -505,26 +498,26 @@ declare namespace internals { maxInitialRequests?: number; filename?: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); idHint?: string; automaticNameDelimiter: string; reuseExistingChunk?: boolean; } export interface CacheGroupsContext { - moduleGraph: internals.ModuleGraph; - chunkGraph: internals.ChunkGraph; + moduleGraph: webpack.ModuleGraph; + chunkGraph: webpack.ChunkGraph; } export type CacheOptions = | boolean - | internals.MemoryCacheOptions - | internals.FileCacheOptions; + | webpack.MemoryCacheOptions + | webpack.FileCacheOptions; export type CacheOptionsNormalized = | false - | internals.MemoryCacheOptions - | internals.FileCacheOptions; + | webpack.MemoryCacheOptions + | webpack.FileCacheOptions; export type CallExpression = SimpleCallExpression | NewExpression; export interface CallbackCache { - (err?: internals.WebpackError, stats?: T): void; + (err?: webpack.WebpackError, stats?: T): void; } export interface CallbackCompiler { (err?: Error, result?: T): any; @@ -532,16 +525,17 @@ declare namespace internals { export interface CallbackWebpack { (err?: Error, stats?: T): void; } - export abstract class Chunk { + export class Chunk { + constructor(name?: string); id: string | number; ids: Array; debugId: number; name: string; - idNameHints: internals.SortableSet; + idNameHints: webpack.SortableSet; preventIntegration: boolean; filenameTemplate: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); files: Set; auxiliaryFiles: Set; rendered: boolean; @@ -550,258 +544,248 @@ declare namespace internals { renderedHash: string; chunkReason: string; extraAsync: boolean; - readonly entryModule: internals.Module; + readonly entryModule: webpack.Module; hasEntryModule(): boolean; - addModule(module: internals.Module): boolean; - removeModule(module: internals.Module): void; + addModule(module: webpack.Module): boolean; + removeModule(module: webpack.Module): void; getNumberOfModules(): number; - readonly modulesIterable: Iterable; - compareTo(otherChunk: internals.Chunk): 0 | 1 | -1; - containsModule(module: internals.Module): boolean; - getModules(): Array; + readonly modulesIterable: Iterable; + compareTo(otherChunk: webpack.Chunk): 0 | 1 | -1; + containsModule(module: webpack.Module): boolean; + getModules(): Array; remove(): void; - moveModule(module: internals.Module, otherChunk: internals.Chunk): void; - integrate(otherChunk: internals.Chunk): boolean; - canBeIntegrated(otherChunk: internals.Chunk): boolean; + moveModule(module: webpack.Module, otherChunk: webpack.Chunk): void; + integrate(otherChunk: webpack.Chunk): boolean; + canBeIntegrated(otherChunk: webpack.Chunk): boolean; isEmpty(): boolean; modulesSize(): number; - size(options?: internals.ChunkSizeOptions): number; + size(options?: webpack.ChunkSizeOptions): number; integratedSize( - otherChunk: internals.Chunk, - options: internals.ChunkSizeOptions + otherChunk: webpack.Chunk, + options: webpack.ChunkSizeOptions ): number; getChunkModuleMaps( - filterFn: (m: internals.Module) => boolean - ): internals.ChunkModuleMaps; + filterFn: (m: webpack.Module) => boolean + ): webpack.ChunkModuleMaps; hasModuleInGraph( - filterFn: (m: internals.Module) => boolean, - filterChunkFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph + filterFn: (m: webpack.Module) => boolean, + filterChunkFn?: ( + c: webpack.Chunk, + chunkGraph: webpack.ChunkGraph ) => boolean ): boolean; - getChunkMaps(realHash: boolean): internals.ChunkMaps; + getChunkMaps(realHash: boolean): webpack.ChunkMaps; hasRuntime(): boolean; canBeInitial(): boolean; isOnlyInitial(): boolean; - addGroup(chunkGroup: internals.ChunkGroup): void; - removeGroup(chunkGroup: internals.ChunkGroup): void; - isInGroup(chunkGroup: internals.ChunkGroup): boolean; + addGroup(chunkGroup: webpack.ChunkGroup): void; + removeGroup(chunkGroup: webpack.ChunkGroup): void; + isInGroup(chunkGroup: webpack.ChunkGroup): boolean; getNumberOfGroups(): number; - readonly groupsIterable: Iterable; + readonly groupsIterable: Iterable; disconnectFromGroups(): void; - split(newChunk: internals.Chunk): void; - - /** - * Update the hash - */ - updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; - getAllAsyncChunks(): Set; - getAllReferencedChunks(): Set; + split(newChunk: webpack.Chunk): void; + updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; + getAllAsyncChunks(): Set; + getAllReferencedChunks(): Set; hasAsyncChunks(): boolean; getChildIdsByOrders( - chunkGraph: internals.ChunkGraph, - filterFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph - ) => boolean + chunkGraph: webpack.ChunkGraph, + filterFn?: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean ): Record>; getChildIdsByOrdersMap( - chunkGraph: internals.ChunkGraph, - includeDirectChildren: boolean, - filterFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph - ) => boolean + chunkGraph: webpack.ChunkGraph, + includeDirectChildren?: boolean, + filterFn?: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean ): Record>>; } - export abstract class ChunkGraph { - moduleGraph: internals.ModuleGraph; - connectChunkAndModule( - chunk: internals.Chunk, - module: internals.Module - ): void; + export class ChunkGraph { + constructor(moduleGraph: webpack.ModuleGraph); + moduleGraph: webpack.ModuleGraph; + connectChunkAndModule(chunk: webpack.Chunk, module: webpack.Module): void; disconnectChunkAndModule( - chunk: internals.Chunk, - module: internals.Module + chunk: webpack.Chunk, + module: webpack.Module ): void; - disconnectChunk(chunk: internals.Chunk): void; + disconnectChunk(chunk: webpack.Chunk): void; attachModules( - chunk: internals.Chunk, - modules: Iterable + chunk: webpack.Chunk, + modules: Iterable ): void; attachRuntimeModules( - chunk: internals.Chunk, - modules: Iterable + chunk: webpack.Chunk, + modules: Iterable ): void; - replaceModule( - oldModule: internals.Module, - newModule: internals.Module - ): void; - isModuleInChunk(module: internals.Module, chunk: internals.Chunk): boolean; + replaceModule(oldModule: webpack.Module, newModule: webpack.Module): void; + isModuleInChunk(module: webpack.Module, chunk: webpack.Chunk): boolean; isModuleInChunkGroup( - module: internals.Module, - chunkGroup: internals.ChunkGroup + module: webpack.Module, + chunkGroup: webpack.ChunkGroup ): boolean; - isEntryModule(module: internals.Module): boolean; - getModuleChunksIterable( - module: internals.Module - ): Iterable; + isEntryModule(module: webpack.Module): boolean; + getModuleChunksIterable(module: webpack.Module): Iterable; getOrderedModuleChunksIterable( - module: internals.Module, - sortFn: (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1 - ): Iterable; - getModuleChunks(module: internals.Module): Array; - getNumberOfModuleChunks(module: internals.Module): number; + module: webpack.Module, + sortFn: (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1 + ): Iterable; + getModuleChunks(module: webpack.Module): Array; + getNumberOfModuleChunks(module: webpack.Module): number; haveModulesEqualChunks( - moduleA: internals.Module, - moduleB: internals.Module + moduleA: webpack.Module, + moduleB: webpack.Module ): boolean; - getNumberOfChunkModules(chunk: internals.Chunk): number; - getChunkModulesIterable(chunk: internals.Chunk): Iterable; + getNumberOfChunkModules(chunk: webpack.Chunk): number; + getChunkModulesIterable(chunk: webpack.Chunk): Iterable; getChunkModulesIterableBySourceType( - chunk: internals.Chunk, + chunk: webpack.Chunk, sourceType: string - ): Iterable; + ): Iterable; getOrderedChunkModulesIterable( - chunk: internals.Chunk, - comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 - ): Iterable; + chunk: webpack.Chunk, + comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 + ): Iterable; getOrderedChunkModulesIterableBySourceType( - chunk: internals.Chunk, + chunk: webpack.Chunk, sourceType: string, - comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 - ): Iterable; - getChunkModules(chunk: internals.Chunk): Array; + comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 + ): Iterable; + getChunkModules(chunk: webpack.Chunk): Array; getOrderedChunkModules( - chunk: internals.Chunk, - comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 - ): Array; + chunk: webpack.Chunk, + comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 + ): Array; getChunkModuleMaps( - chunk: internals.Chunk, - filterFn: (m: internals.Module) => boolean, + chunk: webpack.Chunk, + filterFn: (m: webpack.Module) => boolean, includeAllChunks?: boolean - ): internals.ChunkModuleMaps; + ): webpack.ChunkModuleMaps; getChunkConditionMap( - chunk: internals.Chunk, - filterFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph - ) => boolean + chunk: webpack.Chunk, + filterFn: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean ): Record; hasModuleInChunk( - chunk: internals.Chunk, - filterFn: (m: internals.Module) => boolean + chunk: webpack.Chunk, + filterFn: (m: webpack.Module) => boolean ): boolean; hasModuleInGraph( - chunk: internals.Chunk, - filterFn: (m: internals.Module) => boolean, - filterChunkFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph + chunk: webpack.Chunk, + filterFn: (m: webpack.Module) => boolean, + filterChunkFn?: ( + c: webpack.Chunk, + chunkGraph: webpack.ChunkGraph ) => boolean ): boolean; - compareChunks(chunkA: internals.Chunk, chunkB: internals.Chunk): 0 | 1 | -1; - getChunkModulesSize(chunk: internals.Chunk): number; - getChunkModulesSizes(chunk: internals.Chunk): Record; - getChunkRootModules(chunk: internals.Chunk): Array; + compareChunks(chunkA: webpack.Chunk, chunkB: webpack.Chunk): 0 | 1 | -1; + getChunkModulesSize(chunk: webpack.Chunk): number; + getChunkModulesSizes(chunk: webpack.Chunk): Record; + getChunkRootModules(chunk: webpack.Chunk): Array; getChunkSize( - chunk: internals.Chunk, - options?: internals.ChunkSizeOptions + chunk: webpack.Chunk, + options?: webpack.ChunkSizeOptions ): number; getIntegratedChunksSize( - chunkA: internals.Chunk, - chunkB: internals.Chunk, - options?: internals.ChunkSizeOptions + chunkA: webpack.Chunk, + chunkB: webpack.Chunk, + options?: webpack.ChunkSizeOptions ): number; canChunksBeIntegrated( - chunkA: internals.Chunk, - chunkB: internals.Chunk - ): boolean; - integrateChunks(chunkA: internals.Chunk, chunkB: internals.Chunk): void; - isEntryModuleInChunk( - module: internals.Module, - chunk: internals.Chunk + chunkA: webpack.Chunk, + chunkB: webpack.Chunk ): boolean; + integrateChunks(chunkA: webpack.Chunk, chunkB: webpack.Chunk): void; + isEntryModuleInChunk(module: webpack.Module, chunk: webpack.Chunk): boolean; connectChunkAndEntryModule( - chunk: internals.Chunk, - module: internals.Module, - entrypoint: internals.Entrypoint + chunk: webpack.Chunk, + module: webpack.Module, + entrypoint?: webpack.Entrypoint ): void; connectChunkAndRuntimeModule( - chunk: internals.Chunk, - module: internals.RuntimeModule + chunk: webpack.Chunk, + module: webpack.RuntimeModule ): void; disconnectChunkAndEntryModule( - chunk: internals.Chunk, - module: internals.Module + chunk: webpack.Chunk, + module: webpack.Module ): void; disconnectChunkAndRuntimeModule( - chunk: internals.Chunk, - module: internals.RuntimeModule + chunk: webpack.Chunk, + module: webpack.RuntimeModule ): void; - disconnectEntryModule(module: internals.Module): void; - disconnectEntries(chunk: internals.Chunk): void; - getNumberOfEntryModules(chunk: internals.Chunk): number; - getNumberOfRuntimeModules(chunk: internals.Chunk): number; + disconnectEntryModule(module: webpack.Module): void; + disconnectEntries(chunk: webpack.Chunk): void; + getNumberOfEntryModules(chunk: webpack.Chunk): number; + getNumberOfRuntimeModules(chunk: webpack.Chunk): number; getChunkEntryModulesIterable( - chunk: internals.Chunk - ): Iterable; + chunk: webpack.Chunk + ): Iterable; getChunkEntryDependentChunksIterable( - chunk: internals.Chunk - ): Iterable; - hasChunkEntryDependentChunks(chunk: internals.Chunk): boolean; + chunk: webpack.Chunk + ): Iterable; + hasChunkEntryDependentChunks(chunk: webpack.Chunk): boolean; getChunkRuntimeModulesIterable( - chunk: internals.Chunk - ): Iterable; + chunk: webpack.Chunk + ): Iterable; getChunkRuntimeModulesInOrder( - chunk: internals.Chunk - ): Array; + chunk: webpack.Chunk + ): Array; getChunkEntryModulesWithChunkGroupIterable( - chunk: internals.Chunk - ): Iterable<[internals.Module, internals.Entrypoint]>; + chunk: webpack.Chunk + ): Iterable<[webpack.Module, webpack.Entrypoint]>; getBlockChunkGroup( - depBlock: internals.AsyncDependenciesBlock - ): internals.ChunkGroup; + depBlock: webpack.AsyncDependenciesBlock + ): webpack.ChunkGroup; connectBlockAndChunkGroup( - depBlock: internals.AsyncDependenciesBlock, - chunkGroup: internals.ChunkGroup + depBlock: webpack.AsyncDependenciesBlock, + chunkGroup: webpack.ChunkGroup ): void; - disconnectChunkGroup(chunkGroup: internals.ChunkGroup): void; - getModuleId(module: internals.Module): string | number; - setModuleId(module: internals.Module, id: string | number): void; - getModuleHash(module: internals.Module): string; - getRenderedModuleHash(module: internals.Module): string; + disconnectChunkGroup(chunkGroup: webpack.ChunkGroup): void; + getModuleId(module: webpack.Module): string | number; + setModuleId(module: webpack.Module, id: string | number): void; + getModuleHash(module: webpack.Module): string; + getRenderedModuleHash(module: webpack.Module): string; setModuleHashes( - module: internals.Module, + module: webpack.Module, hash: string, renderedHash: string ): void; addModuleRuntimeRequirements( - module: internals.Module, - items: Set - ): void; - addChunkRuntimeRequirements( - chunk: internals.Chunk, + module: webpack.Module, items: Set ): void; + addChunkRuntimeRequirements(chunk: webpack.Chunk, items: Set): void; addTreeRuntimeRequirements( - chunk: internals.Chunk, + chunk: webpack.Chunk, items: Iterable ): void; - getModuleRuntimeRequirements(module: internals.Module): ReadonlySet; - getChunkRuntimeRequirements(chunk: internals.Chunk): ReadonlySet; - getTreeRuntimeRequirements(chunk: internals.Chunk): ReadonlySet; + getModuleRuntimeRequirements(module: webpack.Module): ReadonlySet; + getChunkRuntimeRequirements(chunk: webpack.Chunk): ReadonlySet; + getTreeRuntimeRequirements(chunk: webpack.Chunk): ReadonlySet; + static getChunkGraphForModule( + module: webpack.Module, + deprecateMessage: string, + deprecationCode: string + ): webpack.ChunkGraph; + static setChunkGraphForModule( + module: webpack.Module, + chunkGraph: webpack.ChunkGraph + ): void; + static getChunkGraphForChunk( + chunk: webpack.Chunk, + deprecateMessage: string, + deprecationCode: string + ): webpack.ChunkGraph; + static setChunkGraphForChunk( + chunk: webpack.Chunk, + chunkGraph: webpack.ChunkGraph + ): void; } export abstract class ChunkGroup { groupDebugId: number; options: { preloadOrder?: number; prefetchOrder?: number; name: string }; - chunks: Array; + chunks: Array; origins: Array<{ - module: internals.Module; - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation; + module: webpack.Module; + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; request: string; }>; index: number; @@ -836,41 +820,39 @@ declare namespace internals { /** * Performs an unshift of a specific chunk */ - unshiftChunk(chunk: internals.Chunk): boolean; + unshiftChunk(chunk: webpack.Chunk): boolean; /** * inserts a chunk before another existing chunk in group */ - insertChunk(chunk: internals.Chunk, before: internals.Chunk): boolean; + insertChunk(chunk: webpack.Chunk, before: webpack.Chunk): boolean; /** * add a chunk into ChunkGroup. Is pushed on or prepended */ - pushChunk(chunk: internals.Chunk): boolean; - replaceChunk(oldChunk: internals.Chunk, newChunk: internals.Chunk): boolean; - removeChunk(chunk: internals.Chunk): boolean; + pushChunk(chunk: webpack.Chunk): boolean; + replaceChunk(oldChunk: webpack.Chunk, newChunk: webpack.Chunk): boolean; + removeChunk(chunk: webpack.Chunk): boolean; isInitial(): boolean; - addChild(group: internals.ChunkGroup): boolean; - getChildren(): Array; + addChild(group: webpack.ChunkGroup): boolean; + getChildren(): Array; getNumberOfChildren(): number; - readonly childrenIterable: internals.SortableSet; - removeChild(group: internals.ChunkGroup): boolean; - addParent(parentChunk: internals.ChunkGroup): boolean; - getParents(): Array; + readonly childrenIterable: webpack.SortableSet; + removeChild(group: webpack.ChunkGroup): boolean; + addParent(parentChunk: webpack.ChunkGroup): boolean; + getParents(): Array; getNumberOfParents(): number; - hasParent(parent: internals.ChunkGroup): boolean; - readonly parentsIterable: internals.SortableSet; - removeParent(chunkGroup: internals.ChunkGroup): boolean; + hasParent(parent: webpack.ChunkGroup): boolean; + readonly parentsIterable: webpack.SortableSet; + removeParent(chunkGroup: webpack.ChunkGroup): boolean; getBlocks(): Array; getNumberOfBlocks(): number; hasBlock(block?: any): boolean; - readonly blocksIterable: Iterable; - addBlock(block: internals.AsyncDependenciesBlock): boolean; + readonly blocksIterable: Iterable; + addBlock(block: webpack.AsyncDependenciesBlock): boolean; addOrigin( - module: internals.Module, - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation, + module: webpack.Module, + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, request: string ): void; getFiles(): Array; @@ -882,52 +864,52 @@ declare namespace internals { * Sorting values are based off of number of chunks in ChunkGroup. */ compareTo( - chunkGraph: internals.ChunkGraph, - otherGroup: internals.ChunkGroup + chunkGraph: webpack.ChunkGraph, + otherGroup: webpack.ChunkGroup ): 0 | 1 | -1; getChildrenByOrders( - moduleGraph: internals.ModuleGraph, - chunkGraph: internals.ChunkGraph - ): Record>; + moduleGraph: webpack.ModuleGraph, + chunkGraph: webpack.ChunkGraph + ): Record>; /** * Sets the top-down index of a module in this ChunkGroup */ - setModulePreOrderIndex(module: internals.Module, index: number): void; + setModulePreOrderIndex(module: webpack.Module, index: number): void; /** * Gets the top-down index of a module in this ChunkGroup */ - getModulePreOrderIndex(module: internals.Module): number; + getModulePreOrderIndex(module: webpack.Module): number; /** * Sets the bottom-up index of a module in this ChunkGroup */ - setModulePostOrderIndex(module: internals.Module, index: number): void; + setModulePostOrderIndex(module: webpack.Module, index: number): void; /** * Gets the bottom-up index of a module in this ChunkGroup */ - getModulePostOrderIndex(module: internals.Module): number; + getModulePostOrderIndex(module: webpack.Module): number; checkConstraints(): void; - getModuleIndex: (module: internals.Module) => number; - getModuleIndex2: (module: internals.Module) => number; + getModuleIndex: (module: webpack.Module) => number; + getModuleIndex2: (module: webpack.Module) => number; } export interface ChunkHashContext { /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; } /** @@ -945,7 +927,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface ChunkModuleMaps { id: Record>; @@ -985,28 +967,28 @@ declare namespace internals { /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; } export interface CodeGenerationResult { /** * the resulting sources for all source types */ - sources: Map; + sources: Map; /** * the runtime requirements @@ -1017,29 +999,29 @@ declare namespace internals { /** * Creates an instance of Compilation. */ - constructor(compiler: internals.Compiler); + constructor(compiler: webpack.Compiler); hooks: Readonly<{ - buildModule: SyncHook<[internals.Module], void>; - rebuildModule: SyncHook<[internals.Module], void>; - failedModule: SyncHook<[internals.Module, internals.WebpackError], void>; - succeedModule: SyncHook<[internals.Module], void>; - stillValidModule: SyncHook<[internals.Module], void>; + buildModule: SyncHook<[webpack.Module], void>; + rebuildModule: SyncHook<[webpack.Module], void>; + failedModule: SyncHook<[webpack.Module, webpack.WebpackError], void>; + succeedModule: SyncHook<[webpack.Module], void>; + stillValidModule: SyncHook<[webpack.Module], void>; addEntry: SyncHook< [ - internals.Dependency, + webpack.Dependency, { name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" > ], void >; failedEntry: SyncHook< [ - internals.Dependency, + webpack.Dependency, { name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >, Error ], @@ -1047,88 +1029,88 @@ declare namespace internals { >; succeedEntry: SyncHook< [ - internals.Dependency, + webpack.Dependency, { name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >, - internals.Module + webpack.Module ], void >; dependencyReferencedExports: SyncWaterfallHook< - [Array>, internals.Dependency] + [Array>, webpack.Dependency] >; - finishModules: AsyncSeriesHook<[Iterable]>; - finishRebuildingModule: AsyncSeriesHook<[internals.Module]>; + finishModules: AsyncSeriesHook<[Iterable]>; + finishRebuildingModule: AsyncSeriesHook<[webpack.Module]>; unseal: SyncHook<[], void>; seal: SyncHook<[], void>; beforeChunks: SyncHook<[], void>; - afterChunks: SyncHook<[Iterable], void>; - optimizeDependencies: SyncBailHook<[Iterable], any>; - afterOptimizeDependencies: SyncHook<[Iterable], void>; + afterChunks: SyncHook<[Iterable], void>; + optimizeDependencies: SyncBailHook<[Iterable], any>; + afterOptimizeDependencies: SyncHook<[Iterable], void>; optimize: SyncHook<[], void>; - optimizeModules: SyncBailHook<[Iterable], any>; - afterOptimizeModules: SyncHook<[Iterable], void>; + optimizeModules: SyncBailHook<[Iterable], any>; + afterOptimizeModules: SyncHook<[Iterable], void>; optimizeChunks: SyncBailHook< - [Iterable, Array], + [Iterable, Array], any >; afterOptimizeChunks: SyncHook< - [Iterable, Array], + [Iterable, Array], void >; optimizeTree: AsyncSeriesHook< - [Iterable, Iterable] + [Iterable, Iterable] >; afterOptimizeTree: SyncHook< - [Iterable, Iterable], + [Iterable, Iterable], void >; optimizeChunkModules: AsyncSeriesBailHook< - [Iterable, Iterable], + [Iterable, Iterable], any >; afterOptimizeChunkModules: SyncHook< - [Iterable, Iterable], + [Iterable, Iterable], void >; shouldRecord: SyncBailHook<[], boolean>; additionalChunkRuntimeRequirements: SyncHook< - [internals.Chunk, Set], + [webpack.Chunk, Set], void >; runtimeRequirementInChunk: HookMap< - SyncBailHook<[internals.Chunk, Set], any> + SyncBailHook<[webpack.Chunk, Set], any> >; additionalModuleRuntimeRequirements: SyncHook< - [internals.Module, Set], + [webpack.Module, Set], void >; runtimeRequirementInModule: HookMap< - SyncBailHook<[internals.Module, Set], any> + SyncBailHook<[webpack.Module, Set], any> >; additionalTreeRuntimeRequirements: SyncHook< - [internals.Chunk, Set], + [webpack.Chunk, Set], void >; runtimeRequirementInTree: HookMap< - SyncBailHook<[internals.Chunk, Set], any> + SyncBailHook<[webpack.Chunk, Set], any> >; - runtimeModule: SyncHook<[internals.RuntimeModule, internals.Chunk], void>; - reviveModules: SyncHook<[Iterable, any], void>; - beforeModuleIds: SyncHook<[Iterable], void>; - moduleIds: SyncHook<[Iterable], void>; - optimizeModuleIds: SyncHook<[Iterable], void>; - afterOptimizeModuleIds: SyncHook<[Iterable], void>; - reviveChunks: SyncHook<[Iterable, any], void>; - beforeChunkIds: SyncHook<[Iterable], void>; - chunkIds: SyncHook<[Iterable], void>; - optimizeChunkIds: SyncHook<[Iterable], void>; - afterOptimizeChunkIds: SyncHook<[Iterable], void>; - recordModules: SyncHook<[Iterable, any], void>; - recordChunks: SyncHook<[Iterable, any], void>; - optimizeCodeGeneration: SyncHook<[Iterable], void>; + runtimeModule: SyncHook<[webpack.RuntimeModule, webpack.Chunk], void>; + reviveModules: SyncHook<[Iterable, any], void>; + beforeModuleIds: SyncHook<[Iterable], void>; + moduleIds: SyncHook<[Iterable], void>; + optimizeModuleIds: SyncHook<[Iterable], void>; + afterOptimizeModuleIds: SyncHook<[Iterable], void>; + reviveChunks: SyncHook<[Iterable, any], void>; + beforeChunkIds: SyncHook<[Iterable], void>; + chunkIds: SyncHook<[Iterable], void>; + optimizeChunkIds: SyncHook<[Iterable], void>; + afterOptimizeChunkIds: SyncHook<[Iterable], void>; + recordModules: SyncHook<[Iterable, any], void>; + recordChunks: SyncHook<[Iterable, any], void>; + optimizeCodeGeneration: SyncHook<[Iterable], void>; beforeModuleHash: SyncHook<[], void>; afterModuleHash: SyncHook<[], void>; beforeCodeGeneration: SyncHook<[], void>; @@ -1136,93 +1118,83 @@ declare namespace internals { beforeRuntimeRequirements: SyncHook<[], void>; afterRuntimeRequirements: SyncHook<[], void>; beforeHash: SyncHook<[], void>; - contentHash: SyncHook<[internals.Chunk], void>; + contentHash: SyncHook<[webpack.Chunk], void>; afterHash: SyncHook<[], void>; recordHash: SyncHook<[any], void>; - record: SyncHook<[internals.Compilation, any], void>; + record: SyncHook<[webpack.Compilation, any], void>; beforeModuleAssets: SyncHook<[], void>; shouldGenerateChunkAssets: SyncBailHook<[], boolean>; beforeChunkAssets: SyncHook<[], void>; - additionalChunkAssets: SyncHook<[Iterable], void>; + additionalChunkAssets: SyncHook<[Iterable], void>; additionalAssets: AsyncSeriesHook<[]>; - optimizeChunkAssets: AsyncSeriesHook<[Iterable]>; - afterOptimizeChunkAssets: SyncHook<[Iterable], void>; - optimizeAssets: AsyncSeriesHook<[Record]>; - afterOptimizeAssets: SyncHook<[Record], void>; - finishAssets: AsyncSeriesHook<[Record]>; - afterFinishAssets: SyncHook<[Record], void>; + optimizeChunkAssets: AsyncSeriesHook<[Iterable]>; + afterOptimizeChunkAssets: SyncHook<[Iterable], void>; + optimizeAssets: AsyncSeriesHook<[Record]>; + afterOptimizeAssets: SyncHook<[Record], void>; + finishAssets: AsyncSeriesHook<[Record]>; + afterFinishAssets: SyncHook<[Record], void>; needAdditionalSeal: SyncBailHook<[], boolean>; afterSeal: AsyncSeriesHook<[]>; renderManifest: SyncWaterfallHook< - [Array, internals.RenderManifestOptions] + [Array, webpack.RenderManifestOptions] >; - fullHash: SyncHook<[internals.Hash], void>; + fullHash: SyncHook<[webpack.Hash], void>; chunkHash: SyncHook< - [internals.Chunk, internals.Hash, internals.ChunkHashContext], + [webpack.Chunk, webpack.Hash, webpack.ChunkHashContext], void >; - moduleAsset: SyncHook<[internals.Module, string], void>; - chunkAsset: SyncHook<[internals.Chunk, string], void>; - assetPath: SyncWaterfallHook<[string, any, internals.AssetInfo]>; + moduleAsset: SyncHook<[webpack.Module, string], void>; + chunkAsset: SyncHook<[webpack.Chunk, string], void>; + assetPath: SyncWaterfallHook<[string, any, webpack.AssetInfo]>; needAdditionalPass: SyncBailHook<[], boolean>; - childCompiler: SyncHook<[internals.Compiler, string, number], void>; - log: SyncBailHook<[string, internals.LogEntry], true>; + childCompiler: SyncHook<[webpack.Compiler, string, number], void>; + log: SyncBailHook<[string, webpack.LogEntry], true>; statsPreset: HookMap>; statsNormalize: SyncHook<[any, any], void>; - statsFactory: SyncHook<[internals.StatsFactory, any], void>; - statsPrinter: SyncHook<[internals.StatsPrinter, any], void>; - readonly normalModuleLoader: SyncHook< - [any, internals.NormalModule], - void - >; + statsFactory: SyncHook<[webpack.StatsFactory, any], void>; + statsPrinter: SyncHook<[webpack.StatsPrinter, any], void>; + readonly normalModuleLoader: SyncHook<[any, webpack.NormalModule], void>; }>; name: string; - compiler: internals.Compiler; - resolverFactory: internals.ResolverFactory; - inputFileSystem: internals.InputFileSystem; - fileSystemInfo: internals.FileSystemInfo; - requestShortener: internals.RequestShortener; + compiler: webpack.Compiler; + resolverFactory: webpack.ResolverFactory; + inputFileSystem: webpack.InputFileSystem; + fileSystemInfo: webpack.FileSystemInfo; + requestShortener: webpack.RequestShortener; compilerPath: string; - cache: internals.Cache; - logger: internals.WebpackLogger; - options: internals.WebpackOptionsNormalized; - outputOptions: internals.OutputNormalized; + cache: webpack.Cache; + logger: webpack.WebpackLogger; + options: webpack.WebpackOptionsNormalized; + outputOptions: webpack.OutputNormalized; bail: boolean; profile: boolean; - mainTemplate: internals.MainTemplate; - chunkTemplate: internals.ChunkTemplate; - runtimeTemplate: internals.RuntimeTemplate; - moduleTemplates: { javascript: internals.ModuleTemplate }; - moduleGraph: internals.ModuleGraph; - chunkGraph: internals.ChunkGraph; - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; - factorizeQueue: internals.AsyncQueue< - internals.FactorizeModuleOptions, + mainTemplate: webpack.MainTemplate; + chunkTemplate: webpack.ChunkTemplate; + runtimeTemplate: webpack.RuntimeTemplate; + moduleTemplates: { javascript: webpack.ModuleTemplate }; + moduleGraph: webpack.ModuleGraph; + chunkGraph: webpack.ChunkGraph; + codeGenerationResults: Map; + factorizeQueue: webpack.AsyncQueue< + webpack.FactorizeModuleOptions, string, - internals.Module + webpack.Module >; - addModuleQueue: internals.AsyncQueue< - internals.Module, - string, - internals.Module + addModuleQueue: webpack.AsyncQueue; + buildQueue: webpack.AsyncQueue< + webpack.Module, + webpack.Module, + webpack.Module >; - buildQueue: internals.AsyncQueue< - internals.Module, - internals.Module, - internals.Module + rebuildQueue: webpack.AsyncQueue< + webpack.Module, + webpack.Module, + webpack.Module >; - rebuildQueue: internals.AsyncQueue< - internals.Module, - internals.Module, - internals.Module - >; - processDependenciesQueue: internals.AsyncQueue< - internals.Module, - internals.Module, - internals.Module + processDependenciesQueue: webpack.AsyncQueue< + webpack.Module, + webpack.Module, + webpack.Module >; /** @@ -1230,168 +1202,137 @@ declare namespace internals { * Means value blocking key from finishing. * Needed to detect build cycles. */ - creatingModuleDuringBuild: WeakMap>; - entries: Map; - entrypoints: Map; - chunks: Set; - chunkGroups: Array; - namedChunkGroups: Map; - namedChunks: Map; - modules: Set; + creatingModuleDuringBuild: WeakMap>; + entries: Map; + entrypoints: Map; + chunks: Set; + chunkGroups: Array; + namedChunkGroups: Map; + namedChunks: Map; + modules: Set; records: any; additionalChunkAssets: Array; - assets: Record; - assetsInfo: Map; - errors: Array; - warnings: Array; - children: Array; - logging: Map>; + assets: Record; + assetsInfo: Map; + errors: Array; + warnings: Array; + children: Array; + logging: Map>; dependencyFactories: Map< - { new (...args: Array): internals.Dependency }, - internals.ModuleFactory + { new (...args: Array): webpack.Dependency }, + webpack.ModuleFactory >; - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; childrenCounters: {}; usedChunkIds: Set; usedModuleIds: Set; needAdditionalPass: boolean; - builtModules: WeakSet; + builtModules: WeakSet; emittedAssets: Set; comparedForEmitAssets: Set; - fileDependencies: internals.LazySet; - contextDependencies: internals.LazySet; - missingDependencies: internals.LazySet; - buildDependencies: internals.LazySet; - compilationDependencies: { add: (item?: any) => internals.LazySet }; - getStats(): internals.Stats; + fileDependencies: webpack.LazySet; + contextDependencies: webpack.LazySet; + missingDependencies: webpack.LazySet; + buildDependencies: webpack.LazySet; + compilationDependencies: { add: (item?: any) => webpack.LazySet }; + getStats(): webpack.Stats; createStatsOptions(optionsOrPreset?: any, context?: {}): {}; - createStatsFactory(options?: any): internals.StatsFactory; - createStatsPrinter(options?: any): internals.StatsPrinter; - getLogger(name: string | (() => string)): internals.WebpackLogger; + createStatsFactory(options?: any): webpack.StatsFactory; + createStatsPrinter(options?: any): webpack.StatsPrinter; + getLogger(name: string | (() => string)): webpack.WebpackLogger; addModule( - module: internals.Module, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + module: webpack.Module, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; /** * Fetches a module from a compilation by its identifier */ - getModule(module: internals.Module): internals.Module; + getModule(module: webpack.Module): webpack.Module; /** * Attempts to search for a module by its identifier */ - findModule(identifier: string): internals.Module; + findModule(identifier: string): webpack.Module; /** * Schedules a build of the module object */ buildModule( - module: internals.Module, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + module: webpack.Module, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; processModuleDependencies( - module: internals.Module, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + module: webpack.Module, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; handleModuleCreation( - __0: internals.HandleModuleCreationOptions, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + __0: webpack.HandleModuleCreationOptions, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; factorizeModule( - options: internals.FactorizeModuleOptions, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + options: webpack.FactorizeModuleOptions, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; addModuleChain( context: string, - dependency: internals.Dependency, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + dependency: webpack.Dependency, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; addEntry( context: string, - entry: internals.EntryDependency, + entry: webpack.EntryDependency, optionsOrName: | string | ({ name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >), - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; rebuildModule( - module: internals.Module, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + module: webpack.Module, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; finish(callback?: any): void; unseal(): void; - seal(callback: (err?: internals.WebpackError) => void): void; + seal(callback: (err?: webpack.WebpackError) => void): void; reportDependencyErrorsAndWarnings( - module: internals.Module, - blocks: Array + module: webpack.Module, + blocks: Array ): void; codeGeneration(): Map; - processRuntimeRequirements( - entrypoints: Iterable - ): void; - addRuntimeModule( - chunk: internals.Chunk, - module: internals.RuntimeModule - ): void; + processRuntimeRequirements(entrypoints: Iterable): void; + addRuntimeModule(chunk: webpack.Chunk, module: webpack.RuntimeModule): void; addChunkInGroup( groupOptions: | string | { preloadOrder?: number; prefetchOrder?: number; name: string }, - module: internals.Module, - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation, + module: webpack.Module, + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, request: string - ): internals.ChunkGroup; + ): webpack.ChunkGroup; /** * This method first looks to see if a name is provided for a new chunk, * and first looks to see if any named chunks already exist and reuse that chunk instead. */ - addChunk(name: string): internals.Chunk; - assignDepth(module: internals.Module): void; + addChunk(name?: string): webpack.Chunk; + assignDepth(module: webpack.Module): void; getDependencyReferencedExports( - dependency: internals.Dependency + dependency: webpack.Dependency ): Array>; removeReasonsOfDependencyBlock( - module: internals.Module, - block: internals.DependenciesBlockLike + module: webpack.Module, + block: webpack.DependenciesBlockLike ): void; patchChunksAfterReasonRemoval( - module: internals.Module, - chunk: internals.Chunk + module: webpack.Module, + chunk: webpack.Chunk ): void; removeChunkFromDependencies( - block: internals.DependenciesBlock, - chunk: internals.Chunk + block: webpack.DependenciesBlock, + chunk: webpack.Chunk ): void; sortItemsWithChunkIds(): void; summarizeDependencies(): void; @@ -1402,50 +1343,50 @@ declare namespace internals { modifyHash(update: string): void; emitAsset( file: string, - source: internals.Source, - assetInfo?: internals.AssetInfo + source: webpack.Source, + assetInfo?: webpack.AssetInfo ): void; updateAsset( file: string, newSourceOrFunction: - | internals.Source - | ((arg0: internals.Source) => internals.Source), + | webpack.Source + | ((arg0: webpack.Source) => webpack.Source), assetInfoUpdateOrFunction?: - | internals.AssetInfo - | ((arg0: internals.AssetInfo) => internals.AssetInfo) + | webpack.AssetInfo + | ((arg0: webpack.AssetInfo) => webpack.AssetInfo) ): void; - getAssets(): Array; - getAsset(name: string): internals.Asset; + getAssets(): Array; + getAsset(name: string): webpack.Asset; clearAssets(): void; createModuleAssets(): void; getRenderManifest( - options: internals.RenderManifestOptions - ): Array; - createChunkAssets(callback: (err?: internals.WebpackError) => void): void; + options: webpack.RenderManifestOptions + ): Array; + createChunkAssets(callback: (err?: webpack.WebpackError) => void): void; getPath( filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), - data?: internals.PathData + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), + data?: webpack.PathData ): string; getPathWithInfo( filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), - data?: internals.PathData - ): { path: string; info: internals.AssetInfo }; + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), + data?: webpack.PathData + ): { path: string; info: webpack.AssetInfo }; getAssetPath( filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), - data: internals.PathData + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), + data: webpack.PathData ): string; getAssetPathWithInfo( filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), - data: internals.PathData - ): { path: string; info: internals.AssetInfo }; + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), + data: webpack.PathData + ): { path: string; info: webpack.AssetInfo }; /** * This function allows you to run another instance of webpack inside of webpack however as @@ -1454,119 +1395,117 @@ declare namespace internals { */ createChildCompiler( name: string, - outputOptions: internals.OutputNormalized, - plugins: Array - ): internals.Compiler; + outputOptions: webpack.OutputNormalized, + plugins: Array + ): webpack.Compiler; checkConstraints(): void; } export interface CompilationHooksAsyncWebAssemblyModulesPlugin { renderModuleContent: SyncWaterfallHook< [ - internals.Source, - internals.Module, - internals.RenderContextAsyncWebAssemblyModulesPlugin + webpack.Source, + webpack.Module, + webpack.RenderContextAsyncWebAssemblyModulesPlugin ] >; } export interface CompilationHooksJavascriptModulesPlugin { renderModuleContent: SyncWaterfallHook< [ - internals.Source, - internals.Module, - internals.RenderContextJavascriptModulesPlugin + webpack.Source, + webpack.Module, + webpack.RenderContextJavascriptModulesPlugin ] >; renderModuleContainer: SyncWaterfallHook< [ - internals.Source, - internals.Module, - internals.RenderContextJavascriptModulesPlugin + webpack.Source, + webpack.Module, + webpack.RenderContextJavascriptModulesPlugin ] >; renderModulePackage: SyncWaterfallHook< [ - internals.Source, - internals.Module, - internals.RenderContextJavascriptModulesPlugin + webpack.Source, + webpack.Module, + webpack.RenderContextJavascriptModulesPlugin ] >; renderChunk: SyncWaterfallHook< - [internals.Source, internals.RenderContextJavascriptModulesPlugin] + [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] >; renderMain: SyncWaterfallHook< - [internals.Source, internals.RenderContextJavascriptModulesPlugin] + [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] >; render: SyncWaterfallHook< - [internals.Source, internals.RenderContextJavascriptModulesPlugin] - >; - renderRequire: SyncWaterfallHook< - [string, internals.RenderBootstrapContext] + [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] >; + renderRequire: SyncWaterfallHook<[string, webpack.RenderBootstrapContext]>; chunkHash: SyncHook< - [internals.Chunk, internals.Hash, internals.ChunkHashContext], + [webpack.Chunk, webpack.Hash, webpack.ChunkHashContext], void >; } export interface CompilationParams { - normalModuleFactory: internals.NormalModuleFactory; - contextModuleFactory: internals.ContextModuleFactory; + normalModuleFactory: webpack.NormalModuleFactory; + contextModuleFactory: webpack.ContextModuleFactory; } export class Compiler { constructor(context: string); hooks: Readonly<{ initialize: SyncHook<[], void>; - shouldEmit: SyncBailHook<[internals.Compilation], boolean>; - done: AsyncSeriesHook<[internals.Stats]>; - afterDone: SyncHook<[internals.Stats], void>; + shouldEmit: SyncBailHook<[webpack.Compilation], boolean>; + done: AsyncSeriesHook<[webpack.Stats]>; + afterDone: SyncHook<[webpack.Stats], void>; additionalPass: AsyncSeriesHook<[]>; - beforeRun: AsyncSeriesHook<[internals.Compiler]>; - run: AsyncSeriesHook<[internals.Compiler]>; - emit: AsyncSeriesHook<[internals.Compilation]>; - assetEmitted: AsyncSeriesHook<[string, internals.AssetEmittedInfo]>; - afterEmit: AsyncSeriesHook<[internals.Compilation]>; + beforeRun: AsyncSeriesHook<[webpack.Compiler]>; + run: AsyncSeriesHook<[webpack.Compiler]>; + emit: AsyncSeriesHook<[webpack.Compilation]>; + assetEmitted: AsyncSeriesHook<[string, webpack.AssetEmittedInfo]>; + afterEmit: AsyncSeriesHook<[webpack.Compilation]>; thisCompilation: SyncHook< - [internals.Compilation, internals.CompilationParams], + [webpack.Compilation, webpack.CompilationParams], void >; compilation: SyncHook< - [internals.Compilation, internals.CompilationParams], + [webpack.Compilation, webpack.CompilationParams], void >; - normalModuleFactory: SyncHook<[internals.NormalModuleFactory], void>; - contextModuleFactory: SyncHook<[internals.ContextModuleFactory], void>; - beforeCompile: AsyncSeriesHook<[internals.CompilationParams]>; - compile: SyncHook<[internals.CompilationParams], void>; - make: AsyncParallelHook<[internals.Compilation]>; - afterCompile: AsyncSeriesHook<[internals.Compilation]>; - watchRun: AsyncSeriesHook<[internals.Compiler]>; + normalModuleFactory: SyncHook<[webpack.NormalModuleFactory], void>; + contextModuleFactory: SyncHook<[webpack.ContextModuleFactory], void>; + beforeCompile: AsyncSeriesHook<[webpack.CompilationParams]>; + compile: SyncHook<[webpack.CompilationParams], void>; + make: AsyncParallelHook<[webpack.Compilation]>; + afterCompile: AsyncSeriesHook<[webpack.Compilation]>; + watchRun: AsyncSeriesHook<[webpack.Compiler]>; failed: SyncHook<[Error], void>; invalid: SyncHook<[string, string], void>; watchClose: SyncHook<[], void>; infrastructureLog: SyncBailHook<[string, string, Array], true>; environment: SyncHook<[], void>; afterEnvironment: SyncHook<[], void>; - afterPlugins: SyncHook<[internals.Compiler], void>; - afterResolvers: SyncHook<[internals.Compiler], void>; + afterPlugins: SyncHook<[webpack.Compiler], void>; + afterResolvers: SyncHook<[webpack.Compiler], void>; entryOption: SyncBailHook< [ string, ( - | (() => Promise) - | internals.EntryStaticNormalized + | (() => Promise) + | webpack.EntryStaticNormalized ) ], boolean >; }>; name: string; - parentCompilation: internals.Compilation; - root: internals.Compiler; + parentCompilation: webpack.Compilation; + root: webpack.Compiler; outputPath: string; - outputFileSystem: internals.OutputFileSystem; - intermediateFileSystem: internals.InputFileSystem & - internals.OutputFileSystem & - internals.IntermediateFileSystemExtras; - inputFileSystem: internals.InputFileSystem; + outputFileSystem: webpack.OutputFileSystem; + intermediateFileSystem: webpack.InputFileSystem & + webpack.OutputFileSystem & + webpack.IntermediateFileSystemExtras; + inputFileSystem: webpack.InputFileSystem; watchFileSystem: any; recordsInputPath: string; recordsOutputPath: string; @@ -1575,57 +1514,57 @@ declare namespace internals { immutablePaths: Set; modifiedFiles: Set; removedFiles: Set; - fileTimestamps: Map; - contextTimestamps: Map; - resolverFactory: internals.ResolverFactory; + fileTimestamps: Map; + contextTimestamps: Map; + resolverFactory: webpack.ResolverFactory; infrastructureLogger: any; - options: internals.WebpackOptionsNormalized; + options: webpack.WebpackOptionsNormalized; context: string; - requestShortener: internals.RequestShortener; - cache: internals.Cache; + requestShortener: webpack.RequestShortener; + cache: webpack.Cache; compilerPath: string; running: boolean; watchMode: boolean; getInfrastructureLogger( name: string | (() => string) - ): internals.WebpackLogger; + ): webpack.WebpackLogger; watch( - watchOptions: internals.WatchOptions, - handler: internals.CallbackCompiler - ): internals.Watching; - run(callback: internals.CallbackCompiler): void; + watchOptions: webpack.WatchOptions, + handler: webpack.CallbackCompiler + ): webpack.Watching; + run(callback: webpack.CallbackCompiler): void; runAsChild( callback: ( err?: Error, - entries?: Array, - compilation?: internals.Compilation + entries?: Array, + compilation?: webpack.Compilation ) => any ): void; purgeInputFileSystem(): void; emitAssets( - compilation: internals.Compilation, - callback: internals.CallbackCompiler + compilation: webpack.Compilation, + callback: webpack.CallbackCompiler ): void; - emitRecords(callback: internals.CallbackCompiler): void; - readRecords(callback: internals.CallbackCompiler): void; + emitRecords(callback: webpack.CallbackCompiler): void; + readRecords(callback: webpack.CallbackCompiler): void; createChildCompiler( - compilation: internals.Compilation, + compilation: webpack.Compilation, compilerName: string, compilerIndex: number, - outputOptions: internals.OutputNormalized, - plugins: Array - ): internals.Compiler; + outputOptions: webpack.OutputNormalized, + plugins: Array + ): webpack.Compiler; isChild(): boolean; - createCompilation(): internals.Compilation; - newCompilation(params: internals.CompilationParams): internals.Compilation; - createNormalModuleFactory(): internals.NormalModuleFactory; - createContextModuleFactory(): internals.ContextModuleFactory; + createCompilation(): webpack.Compilation; + newCompilation(params: webpack.CompilationParams): webpack.Compilation; + createNormalModuleFactory(): webpack.NormalModuleFactory; + createContextModuleFactory(): webpack.ContextModuleFactory; newCompilationParams(): { - normalModuleFactory: internals.NormalModuleFactory; - contextModuleFactory: internals.ContextModuleFactory; + normalModuleFactory: webpack.NormalModuleFactory; + contextModuleFactory: webpack.ContextModuleFactory; }; - compile(callback: internals.CallbackCompiler): void; - close(callback: internals.CallbackCompiler): void; + compile(callback: webpack.CallbackCompiler): void; + close(callback: webpack.CallbackCompiler): void; } export class ContextExclusionPlugin { constructor(negativeMatcher: RegExp); @@ -1634,9 +1573,9 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export abstract class ContextModuleFactory extends internals.ModuleFactory { + export abstract class ContextModuleFactory extends webpack.ModuleFactory { hooks: Readonly<{ beforeResolve: AsyncSeriesWaterfallHook<[any]>; afterResolve: AsyncSeriesWaterfallHook<[any]>; @@ -1679,7 +1618,7 @@ declare namespace internals { | boolean | Function | RegExp - | internals.RuntimeValue + | webpack.RuntimeValue | { [index: string]: RecursiveArrayOrRecordDeclarations } | Array > @@ -1692,7 +1631,7 @@ declare namespace internals { | boolean | Function | RegExp - | internals.RuntimeValue + | webpack.RuntimeValue | { [index: string]: RecursiveArrayOrRecordDeclarations } | Array >; @@ -1700,11 +1639,8 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; - static runtimeValue( - fn?: any, - fileDependencies?: any - ): internals.RuntimeValue; + apply(compiler: webpack.Compiler): void; + static runtimeValue(fn?: any, fileDependencies?: any): webpack.RuntimeValue; } export class DelegatedPlugin { constructor(options?: any); @@ -1713,78 +1649,64 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export abstract class DependenciesBlock { - dependencies: Array; - blocks: Array; + dependencies: Array; + blocks: Array; /** * Adds a DependencyBlock to DependencyBlock relationship. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting) */ - addBlock(block: internals.AsyncDependenciesBlock): void; - addDependency(dependency: internals.Dependency): void; - removeDependency(dependency: internals.Dependency): void; + addBlock(block: webpack.AsyncDependenciesBlock): void; + addDependency(dependency: webpack.Dependency): void; + removeDependency(dependency: webpack.Dependency): void; /** * Removes all dependencies and blocks */ clearDependenciesAndBlocks(): void; - - /** - * Update the hash - */ - updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; + updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; serialize(__0: { write: any }): void; deserialize(__0: { read: any }): void; } export interface DependenciesBlockLike { - dependencies: Array; - blocks: Array; + dependencies: Array; + blocks: Array; } export class Dependency { constructor(); weak: boolean; optional: boolean; - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation; + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; readonly type: string; getResourceIdentifier(): string; - getReference(moduleGraph: internals.ModuleGraph): never; + getReference(moduleGraph: webpack.ModuleGraph): never; /** * Returns list of exports referenced by this dependency */ getReferencedExports( - moduleGraph: internals.ModuleGraph + moduleGraph: webpack.ModuleGraph ): Array>; - getCondition(moduleGraph: internals.ModuleGraph): () => boolean; + getCondition(moduleGraph: webpack.ModuleGraph): () => boolean; /** * Returns the exported names */ - getExports(moduleGraph: internals.ModuleGraph): internals.ExportsSpec; + getExports(moduleGraph: webpack.ModuleGraph): webpack.ExportsSpec; /** * Returns warnings */ - getWarnings( - moduleGraph: internals.ModuleGraph - ): Array; + getWarnings(moduleGraph: webpack.ModuleGraph): Array; /** * Returns errors */ - getErrors( - moduleGraph: internals.ModuleGraph - ): Array; - - /** - * Update the hash - */ - updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; + getErrors(moduleGraph: webpack.ModuleGraph): Array; + updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; /** * implement this method to allow the occurrence order plugin to count correctly @@ -1800,31 +1722,31 @@ declare namespace internals { } export abstract class DependencyTemplate { apply( - dependency: internals.Dependency, - source: internals.ReplaceSource, - templateContext: internals.DependencyTemplateContext + dependency: webpack.Dependency, + source: webpack.ReplaceSource, + templateContext: webpack.DependencyTemplateContext ): void; } export interface DependencyTemplateContext { /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the requirements for runtime @@ -1834,24 +1756,24 @@ declare namespace internals { /** * current module */ - module: internals.Module; + module: webpack.Module; /** * mutable array of init fragments for the current module */ - initFragments: Array; + initFragments: Array; } export abstract class DependencyTemplates { get(dependency: { - new (...args: Array): internals.Dependency; - }): internals.DependencyTemplate; + new (...args: Array): webpack.Dependency; + }): webpack.DependencyTemplate; set( - dependency: { new (...args: Array): internals.Dependency }, - dependencyTemplate: internals.DependencyTemplate + dependency: { new (...args: Array): webpack.Dependency }, + dependencyTemplate: webpack.DependencyTemplate ): void; updateHash(part: string): void; getHash(): string; - clone(): internals.DependencyTemplates; + clone(): webpack.DependencyTemplates; } export class DeterministicModuleIdsPlugin { constructor(options?: any); @@ -1860,7 +1782,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -1872,7 +1794,7 @@ declare namespace internals { export type DevTool = string | false; export type DevtoolFallbackModuleFilenameTemplate = string | Function; export class DllPlugin { - constructor(options: internals.DllPluginOptions); + constructor(options: webpack.DllPluginOptions); options: { entryOnly: boolean; /** @@ -1900,7 +1822,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -1954,7 +1876,7 @@ declare namespace internals { /** * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. */ - manifest: string | internals.DllReferencePluginOptionsManifest; + manifest: string | webpack.DllReferencePluginOptionsManifest; /** * The name where the dll is exposed (external name, defaults to manifest.name). */ @@ -1990,7 +1912,7 @@ declare namespace internals { /** * The mappings from request to module info. */ - content: internals.DllReferencePluginOptionsContent; + content: webpack.DllReferencePluginOptionsContent; /** * Context of requests in the manifest (or content property) as absolute path. */ @@ -2044,7 +1966,7 @@ declare namespace internals { /** * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. */ - manifest: string | internals.DllReferencePluginOptionsManifest; + manifest: string | webpack.DllReferencePluginOptionsManifest; /** * The name where the dll is exposed (external name, defaults to manifest.name). */ @@ -2080,7 +2002,7 @@ declare namespace internals { /** * The mappings from request to module info. */ - content: internals.DllReferencePluginOptionsContent; + content: webpack.DllReferencePluginOptionsContent; /** * Context of requests in the manifest (or content property) as absolute path. */ @@ -2135,7 +2057,7 @@ declare namespace internals { /** * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. */ - manifest: string | internals.DllReferencePluginOptionsManifest; + manifest: string | webpack.DllReferencePluginOptionsManifest; /** * The name where the dll is exposed (external name, defaults to manifest.name). */ @@ -2171,7 +2093,7 @@ declare namespace internals { /** * The mappings from request to module info. */ - content: internals.DllReferencePluginOptionsContent; + content: webpack.DllReferencePluginOptionsContent; /** * Context of requests in the manifest (or content property) as absolute path. */ @@ -2239,7 +2161,7 @@ declare namespace internals { /** * The mappings from request to module info. */ - content: internals.DllReferencePluginOptionsContent; + content: webpack.DllReferencePluginOptionsContent; /** * The name where the dll is exposed (external name). @@ -2325,9 +2247,9 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static checkEnabled( - compiler: internals.Compiler, + compiler: webpack.Compiler, type: | "var" | "module" @@ -2351,26 +2273,26 @@ declare namespace internals { | string | (() => | string - | internals.EntryObject + | webpack.EntryObject | [string, string] - | Promise) - | internals.EntryObject + | Promise) + | webpack.EntryObject | [string, string]; export interface EntryData { /** * dependencies of the entrypoint */ - dependencies: Array; + dependencies: Array; /** * options of the entrypoint */ options: { name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >; } - export abstract class EntryDependency extends internals.ModuleDependency {} + export abstract class EntryDependency extends webpack.ModuleDependency {} /** * An object with entry point description. @@ -2386,10 +2308,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Module(s) that are loaded upon startup. @@ -2399,7 +2318,7 @@ declare namespace internals { /** * Options for library. */ - library?: internals.LibraryOptions; + library?: webpack.LibraryOptions; } /** @@ -2416,10 +2335,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Module(s) that are loaded upon startup. The last one is exported. @@ -2429,18 +2345,18 @@ declare namespace internals { /** * Options for library. */ - library?: internals.LibraryOptions; + library?: webpack.LibraryOptions; } export type EntryItem = string | [string, string]; export type EntryNormalized = - | (() => Promise) - | internals.EntryStaticNormalized; + | (() => Promise) + | webpack.EntryStaticNormalized; /** * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object. */ export interface EntryObject { - [index: string]: string | [string, string] | internals.EntryDescription; + [index: string]: string | [string, string] | webpack.EntryDescription; } export class EntryPlugin { /** @@ -2453,8 +2369,8 @@ declare namespace internals { options: | string | ({ name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >) ); context: string; @@ -2462,44 +2378,44 @@ declare namespace internals { options: | string | ({ name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >); /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static createDependency( entry: string, options: | string | ({ name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >) - ): internals.EntryDependency; + ): webpack.EntryDependency; } - export type EntryStatic = string | internals.EntryObject | [string, string]; + export type EntryStatic = string | webpack.EntryObject | [string, string]; /** * Multiple entry bundles are created. The key is the entry name. The value is an entry description object. */ export interface EntryStaticNormalized { - [index: string]: internals.EntryDescriptionNormalized; + [index: string]: webpack.EntryDescriptionNormalized; } - export abstract class Entrypoint extends internals.ChunkGroup { - runtimeChunk: internals.Chunk; + export abstract class Entrypoint extends webpack.ChunkGroup { + runtimeChunk: webpack.Chunk; /** * Sets the runtimeChunk for an entrypoint. */ - setRuntimeChunk(chunk: internals.Chunk): void; + setRuntimeChunk(chunk: webpack.Chunk): void; /** * Fetches the chunk reference containing the webpack bootstrap code */ - getRuntimeChunk(): internals.Chunk; + getRuntimeChunk(): webpack.Chunk; } export class EnvironmentPlugin { constructor(...keys: Array); @@ -2509,7 +2425,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface Etag { toString: () => string; @@ -2523,7 +2439,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class EvalSourceMapDevToolPlugin { constructor(options?: any); @@ -2535,7 +2451,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -2582,9 +2498,10 @@ declare namespace internals { */ topLevelAwait?: boolean; } - export abstract class ExportInfo { + export class ExportInfo { + constructor(name: string, initFrom?: webpack.ExportInfo); name: string; - usedName: string | typeof internals.SKIP_OVER_NAME; + usedName: string | typeof webpack.SKIP_OVER_NAME; used: 0 | 1 | 2 | 3 | 4; /** @@ -2609,11 +2526,11 @@ declare namespace internals { */ canMangleUse: boolean; exportsInfoOwned: boolean; - exportsInfo: internals.ExportsInfo; + exportsInfo: webpack.ExportsInfo; readonly canMangle: boolean; getUsedName(fallbackName?: any): any; - createNestedExportsInfo(): internals.ExportsInfo; - getNestedExportsInfo(): internals.ExportsInfo; + createNestedExportsInfo(): webpack.ExportsInfo; + getNestedExportsInfo(): webpack.ExportsInfo; getUsedInfo(): | "used" | "no usage info" @@ -2641,30 +2558,31 @@ declare namespace internals { /** * nested exports */ - exports?: Array; + exports?: Array; /** * when reexported: from which module */ - from?: internals.Module; + from?: webpack.Module; /** * when reexported: from which export */ export?: Array; } - export abstract class ExportsInfo { - readonly ownedExports: Iterable; - readonly exports: Iterable; - readonly orderedExports: Iterable; - readonly otherExportsInfo: internals.ExportInfo; + export class ExportsInfo { + constructor(); + readonly ownedExports: Iterable; + readonly exports: Iterable; + readonly orderedExports: Iterable; + readonly otherExportsInfo: webpack.ExportInfo; setRedirectNamedTo(exportsInfo?: any): void; setHasProvideInfo(): void; setHasUseInfo(): void; - getExportInfo(name: string): internals.ExportInfo; - getReadOnlyExportInfo(name: string): internals.ExportInfo; - getNestedExportsInfo(name: Array): internals.ExportsInfo; - setUnknownExportsProvided(canMangle: boolean): boolean; + getExportInfo(name: string): webpack.ExportInfo; + getReadOnlyExportInfo(name: string): webpack.ExportInfo; + getNestedExportsInfo(name?: Array): webpack.ExportsInfo; + setUnknownExportsProvided(canMangle?: boolean): boolean; setUsedInUnknownWay(): boolean; setAllKnownExportsUsed(): boolean; setUsedForSideEffectsOnly(): boolean; @@ -2685,7 +2603,7 @@ declare namespace internals { /** * exported names, true for unknown exports or null for no exports */ - exports: true | Array; + exports: true | Array; /** * can the export be renamed (defaults to true) @@ -2695,7 +2613,7 @@ declare namespace internals { /** * module on which the result depends on */ - dependencies?: Array; + dependencies?: Array; } export type Expression = | UnaryExpression @@ -2737,6 +2655,17 @@ declare namespace internals { request: string, callback: (err: Error, result: string) => void ) => void); + export class ExternalModule extends webpack.Module { + constructor(request?: any, type?: any, userRequest?: any); + request: string | Array | Record>; + externalType: string; + userRequest: string; + getSourceString( + runtimeTemplate?: any, + moduleGraph?: any, + chunkGraph?: any + ): string; + } export type Externals = | string | RegExp @@ -2776,7 +2705,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type ExternalsType = | "var" @@ -2796,10 +2725,10 @@ declare namespace internals { | "jsonp" | "system"; export interface FactorizeModuleOptions { - currentProfile: internals.ModuleProfile; - factory: internals.ModuleFactory; - dependencies: Array; - originModule: internals.Module; + currentProfile: webpack.ModuleProfile; + factory: webpack.ModuleFactory; + dependencies: Array; + originModule: webpack.Module; context?: string; } export interface FallbackCacheGroup { @@ -2815,7 +2744,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -2883,64 +2812,60 @@ declare namespace internals { version?: string; } export abstract class FileSystemInfo { - fs: internals.InputFileSystem; - logger: internals.WebpackLogger; - fileTimestampQueue: internals.AsyncQueue< + fs: webpack.InputFileSystem; + logger: webpack.WebpackLogger; + fileTimestampQueue: webpack.AsyncQueue< string, string, - internals.FileSystemInfoEntry + webpack.FileSystemInfoEntry >; - fileHashQueue: internals.AsyncQueue; - contextTimestampQueue: internals.AsyncQueue< + fileHashQueue: webpack.AsyncQueue; + contextTimestampQueue: webpack.AsyncQueue< string, string, - internals.FileSystemInfoEntry - >; - contextHashQueue: internals.AsyncQueue; - managedItemQueue: internals.AsyncQueue; - managedItemDirectoryQueue: internals.AsyncQueue< - string, - string, - Set + webpack.FileSystemInfoEntry >; + contextHashQueue: webpack.AsyncQueue; + managedItemQueue: webpack.AsyncQueue; + managedItemDirectoryQueue: webpack.AsyncQueue>; managedPaths: Array; managedPathsWithSlash: Array; immutablePaths: Array; immutablePathsWithSlash: Array; addFileTimestamps( - map: Map + map: Map ): void; addContextTimestamps( - map: Map + map: Map ): void; getFileTimestamp( path: string, callback: ( - arg0: internals.WebpackError, - arg1: internals.FileSystemInfoEntry | "ignore" + arg0: webpack.WebpackError, + arg1: webpack.FileSystemInfoEntry | "ignore" ) => void ): void; getContextTimestamp( path: string, callback: ( - arg0: internals.WebpackError, - arg1: internals.FileSystemInfoEntry | "ignore" + arg0: webpack.WebpackError, + arg1: webpack.FileSystemInfoEntry | "ignore" ) => void ): void; getFileHash( path: string, - callback: (arg0: internals.WebpackError, arg1: string) => void + callback: (arg0: webpack.WebpackError, arg1: string) => void ): void; getContextHash( path: string, - callback: (arg0: internals.WebpackError, arg1: string) => void + callback: (arg0: webpack.WebpackError, arg1: string) => void ): void; resolveBuildDependencies( context: string, deps: Iterable, callback: ( arg0: Error, - arg1: internals.ResolveBuildDependenciesResult + arg1: webpack.ResolveBuildDependenciesResult ) => void ): void; checkResolveResultsValid( @@ -2958,15 +2883,15 @@ declare namespace internals { */ hash?: boolean; }, - callback: (arg0: internals.WebpackError, arg1: internals.Snapshot) => void + callback: (arg0: webpack.WebpackError, arg1: webpack.Snapshot) => void ): void; mergeSnapshots( - snapshot1: internals.Snapshot, - snapshot2: internals.Snapshot - ): internals.Snapshot; + snapshot1: webpack.Snapshot, + snapshot2: webpack.Snapshot + ): webpack.Snapshot; checkSnapshotValid( - snapshot: internals.Snapshot, - callback: (arg0: internals.WebpackError, arg1: boolean) => void + snapshot: webpack.Snapshot, + callback: (arg0: webpack.WebpackError, arg1: boolean) => void ): void; getDeprecatedFileTimestamps(): Map; getDeprecatedContextTimestamps(): Map; @@ -2982,10 +2907,7 @@ declare namespace internals { } export type Filename = | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); export type FilterItemTypes = string | RegExp | ((value: string) => boolean); export type FilterTypes = | string @@ -2996,22 +2918,22 @@ declare namespace internals { /** * mapping from dependencies to templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the requirements for runtime @@ -3025,23 +2947,23 @@ declare namespace internals { } export class Generator { constructor(); - getTypes(module: internals.NormalModule): Set; - getSize(module: internals.NormalModule, type: string): number; + getTypes(module: webpack.NormalModule): Set; + getSize(module: webpack.NormalModule, type?: string): number; generate( - module: internals.NormalModule, - __1: internals.GenerateContext - ): internals.Source; - updateHash(hash: internals.Hash, __1: internals.UpdateHashContext): void; - static byType(map?: any): internals.ByTypeGenerator; + module: webpack.NormalModule, + __1: webpack.GenerateContext + ): webpack.Source; + updateHash(hash: webpack.Hash, __1: webpack.UpdateHashContext): void; + static byType(map?: any): webpack.ByTypeGenerator; } export interface HMRJavascriptParserHooks { hotAcceptCallback: SyncBailHook<[any, Array], void>; hotAcceptWithoutCallback: SyncBailHook<[any, Array], void>; } export interface HandleModuleCreationOptions { - factory: internals.ModuleFactory; - dependencies: Array; - originModule: internals.Module; + factory: webpack.ModuleFactory; + dependencies: Array; + originModule: webpack.Module; context?: string; /** @@ -3051,13 +2973,13 @@ declare namespace internals { } export class Hash { constructor(); - update(data: string | Buffer, inputEncoding: string): internals.Hash; - digest(encoding: string): string | Buffer; + update(data: string | Buffer, inputEncoding?: string): webpack.Hash; + digest(encoding?: string): string | Buffer; } - export type HashFunction = string | typeof internals.Hash; + export type HashFunction = string | typeof webpack.Hash; export class HashedModuleIdsPlugin { - constructor(options?: internals.HashedModuleIdsPluginOptions); - options: internals.HashedModuleIdsPluginOptions; + constructor(options?: webpack.HashedModuleIdsPluginOptions); + options: webpack.HashedModuleIdsPluginOptions; apply(compiler?: any): void; } @@ -3096,10 +3018,10 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static getParserHooks( - parser: internals.JavascriptParser - ): internals.HMRJavascriptParserHooks; + parser: webpack.JavascriptParser + ): webpack.HMRJavascriptParserHooks; } export class IgnorePlugin { constructor( @@ -3143,12 +3065,12 @@ declare namespace internals { * Note that if "contextRegExp" is given, both the "resourceRegExp" * and "contextRegExp" have to match. */ - checkIgnore(resolveData: internals.ResolveData): false; + checkIgnore(resolveData: webpack.ResolveData): false; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type IgnorePluginOptions = | { @@ -3188,17 +3110,17 @@ declare namespace internals { level?: "none" | "verbose" | "error" | "warn" | "info" | "log"; } export abstract class InitFragment { - content: string | internals.Source; + content: string | webpack.Source; stage: number; position: number; key: string; - endContent: string | internals.Source; + endContent: string | webpack.Source; getContent( - generateContext: internals.GenerateContext - ): string | internals.Source; + generateContext: webpack.GenerateContext + ): string | webpack.Source; getEndContent( - generateContext: internals.GenerateContext - ): string | internals.Source; + generateContext: webpack.GenerateContext + ): string | webpack.Source; merge: any; } export interface InputFileSystem { @@ -3239,46 +3161,46 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; renderModule( - module: internals.Module, - renderContext: internals.RenderContextJavascriptModulesPlugin, - hooks: internals.CompilationHooksJavascriptModulesPlugin, + module: webpack.Module, + renderContext: webpack.RenderContextJavascriptModulesPlugin, + hooks: webpack.CompilationHooksJavascriptModulesPlugin, factory: boolean | "strict" - ): internals.Source; + ): webpack.Source; renderChunk( - renderContext: internals.RenderContextJavascriptModulesPlugin, - hooks: internals.CompilationHooksJavascriptModulesPlugin - ): internals.Source; + renderContext: webpack.RenderContextJavascriptModulesPlugin, + hooks: webpack.CompilationHooksJavascriptModulesPlugin + ): webpack.Source; renderMain( - renderContext: internals.MainRenderContext, - hooks: internals.CompilationHooksJavascriptModulesPlugin - ): internals.Source; + renderContext: webpack.MainRenderContext, + hooks: webpack.CompilationHooksJavascriptModulesPlugin + ): webpack.Source; renderBootstrap( - renderContext: internals.RenderBootstrapContext, - hooks: internals.CompilationHooksJavascriptModulesPlugin + renderContext: webpack.RenderBootstrapContext, + hooks: webpack.CompilationHooksJavascriptModulesPlugin ): { header: Array; startup: Array; allowInlineStartup: boolean; }; renderRequire( - renderContext: internals.RenderBootstrapContext, - hooks: internals.CompilationHooksJavascriptModulesPlugin + renderContext: webpack.RenderBootstrapContext, + hooks: webpack.CompilationHooksJavascriptModulesPlugin ): string; static getCompilationHooks( - compilation: internals.Compilation - ): internals.CompilationHooksJavascriptModulesPlugin; + compilation: webpack.Compilation + ): webpack.CompilationHooksJavascriptModulesPlugin; static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any; static chunkHasJs: ( - chunk: internals.Chunk, - chunkGraph: internals.ChunkGraph + chunk: webpack.Chunk, + chunkGraph: webpack.ChunkGraph ) => boolean; } - export abstract class JavascriptParser extends internals.Parser { + export abstract class JavascriptParser extends webpack.Parser { hooks: Readonly<{ evaluateTypeof: HookMap< - SyncBailHook<[UnaryExpression], internals.BasicEvaluatedExpression> + SyncBailHook<[UnaryExpression], webpack.BasicEvaluatedExpression> >; evaluate: HookMap< SyncBailHook< @@ -3308,28 +3230,28 @@ declare namespace internals { | Identifier | AwaitExpression ], - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression > >; evaluateIdentifier: HookMap< SyncBailHook< [ThisExpression | MemberExpression | Identifier], - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression > >; evaluateDefinedIdentifier: HookMap< SyncBailHook< [ThisExpression | MemberExpression | Identifier], - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression > >; evaluateCallExpressionMember: HookMap< SyncBailHook< [ SimpleCallExpression | NewExpression, - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression ], - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression > >; preStatement: SyncBailHook< @@ -4230,8 +4152,8 @@ declare namespace internals { }>; options: any; sourceType: "module" | "script" | "auto"; - scope: internals.ScopeInfo; - state: Record & internals.ParserStateBase; + scope: webpack.ScopeInfo; + state: Record & webpack.ParserStateBase; comments: any; semicolons: any; statementEndPos: any; @@ -4335,7 +4257,7 @@ declare namespace internals { expr: MemberExpression, fallback: ( arg0: string, - arg1: string | internals.ScopeInfo | internals.VariableInfo, + arg1: string | webpack.ScopeInfo | webpack.VariableInfo, arg2: () => Array ) => any, defined: (arg0: string) => any, @@ -4348,12 +4270,12 @@ declare namespace internals { ): R; callHooksForInfo( hookMap: HookMap>, - info: string | internals.ScopeInfo | internals.VariableInfo, + info: string | webpack.ScopeInfo | webpack.VariableInfo, ...args: AsArray ): R; callHooksForInfoWithFallback( hookMap: HookMap>, - info: string | internals.ScopeInfo | internals.VariableInfo, + info: string | webpack.ScopeInfo | webpack.VariableInfo, fallback: (arg0: string) => any, defined: () => any, ...args: AsArray @@ -4402,10 +4324,10 @@ declare namespace internals { | MetaProperty | Identifier | AwaitExpression - ): internals.BasicEvaluatedExpression; + ): webpack.BasicEvaluatedExpression; parseString(expression?: any): any; parseCalculatedString(expression?: any): any; - evaluate(source?: any): internals.BasicEvaluatedExpression; + evaluate(source?: any): webpack.BasicEvaluatedExpression; getComments(range?: any): any; isAsiPosition(pos?: any): any; getTagData(name?: any, tag?: any): any; @@ -4415,10 +4337,10 @@ declare namespace internals { isVariableDefined(name?: any): boolean; getVariableInfo( name: string - ): string | internals.ScopeInfo | internals.VariableInfo; + ): string | webpack.ScopeInfo | webpack.VariableInfo; setVariable( name: string, - variableInfo: string | internals.ScopeInfo | internals.VariableInfo + variableInfo: string | webpack.ScopeInfo | webpack.VariableInfo ): void; parseCommentOptions(range?: any): { options: any; errors: any }; extractMemberExpressionChain( @@ -4454,7 +4376,7 @@ declare namespace internals { }; getFreeInfoFromVariable( varName: string - ): { name: string; info: string | internals.VariableInfo }; + ): { name: string; info: string | webpack.VariableInfo }; getMemberExpressionInfo( expression: MemberExpression, allowedTypes: Array<"expression" | "call"> @@ -4463,14 +4385,14 @@ declare namespace internals { type: "call"; call: SimpleCallExpression | NewExpression; calleeName: string; - rootInfo: string | internals.VariableInfo; + rootInfo: string | webpack.VariableInfo; getCalleeMembers: () => Array; name: string; getMembers: () => Array; } | { type: "expression"; - rootInfo: string | internals.VariableInfo; + rootInfo: string | webpack.VariableInfo; name: string; getMembers: () => Array; }; @@ -4478,14 +4400,14 @@ declare namespace internals { expression: MemberExpression ): { name: string; - rootInfo: string | internals.ScopeInfo | internals.VariableInfo; + rootInfo: string | webpack.ScopeInfo | webpack.VariableInfo; getMembers: () => Array; }; } export interface JsonpCompilationPluginHooks { - jsonpScript: SyncWaterfallHook<[string, internals.Chunk, string]>; - linkPreload: SyncWaterfallHook<[string, internals.Chunk, string]>; - linkPrefetch: SyncWaterfallHook<[string, internals.Chunk, string]>; + jsonpScript: SyncWaterfallHook<[string, webpack.Chunk, string]>; + linkPreload: SyncWaterfallHook<[string, webpack.Chunk, string]>; + linkPrefetch: SyncWaterfallHook<[string, webpack.Chunk, string]>; } export type JsonpScriptType = false | "module" | "text/javascript"; export class JsonpTemplatePlugin { @@ -4494,10 +4416,10 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static getCompilationHooks( - compilation: internals.Compilation - ): internals.JsonpCompilationPluginHooks; + compilation: webpack.Compilation + ): webpack.JsonpCompilationPluginHooks; } export interface KnownBuildMeta { moduleArgument?: string; @@ -4511,8 +4433,8 @@ declare namespace internals { } export abstract class LazySet { readonly size: number; - add(item: T): internals.LazySet; - addAll(iterable: internals.LazySet | Iterable): internals.LazySet; + add(item: T): webpack.LazySet; + addAll(iterable: webpack.LazySet | Iterable): webpack.LazySet; clear(): void; delete(value: T): boolean; entries(): IterableIterator<[T, T]>; @@ -4523,6 +4445,8 @@ declare namespace internals { has(item: T): boolean; keys(): IterableIterator; values(): IterableIterator; + [Symbol.iterator](): IterableIterator; + readonly [Symbol.toStringTag]: string; serialize(__0: { write: any }): void; } export interface LibIdentOptions { @@ -4543,15 +4467,15 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type Library = | string | Array - | internals.LibraryCustomUmdObject - | internals.LibraryOptions; + | webpack.LibraryCustomUmdObject + | webpack.LibraryOptions; export interface LibraryContext { - compilation: internals.Compilation; + compilation: webpack.Compilation; options: T; } @@ -4603,7 +4527,7 @@ declare namespace internals { export type LibraryName = | string | Array - | internals.LibraryCustomUmdObject; + | webpack.LibraryCustomUmdObject; /** * Options for library. @@ -4612,7 +4536,7 @@ declare namespace internals { /** * Add a comment in the UMD wrapper. */ - auxiliaryComment?: string | internals.LibraryCustomUmdCommentObject; + auxiliaryComment?: string | webpack.LibraryCustomUmdCommentObject; /** * Specify which export should be exposed as library. @@ -4622,7 +4546,7 @@ declare namespace internals { /** * The name of the library (some types allow unnamed libraries too). */ - name?: string | Array | internals.LibraryCustomUmdObject; + name?: string | Array | webpack.LibraryCustomUmdObject; /** * Type of library. @@ -4652,7 +4576,7 @@ declare namespace internals { } export class LibraryTemplatePlugin { constructor( - name: string | Array | internals.LibraryCustomUmdObject, + name: string | Array | webpack.LibraryCustomUmdObject, target: | "var" | "module" @@ -4671,7 +4595,7 @@ declare namespace internals { | "jsonp" | "system", umdNamedDefine: boolean, - auxiliaryComment: string | internals.LibraryCustomUmdCommentObject, + auxiliaryComment: string | webpack.LibraryCustomUmdCommentObject, exportProperty: string | Array ); library: { @@ -4692,25 +4616,25 @@ declare namespace internals { | "umd2" | "jsonp" | "system"; - name: string | Array | internals.LibraryCustomUmdObject; + name: string | Array | webpack.LibraryCustomUmdObject; umdNamedDefine: boolean; - auxiliaryComment: string | internals.LibraryCustomUmdCommentObject; + auxiliaryComment: string | webpack.LibraryCustomUmdCommentObject; export: string | Array; }; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class LimitChunkCountPlugin { - constructor(options: internals.LimitChunkCountPluginOptions); - options: internals.LimitChunkCountPluginOptions; + constructor(options?: webpack.LimitChunkCountPluginOptions); + options: webpack.LimitChunkCountPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -4747,13 +4671,13 @@ declare namespace internals { ident: string; } export class LoaderOptionsPlugin { - constructor(options?: internals.LoaderOptionsPluginOptions); - options: internals.LoaderOptionsPluginOptions; + constructor(options?: webpack.LoaderOptionsPluginOptions); + options: webpack.LoaderOptionsPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -4792,7 +4716,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface LogEntry { type: string; @@ -4806,35 +4730,32 @@ declare namespace internals { /** * the chunk */ - chunk: internals.Chunk; + chunk: webpack.Chunk; /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * results of code generation */ - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; + codeGenerationResults: Map; /** * hash to be used for render call @@ -4864,25 +4785,23 @@ declare namespace internals { bootstrap: SyncWaterfallHook< [ string, - internals.Chunk, + webpack.Chunk, string, - internals.ModuleTemplate, - internals.DependencyTemplates + webpack.ModuleTemplate, + webpack.DependencyTemplates ] >; - localVars: SyncWaterfallHook<[string, internals.Chunk, string]>; - requireExtensions: SyncWaterfallHook<[string, internals.Chunk, string]>; - requireEnsure: SyncWaterfallHook< - [string, internals.Chunk, string, string] - >; + localVars: SyncWaterfallHook<[string, webpack.Chunk, string]>; + requireExtensions: SyncWaterfallHook<[string, webpack.Chunk, string]>; + requireEnsure: SyncWaterfallHook<[string, webpack.Chunk, string, string]>; }>; - renderCurrentHashCode: (hash: string, length: number) => string; + renderCurrentHashCode: (hash: string, length?: number) => string; getPublicPath: (options?: any) => string; getAssetPath: (path?: any, options?: any) => string; getAssetPathWithInfo: ( path?: any, options?: any - ) => { path: string; info: internals.AssetInfo }; + ) => { path: string; info: webpack.AssetInfo }; readonly requireFn: string; readonly outputOptions: any; } @@ -4916,16 +4835,16 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class MinChunkSizePlugin { - constructor(options: internals.MinChunkSizePluginOptions); - options: internals.MinChunkSizePluginOptions; + constructor(options: webpack.MinChunkSizePluginOptions); + options: webpack.MinChunkSizePluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -4950,7 +4869,7 @@ declare namespace internals { minChunkSize: number; } export type Mode = "development" | "production" | "none"; - export class Module extends internals.DependenciesBlock { + export class Module extends webpack.DependenciesBlock { constructor(type: string, context?: string); type: string; context: string; @@ -4958,29 +4877,29 @@ declare namespace internals { debugId: number; resolveOptions: any; factoryMeta: any; - buildMeta: internals.KnownBuildMeta & Record; + buildMeta: webpack.KnownBuildMeta & Record; buildInfo: any; - presentationalDependencies: Array; + presentationalDependencies: Array; id: string | number; readonly hash: string; readonly renderedHash: string; - profile: internals.ModuleProfile; + profile: webpack.ModuleProfile; index: number; index2: number; depth: number; - issuer: internals.Module; - readonly usedExports: boolean | internals.SortableSet; + issuer: webpack.Module; + readonly usedExports: boolean | webpack.SortableSet; readonly optimizationBailout: Array< - string | ((requestShortener: internals.RequestShortener) => string) + string | ((requestShortener: webpack.RequestShortener) => string) >; readonly optional: boolean; addChunk(chunk?: any): boolean; removeChunk(chunk?: any): void; isInChunk(chunk?: any): boolean; isEntryModule(): boolean; - getChunks(): Array; + getChunks(): Array; getNumberOfChunks(): number; - readonly chunksIterable: Iterable; + readonly chunksIterable: Iterable; isProvided(exportName: string): boolean; readonly exportsArgument: string; readonly moduleArgument: string; @@ -4993,72 +4912,70 @@ declare namespace internals { | "default-only" | "default-with-named"; addPresentationalDependency( - presentationalDependency: internals.Dependency + presentationalDependency: webpack.Dependency ): void; - addWarning(warning: internals.WebpackError): void; - getWarnings(): Iterable; - addError(error: internals.WebpackError): void; - getErrors(): Iterable; + addWarning(warning: webpack.WebpackError): void; + getWarnings(): Iterable; + addError(error: webpack.WebpackError): void; + getErrors(): Iterable; /** * removes all warnings and errors */ clearWarningsAndErrors(): void; - isOptional(moduleGraph: internals.ModuleGraph): boolean; + isOptional(moduleGraph: webpack.ModuleGraph): boolean; isAccessibleInChunk( - chunkGraph: internals.ChunkGraph, - chunk: internals.Chunk, - ignoreChunk: internals.Chunk + chunkGraph: webpack.ChunkGraph, + chunk: webpack.Chunk, + ignoreChunk?: webpack.Chunk ): boolean; isAccessibleInChunkGroup( - chunkGraph: internals.ChunkGraph, - chunkGroup: internals.ChunkGroup, - ignoreChunk: internals.Chunk + chunkGraph: webpack.ChunkGraph, + chunkGroup: webpack.ChunkGroup, + ignoreChunk?: webpack.Chunk ): boolean; hasReasonForChunk( - chunk: internals.Chunk, - moduleGraph: internals.ModuleGraph, - chunkGraph: internals.ChunkGraph + chunk: webpack.Chunk, + moduleGraph: webpack.ModuleGraph, + chunkGraph: webpack.ChunkGraph ): boolean; - hasReasons(moduleGraph: internals.ModuleGraph): boolean; - isModuleUsed(moduleGraph: internals.ModuleGraph): boolean; + hasReasons(moduleGraph: webpack.ModuleGraph): boolean; + isModuleUsed(moduleGraph: webpack.ModuleGraph): boolean; isExportUsed( - moduleGraph: internals.ModuleGraph, + moduleGraph: webpack.ModuleGraph, exportName: string | Array ): 0 | 1 | 2 | 3 | 4; getUsedName( - moduleGraph: internals.ModuleGraph, + moduleGraph: webpack.ModuleGraph, exportName: string | Array ): string | false | Array; needBuild( - context: internals.NeedBuildContext, - callback: (arg0: internals.WebpackError, arg1: boolean) => void + context: webpack.NeedBuildContext, + callback: (arg0: webpack.WebpackError, arg1: boolean) => void ): void; needRebuild(fileTimestamps?: any, contextTimestamps?: any): boolean; invalidateBuild(): void; identifier(): string; - readableIdentifier(requestShortener: internals.RequestShortener): string; + readableIdentifier(requestShortener: webpack.RequestShortener): string; build( - options: internals.WebpackOptionsNormalized, - compilation: internals.Compilation, - resolver: internals.Resolver & internals.WithOptions, - fs: internals.InputFileSystem, - callback: (arg0: internals.WebpackError) => void + options: webpack.WebpackOptionsNormalized, + compilation: webpack.Compilation, + resolver: webpack.Resolver & webpack.WithOptions, + fs: webpack.InputFileSystem, + callback: (arg0: webpack.WebpackError) => void ): void; getSourceTypes(): Set; - source(sourceContext: internals.SourceContext): internals.Source; - size(type: string): number; - libIdent(options: internals.LibIdentOptions): string; + source(sourceContext: webpack.SourceContext): webpack.Source; + size(type?: string): number; + libIdent(options: webpack.LibIdentOptions): string; nameForCondition(): string; - getRuntimeRequirements( - context: internals.SourceContext - ): ReadonlySet; + getRuntimeRequirements(context: webpack.SourceContext): ReadonlySet; codeGeneration( - context: internals.CodeGenerationContext - ): internals.CodeGenerationResult; + context: webpack.CodeGenerationContext + ): webpack.CodeGenerationResult; chunkCondition( - chunk: internals.Chunk, - compilation: internals.Compilation + chunk: webpack.Chunk, + compilation: webpack.Compilation ): boolean; /** @@ -5066,8 +4983,8 @@ declare namespace internals { * the fresh module from the factory. Usually updates internal references * and properties. */ - updateCacheModule(module: internals.Module): void; - originalSource(): internals.Source; + updateCacheModule(module: webpack.Module): void; + originalSource(): webpack.Source; useSourceMap: any; readonly hasEqualsChunks: any; readonly isUsed: any; @@ -5082,24 +4999,24 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export abstract class ModuleDependency extends internals.Dependency { + export abstract class ModuleDependency extends webpack.Dependency { request: string; userRequest: string; range: any; } export abstract class ModuleFactory { create( - data: internals.ModuleFactoryCreateData, - callback: (arg0: Error, arg1: internals.ModuleFactoryResult) => void + data: webpack.ModuleFactoryCreateData, + callback: (arg0: Error, arg1: webpack.ModuleFactoryResult) => void ): void; } export interface ModuleFactoryCreateData { - contextInfo: internals.ModuleFactoryCreateDataContextInfo; + contextInfo: webpack.ModuleFactoryCreateDataContextInfo; resolveOptions?: any; context: string; - dependencies: Array; + dependencies: Array; } export interface ModuleFactoryCreateDataContextInfo { issuer: string; @@ -5109,7 +5026,7 @@ declare namespace internals { /** * the created module or unset if no module was created */ - module?: internals.Module; + module?: webpack.Module; fileDependencies?: Set; contextDependencies?: Set; missingDependencies?: Set; @@ -5150,108 +5067,127 @@ declare namespace internals { export let matchPart: (str?: any, test?: any) => any; export let matchObject: (obj?: any, str?: any) => boolean; } - export abstract class ModuleGraph { + export class ModuleGraph { + constructor(); setParents( - dependency: internals.Dependency, - block: internals.DependenciesBlock, - module: internals.Module + dependency: webpack.Dependency, + block: webpack.DependenciesBlock, + module: webpack.Module ): void; - getParentModule(dependency: internals.Dependency): internals.Module; - getParentBlock( - dependency: internals.Dependency - ): internals.DependenciesBlock; + getParentModule(dependency: webpack.Dependency): webpack.Module; + getParentBlock(dependency: webpack.Dependency): webpack.DependenciesBlock; setResolvedModule( - originModule: internals.Module, - dependency: internals.Dependency, - module: internals.Module + originModule: webpack.Module, + dependency: webpack.Dependency, + module: webpack.Module ): void; - updateModule( - dependency: internals.Dependency, - module: internals.Module - ): void; - removeConnection(dependency: internals.Dependency): void; - addExplanation(dependency: internals.Dependency, explanation: string): void; + updateModule(dependency: webpack.Dependency, module: webpack.Module): void; + removeConnection(dependency: webpack.Dependency): void; + addExplanation(dependency: webpack.Dependency, explanation: string): void; cloneModuleAttributes( - sourceModule: internals.Module, - targetModule: internals.Module + sourceModule: webpack.Module, + targetModule: webpack.Module ): void; - removeModuleAttributes(module: internals.Module): void; + removeModuleAttributes(module: webpack.Module): void; removeAllModuleAttributes(): void; moveModuleConnections( - oldModule: internals.Module, - newModule: internals.Module, - filterConnection: (arg0: internals.ModuleGraphConnection) => boolean + oldModule: webpack.Module, + newModule: webpack.Module, + filterConnection: (arg0: webpack.ModuleGraphConnection) => boolean ): void; - addExtraReason(module: internals.Module, explanation: string): void; - getResolvedModule(dependency: internals.Dependency): internals.Module; - finishModule(module: internals.Module): void; + addExtraReason(module: webpack.Module, explanation: string): void; + getResolvedModule(dependency: webpack.Dependency): webpack.Module; + finishModule(module: webpack.Module): void; getConnection( - dependency: internals.Dependency - ): internals.ModuleGraphConnection; - getModule(dependency: internals.Dependency): internals.Module; - getOrigin(dependency: internals.Dependency): internals.Module; - getResolvedOrigin(dependency: internals.Dependency): internals.Module; + dependency: webpack.Dependency + ): webpack.ModuleGraphConnection; + getModule(dependency: webpack.Dependency): webpack.Module; + getOrigin(dependency: webpack.Dependency): webpack.Module; + getResolvedOrigin(dependency: webpack.Dependency): webpack.Module; getIncomingConnections( - module: internals.Module - ): Iterable; + module: webpack.Module + ): Iterable; getOutgoingConnections( - module: internals.Module - ): Iterable; - getProfile(module: internals.Module): internals.ModuleProfile; - setProfile( - module: internals.Module, - profile: internals.ModuleProfile - ): void; - getIssuer(module: internals.Module): internals.Module; - setIssuer(module: internals.Module, issuer: internals.Module): void; - setIssuerIfUnset(module: internals.Module, issuer: internals.Module): void; + module: webpack.Module + ): Iterable; + getProfile(module: webpack.Module): webpack.ModuleProfile; + setProfile(module: webpack.Module, profile: webpack.ModuleProfile): void; + getIssuer(module: webpack.Module): webpack.Module; + setIssuer(module: webpack.Module, issuer: webpack.Module): void; + setIssuerIfUnset(module: webpack.Module, issuer: webpack.Module): void; getOptimizationBailout( - module: internals.Module - ): Array< - string | ((requestShortener: internals.RequestShortener) => string) - >; - getProvidedExports(module: internals.Module): true | Array; + module: webpack.Module + ): Array string)>; + getProvidedExports(module: webpack.Module): true | Array; isExportProvided( - module: internals.Module, + module: webpack.Module, exportName: string | Array ): boolean; - getExportsInfo(module: internals.Module): internals.ExportsInfo; + getExportsInfo(module: webpack.Module): webpack.ExportsInfo; getExportInfo( - module: internals.Module, + module: webpack.Module, exportName: string - ): internals.ExportInfo; + ): webpack.ExportInfo; getReadOnlyExportInfo( - module: internals.Module, + module: webpack.Module, exportName: string - ): internals.ExportInfo; + ): webpack.ExportInfo; getUsedExports( - module: internals.Module - ): boolean | internals.SortableSet; - getPreOrderIndex(module: internals.Module): number; - getPostOrderIndex(module: internals.Module): number; - setPreOrderIndex(module: internals.Module, index: number): void; - setPreOrderIndexIfUnset(module: internals.Module, index: number): boolean; - setPostOrderIndex(module: internals.Module, index: number): void; - setPostOrderIndexIfUnset(module: internals.Module, index: number): boolean; - getDepth(module: internals.Module): number; - setDepth(module: internals.Module, depth: number): void; - setDepthIfLower(module: internals.Module, depth: number): boolean; - isAsync(module: internals.Module): boolean; - setAsync(module: internals.Module): void; + module: webpack.Module + ): boolean | webpack.SortableSet; + getPreOrderIndex(module: webpack.Module): number; + getPostOrderIndex(module: webpack.Module): number; + setPreOrderIndex(module: webpack.Module, index: number): void; + setPreOrderIndexIfUnset(module: webpack.Module, index: number): boolean; + setPostOrderIndex(module: webpack.Module, index: number): void; + setPostOrderIndexIfUnset(module: webpack.Module, index: number): boolean; + getDepth(module: webpack.Module): number; + setDepth(module: webpack.Module, depth: number): void; + setDepthIfLower(module: webpack.Module, depth: number): boolean; + isAsync(module: webpack.Module): boolean; + setAsync(module: webpack.Module): void; getMeta(thing?: any): any; + static getModuleGraphForModule( + module: webpack.Module, + deprecateMessage: string, + deprecationCode: string + ): webpack.ModuleGraph; + static setModuleGraphForModule( + module: webpack.Module, + moduleGraph: webpack.ModuleGraph + ): void; + static ModuleGraphConnection: typeof webpack.ModuleGraphConnection; + static ExportsInfo: typeof webpack.ExportsInfo; + static ExportInfo: typeof webpack.ExportInfo; + static SKIP_OVER_NAME: typeof webpack.SKIP_OVER_NAME; + static UsageState: Readonly<{ + NoInfo: 0; + Unused: 1; + Unknown: 2; + OnlyPropertiesUsed: 3; + Used: 4; + }>; } - export abstract class ModuleGraphConnection { - originModule: internals.Module; - resolvedOriginModule: internals.Module; - dependency: internals.Dependency; - resolvedModule: internals.Module; - module: internals.Module; + export class ModuleGraphConnection { + constructor( + originModule: webpack.Module, + dependency: webpack.Dependency, + module: webpack.Module, + explanation?: string, + weak?: boolean, + condition?: (arg0: webpack.ModuleGraphConnection) => boolean + ); + originModule: webpack.Module; + resolvedOriginModule: webpack.Module; + dependency: webpack.Dependency; + resolvedModule: webpack.Module; + module: webpack.Module; weak: boolean; conditional: boolean; - condition: (arg0: internals.ModuleGraphConnection) => boolean; + condition: (arg0: webpack.ModuleGraphConnection) => boolean; explanations: Set; addCondition( - condition: (arg0: internals.ModuleGraphConnection) => boolean + condition: (arg0: webpack.ModuleGraphConnection) => boolean ): void; addExplanation(explanation: string): void; readonly explanation: string; @@ -5265,7 +5201,7 @@ declare namespace internals { /** * An array of rules applied by default for modules. */ - defaultRules?: Array; + defaultRules?: Array; /** * Enable warnings for full dynamic dependencies. @@ -5299,7 +5235,7 @@ declare namespace internals { /** * An array of rules applied for modules. */ - rules?: Array; + rules?: Array; /** * Emit errors instead of warnings when imported names don't exist in imported module. @@ -5389,7 +5325,7 @@ declare namespace internals { /** * Merge this profile into another one */ - mergeInto(realProfile: internals.ModuleProfile): void; + mergeInto(realProfile: webpack.ModuleProfile): void; } export abstract class ModuleTemplate { type: string; @@ -5404,54 +5340,54 @@ declare namespace internals { } export class MultiCompiler { constructor( - compilers: Array | Record + compilers: Array | Record ); hooks: Readonly<{ - done: SyncHook<[internals.MultiStats], void>; + done: SyncHook<[webpack.MultiStats], void>; invalid: MultiHook>; - run: MultiHook>; + run: MultiHook>; watchClose: SyncHook<[], void>; - watchRun: MultiHook>; + watchRun: MultiHook>; infrastructureLog: MultiHook< SyncBailHook<[string, string, Array], true> >; }>; - compilers: Array; - dependencies: WeakMap>; + compilers: Array; + dependencies: WeakMap>; running: boolean; - readonly options: Array; + readonly options: Array; readonly outputPath: string; - inputFileSystem: internals.InputFileSystem; - outputFileSystem: internals.OutputFileSystem; - intermediateFileSystem: internals.InputFileSystem & - internals.OutputFileSystem & - internals.IntermediateFileSystemExtras; - getInfrastructureLogger(name?: any): internals.WebpackLogger; + inputFileSystem: webpack.InputFileSystem; + outputFileSystem: webpack.OutputFileSystem; + intermediateFileSystem: webpack.InputFileSystem & + webpack.OutputFileSystem & + webpack.IntermediateFileSystemExtras; + getInfrastructureLogger(name?: any): webpack.WebpackLogger; setDependencies( - compiler: internals.Compiler, + compiler: webpack.Compiler, dependencies: Array ): void; validateDependencies( - callback: internals.CallbackCompiler + callback: webpack.CallbackCompiler ): boolean; runWithDependencies( - compilers: Array, + compilers: Array, fn: ( - compiler: internals.Compiler, - callback: internals.CallbackCompiler + compiler: webpack.Compiler, + callback: webpack.CallbackCompiler ) => any, - callback: internals.CallbackCompiler + callback: webpack.CallbackCompiler ): void; watch( - watchOptions: internals.WatchOptions | Array, - handler: internals.CallbackCompiler - ): internals.MultiWatching; - run(callback: internals.CallbackCompiler): void; + watchOptions: webpack.WatchOptions | Array, + handler: webpack.CallbackCompiler + ): webpack.MultiWatching; + run(callback: webpack.CallbackCompiler): void; purgeInputFileSystem(): void; - close(callback: internals.CallbackCompiler): void; + close(callback: webpack.CallbackCompiler): void; } export abstract class MultiStats { - stats: Array; + stats: Array; hash: string; hasErrors(): boolean; hasWarnings(): boolean; @@ -5467,12 +5403,12 @@ declare namespace internals { toString(options?: any): string; } export abstract class MultiWatching { - watchings: Array; - compiler: internals.MultiCompiler; + watchings: Array; + compiler: webpack.MultiCompiler; invalidate(): void; suspend(): void; resume(): void; - close(callback: internals.CallbackCompiler): void; + close(callback: webpack.CallbackCompiler): void; } export class NamedChunkIdsPlugin { constructor(options?: any); @@ -5482,7 +5418,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class NamedModuleIdsPlugin { constructor(options?: any); @@ -5491,7 +5427,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class NaturalModuleIdsPlugin { constructor(); @@ -5499,10 +5435,10 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface NeedBuildContext { - fileSystemInfo: internals.FileSystemInfo; + fileSystemInfo: webpack.FileSystemInfo; } export class NoEmitOnErrorsPlugin { constructor(); @@ -5510,9 +5446,9 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export type Node = false | internals.NodeOptions; + export type Node = false | webpack.NodeOptions; export class NodeEnvironmentPlugin { constructor(options?: any); options: any; @@ -5520,7 +5456,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -5539,9 +5475,9 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export class NormalModule extends internals.Module { + export class NormalModule extends webpack.Module { constructor(__0: { /** * module type @@ -5562,7 +5498,7 @@ declare namespace internals { /** * list of loaders */ - loaders: Array; + loaders: Array; /** * path + query of the real resource */ @@ -5574,11 +5510,11 @@ declare namespace internals { /** * the parser used */ - parser: internals.Parser; + parser: webpack.Parser; /** * the generator used */ - generator: internals.Generator; + generator: webpack.Generator; /** * options used for resolving requests from this module */ @@ -5588,71 +5524,71 @@ declare namespace internals { userRequest: string; rawRequest: string; binary: boolean; - parser: internals.Parser; - generator: internals.Generator; + parser: webpack.Parser; + generator: webpack.Generator; resource: string; matchResource: string; - loaders: Array; - error: internals.WebpackError; + loaders: Array; + error: webpack.WebpackError; createSourceForAsset( context: string, name: string, content: string, sourceMap?: any, associatedObjectForCache?: any - ): internals.Source; + ): webpack.Source; createLoaderContext( - resolver: internals.Resolver & internals.WithOptions, - options: internals.WebpackOptionsNormalized, - compilation: internals.Compilation, - fs: internals.InputFileSystem + resolver: webpack.Resolver & webpack.WithOptions, + options: webpack.WebpackOptionsNormalized, + compilation: webpack.Compilation, + fs: webpack.InputFileSystem ): any; - getCurrentLoader(loaderContext?: any, index?: any): internals.LoaderItem; + getCurrentLoader(loaderContext?: any, index?: any): webpack.LoaderItem; createSource( context: string, content: string | Buffer, sourceMap?: any, associatedObjectForCache?: any - ): internals.Source; + ): webpack.Source; doBuild( - options: internals.WebpackOptionsNormalized, - compilation: internals.Compilation, - resolver: internals.Resolver & internals.WithOptions, - fs: internals.InputFileSystem, - callback: (arg0: internals.WebpackError) => void + options: webpack.WebpackOptionsNormalized, + compilation: webpack.Compilation, + resolver: webpack.Resolver & webpack.WithOptions, + fs: webpack.InputFileSystem, + callback: (arg0: webpack.WebpackError) => void ): void; - markModuleAsErrored(error: internals.WebpackError): void; + markModuleAsErrored(error: webpack.WebpackError): void; applyNoParseRule(rule?: any, content?: any): any; shouldPreventParsing(noParseRule?: any, request?: any): any; static getCompilationHooks( - compilation: internals.Compilation - ): internals.NormalModuleCompilationHooks; - static deserialize(context?: any): internals.NormalModule; + compilation: webpack.Compilation + ): webpack.NormalModuleCompilationHooks; + static deserialize(context?: any): webpack.NormalModule; } export interface NormalModuleCompilationHooks { - loader: SyncHook<[any, internals.NormalModule], void>; + loader: SyncHook<[any, webpack.NormalModule], void>; } - export abstract class NormalModuleFactory extends internals.ModuleFactory { + export abstract class NormalModuleFactory extends webpack.ModuleFactory { hooks: Readonly<{ - resolve: AsyncSeriesBailHook<[internals.ResolveData], any>; - factorize: AsyncSeriesBailHook<[internals.ResolveData], any>; - beforeResolve: AsyncSeriesBailHook<[internals.ResolveData], any>; - afterResolve: AsyncSeriesBailHook<[internals.ResolveData], any>; - createModule: SyncBailHook<[internals.ResolveData], any>; - module: SyncWaterfallHook<[internals.Module, any, internals.ResolveData]>; + resolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; + factorize: AsyncSeriesBailHook<[webpack.ResolveData], any>; + beforeResolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; + afterResolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; + createModule: SyncBailHook<[webpack.ResolveData], any>; + module: SyncWaterfallHook<[webpack.Module, any, webpack.ResolveData]>; createParser: HookMap>; parser: HookMap>; createGenerator: HookMap>; generator: HookMap>; }>; resolverFactory: any; - ruleSet: internals.RuleSet; + ruleSet: webpack.RuleSet; unsafeCache: boolean; cachePredicate: any; context: any; fs: any; parserCache: Map>; - generatorCache: Map>; + generatorCache: Map>; resolveRequestArray( contextInfo?: any, context?: any, @@ -5663,7 +5599,7 @@ declare namespace internals { ): any; getParser(type?: any, parserOptions?: {}): any; createParser(type?: any, parserOptions?: {}): any; - getGenerator(type?: any, generatorOptions?: {}): internals.Generator; + getGenerator(type?: any, generatorOptions?: {}): webpack.Generator; createGenerator(type?: any, generatorOptions?: {}): any; getResolver(type?: any, resolveOptions?: any): any; } @@ -5681,26 +5617,26 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface ObjectDeserializerContext { read: () => any; } export interface ObjectSerializer { - serialize: (arg0: any, arg1: internals.ObjectSerializerContext) => void; - deserialize: (arg0: internals.ObjectDeserializerContext) => any; + serialize: (arg0: any, arg1: webpack.ObjectSerializerContext) => void; + deserialize: (arg0: webpack.ObjectDeserializerContext) => any; } export interface ObjectSerializerContext { write: (arg0?: any) => void; } export class OccurrenceChunkIdsPlugin { - constructor(options?: internals.OccurrenceChunkIdsPluginOptions); - options: internals.OccurrenceChunkIdsPluginOptions; + constructor(options?: webpack.OccurrenceChunkIdsPluginOptions); + options: webpack.OccurrenceChunkIdsPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -5715,13 +5651,13 @@ declare namespace internals { prioritiseInitial?: boolean; } export class OccurrenceModuleIdsPlugin { - constructor(options?: internals.OccurrenceModuleIdsPluginOptions); - options: internals.OccurrenceModuleIdsPluginOptions; + constructor(options?: webpack.OccurrenceModuleIdsPluginOptions); + options: webpack.OccurrenceModuleIdsPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -5795,7 +5731,8 @@ declare namespace internals { * Minimizer(s) to use for minimizing the output. */ minimizer?: Array< - internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) + | webpack.WebpackPluginInstance >; /** @@ -5861,7 +5798,7 @@ declare namespace internals { /** * Optimize duplication and caching by splitting chunks by shared modules and cache group. */ - splitChunks?: false | internals.OptimizationSplitChunksOptions; + splitChunks?: false | webpack.OptimizationSplitChunksOptions; /** * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code. @@ -5896,11 +5833,11 @@ declare namespace internals { | "async" | "all" | (( - module: internals.Module + module: webpack.Module ) => | void - | internals.OptimizationSplitChunksCacheGroup - | Array); + | webpack.OptimizationSplitChunksCacheGroup + | Array); /** * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group. @@ -5912,10 +5849,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Sets the hint for chunk id. @@ -6006,7 +5940,7 @@ declare namespace internals { | false | Function | RegExp - | internals.OptimizationSplitChunksCacheGroup; + | webpack.OptimizationSplitChunksCacheGroup; }; /** @@ -6045,10 +5979,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Prevents exposing path info when creating names for parts splitted by maxSize. @@ -6116,15 +6047,12 @@ declare namespace internals { */ assetModuleFilename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Add a comment in the UMD wrapper. */ - auxiliaryComment?: string | internals.LibraryCustomUmdCommentObject; + auxiliaryComment?: string | webpack.LibraryCustomUmdCommentObject; /** * The callback function name used by webpack for loading of chunks in WebWorkers. @@ -6198,10 +6126,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * An expression which is used to address the global object/scope in runtime code. @@ -6221,7 +6146,7 @@ declare namespace internals { /** * Algorithm used for generation the hash (see node.js crypto package). */ - hashFunction?: string | typeof internals.Hash; + hashFunction?: string | typeof webpack.Hash; /** * Any string which is added to the hash to salt it. @@ -6264,8 +6189,8 @@ declare namespace internals { library?: | string | Array - | internals.LibraryCustomUmdObject - | internals.LibraryOptions; + | webpack.LibraryCustomUmdObject + | webpack.LibraryOptions; /** * Specify which export should be exposed as library. @@ -6313,10 +6238,7 @@ declare namespace internals { */ publicPath?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. @@ -6377,10 +6299,7 @@ declare namespace internals { */ assetModuleFilename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * The callback function name used by webpack for loading of chunks in WebWorkers. @@ -6454,10 +6373,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * An expression which is used to address the global object/scope in runtime code. @@ -6477,7 +6393,7 @@ declare namespace internals { /** * Algorithm used for generation the hash (see node.js crypto package). */ - hashFunction?: string | typeof internals.Hash; + hashFunction?: string | typeof webpack.Hash; /** * Any string which is added to the hash to salt it. @@ -6517,7 +6433,7 @@ declare namespace internals { /** * Options for library. */ - library?: internals.LibraryOptions; + library?: webpack.LibraryOptions; /** * Output javascript files as module source type. @@ -6539,10 +6455,7 @@ declare namespace internals { */ publicPath?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. @@ -6572,22 +6485,22 @@ declare namespace internals { export class Parser { constructor(); parse( - source: string | Buffer | Record, - state: Record & internals.ParserStateBase - ): Record & internals.ParserStateBase; + source: string | Record | Buffer, + state: Record & webpack.ParserStateBase + ): Record & webpack.ParserStateBase; } export interface ParserStateBase { - current: internals.NormalModule; - module: internals.NormalModule; - compilation: internals.Compilation; + current: webpack.NormalModule; + module: webpack.NormalModule; + compilation: webpack.Compilation; options: any; } export interface PathData { - chunkGraph?: internals.ChunkGraph; + chunkGraph?: webpack.ChunkGraph; hash?: string; hashWithLength?: (arg0: number) => string; - chunk?: internals.Chunk | internals.ChunkPathData; - module?: internals.Module | internals.ModulePathData; + chunk?: webpack.Chunk | webpack.ChunkPathData; + module?: webpack.Module | webpack.ModulePathData; filename?: string; basename?: string; query?: string; @@ -6597,7 +6510,7 @@ declare namespace internals { noChunkHash?: boolean; url?: string; } - export type Performance = false | internals.PerformanceOptions; + export type Performance = false | webpack.PerformanceOptions; /** * Configuration object for web performance recommendations. @@ -6634,7 +6547,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface PrintedElement { element: string; @@ -6664,10 +6577,10 @@ declare namespace internals { stopProfiling(): Promise; } export class ProfilingPlugin { - constructor(options?: internals.ProfilingPluginOptions); + constructor(options?: webpack.ProfilingPluginOptions); outputPath: string; apply(compiler?: any): void; - static Profiler: typeof internals.Profiler; + static Profiler: typeof webpack.Profiler; } /** @@ -6684,7 +6597,7 @@ declare namespace internals { export class ProgressPlugin { constructor( options: - | internals.ProgressPluginOptions + | webpack.ProgressPluginOptions | ((percentage: number, msg: string, ...args: Array) => void) ); profile: boolean; @@ -6695,11 +6608,11 @@ declare namespace internals { showModules: boolean; showDependencies: boolean; showActiveModules: boolean; - percentBy: "dependencies" | "modules" | "entries"; - apply(compiler: internals.Compiler | internals.MultiCompiler): void; + percentBy: "modules" | "dependencies" | "entries"; + apply(compiler: webpack.Compiler | webpack.MultiCompiler): void; static getReporter( - compiler: internals.Compiler - ): (p: number, args: Array) => void; + compiler: webpack.Compiler + ): (p: number, ...args: Array) => void; static defaultOptions: { profile: boolean; modulesCount: number; @@ -6711,7 +6624,7 @@ declare namespace internals { }; } export type ProgressPluginArgument = - | internals.ProgressPluginOptions + | webpack.ProgressPluginOptions | ((percentage: number, msg: string, ...args: Array) => void); /** @@ -6756,7 +6669,7 @@ declare namespace internals { /** * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent. */ - percentBy?: "dependencies" | "modules" | "entries"; + percentBy?: "modules" | "dependencies" | "entries"; /** * Collect profile data for progress steps. Default: false. @@ -6770,14 +6683,11 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type PublicPath = | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); export interface RawChunkGroupOptions { preloadOrder?: number; prefetchOrder?: number; @@ -6789,11 +6699,11 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface RealDependencyLocation { - start: internals.SourcePosition; - end?: internals.SourcePosition; + start: webpack.SourcePosition; + end?: webpack.SourcePosition; index?: number; } export type RecursiveArrayOrRecord = @@ -6803,7 +6713,7 @@ declare namespace internals { | boolean | Function | RegExp - | internals.RuntimeValue + | webpack.RuntimeValue | { [index: string]: RecursiveArrayOrRecordDeclarations } | Array; type RecursiveArrayOrRecordDeclarations = @@ -6813,29 +6723,29 @@ declare namespace internals { | boolean | Function | RegExp - | internals.RuntimeValue + | webpack.RuntimeValue | { [index: string]: RecursiveArrayOrRecordDeclarations } | Array; export interface RenderBootstrapContext { /** * the chunk */ - chunk: internals.Chunk; + chunk: webpack.Chunk; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * hash to be used for render call @@ -6871,77 +6781,71 @@ declare namespace internals { /** * results of code generation */ - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; + codeGenerationResults: Map; } export interface RenderContextJavascriptModulesPlugin { /** * the chunk */ - chunk: internals.Chunk; + chunk: webpack.Chunk; /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * results of code generation */ - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; + codeGenerationResults: Map; } export interface RenderContextModuleTemplate { /** * the chunk */ - chunk: internals.Chunk; + chunk: webpack.Chunk; /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; } export interface RenderManifestEntry { - render: () => internals.Source; + render: () => webpack.Source; filenameTemplate: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); - pathOptions?: internals.PathData; + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); + pathOptions?: webpack.PathData; identifier: string; hash?: string; auxiliary?: boolean; @@ -6950,21 +6854,18 @@ declare namespace internals { /** * the chunk used to render */ - chunk: internals.Chunk; + chunk: webpack.Chunk; hash: string; fullHash: string; outputOptions: any; - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; - moduleTemplates: { javascript: internals.ModuleTemplate }; - dependencyTemplates: internals.DependencyTemplates; - runtimeTemplate: internals.RuntimeTemplate; - moduleGraph: internals.ModuleGraph; - chunkGraph: internals.ChunkGraph; + codeGenerationResults: Map; + moduleTemplates: { javascript: webpack.ModuleTemplate }; + dependencyTemplates: webpack.DependencyTemplates; + runtimeTemplate: webpack.RuntimeTemplate; + moduleGraph: webpack.ModuleGraph; + chunkGraph: webpack.ChunkGraph; } - export abstract class ReplaceSource extends internals.Source { + export abstract class ReplaceSource extends webpack.Source { replace(start: number, end: number, newValue: string, name: string): void; insert(pos: number, newValue: string, name: string): void; getName(): string; @@ -7026,21 +6927,21 @@ declare namespace internals { } export interface ResolveContext { log?: (message: string) => void; - fileDependencies?: internals.WriteOnlySet; - contextDependencies?: internals.WriteOnlySet; - missingDependencies?: internals.WriteOnlySet; + fileDependencies?: webpack.WriteOnlySet; + contextDependencies?: webpack.WriteOnlySet; + missingDependencies?: webpack.WriteOnlySet; stack?: Set; } export interface ResolveData { - contextInfo: internals.ModuleFactoryCreateDataContextInfo; + contextInfo: webpack.ModuleFactoryCreateDataContextInfo; resolveOptions: any; context: string; request: string; - dependencies: Array; + dependencies: Array; createData: any; - fileDependencies: internals.LazySet; - missingDependencies: internals.LazySet; - contextDependencies: internals.LazySet; + fileDependencies: webpack.LazySet; + missingDependencies: webpack.LazySet; + contextDependencies: webpack.LazySet; } /** @@ -7125,7 +7026,7 @@ declare namespace internals { /** * Plugins for the resolver. */ - plugins?: Array; + plugins?: Array; /** * Custom resolver. @@ -7164,7 +7065,7 @@ declare namespace internals { context: Object, path: string, request: string, - resolveContext: internals.ResolveContext, + resolveContext: webpack.ResolveContext, callback: ( err: NodeJS.ErrnoException, result: string, @@ -7173,19 +7074,19 @@ declare namespace internals { ): void; } export interface ResolverCache { - direct: WeakMap; - stringified: Map; + direct: WeakMap; + stringified: Map; } export abstract class ResolverFactory { hooks: Readonly<{ resolveOptions: HookMap>; - resolver: HookMap>; + resolver: HookMap>; }>; - cache: Map; + cache: Map; get( type: string, resolveOptions?: any - ): internals.Resolver & internals.WithOptions; + ): webpack.Resolver & webpack.WithOptions; } export interface RuleSet { /** @@ -7196,7 +7097,7 @@ declare namespace internals { /** * execute the rule set */ - exec: (arg0?: any) => Array; + exec: (arg0?: any) => Array; } export type RuleSetCondition = | string @@ -7354,7 +7255,7 @@ declare namespace internals { /** * Only execute the first matching rule in this array. */ - oneOf?: Array; + oneOf?: Array; /** * Shortcut for use.options. @@ -7374,7 +7275,7 @@ declare namespace internals { /** * Options for the resolver. */ - resolve?: internals.ResolveOptions; + resolve?: webpack.ResolveOptions; /** * Match the resource path of the module. @@ -7389,7 +7290,7 @@ declare namespace internals { /** * Match and execute these rules when this rule is matched. */ - rules?: Array; + rules?: Array; /** * Flags a module as with or without side effects. @@ -7446,7 +7347,13 @@ declare namespace internals { | __TypeWebpackOptions | Array) > - | ((data: {}) => Array) + | ((data: { + resource: string; + realResource: string; + resourceQuery: string; + issuer: string; + compiler: string; + }) => Array) | { /** * Unique loader options identifier. @@ -7500,7 +7407,13 @@ declare namespace internals { | __TypeWebpackOptions | Array) > - | ((data: {}) => Array) + | ((data: { + resource: string; + realResource: string; + resourceQuery: string; + issuer: string; + compiler: string; + }) => Array) | { /** * Unique loader options identifier. @@ -7579,7 +7492,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export namespace RuntimeGlobals { export let require: string; @@ -7631,19 +7544,19 @@ declare namespace internals { export let hasOwnProperty: string; export let systemContext: string; } - export class RuntimeModule extends internals.Module { + export class RuntimeModule extends webpack.Module { constructor(name: string, stage?: number); name: string; stage: number; - compilation: internals.Compilation; - chunk: internals.Chunk; - attach(compilation: internals.Compilation, chunk: internals.Chunk): void; + compilation: webpack.Compilation; + chunk: webpack.Chunk; + attach(compilation: webpack.Compilation, chunk: webpack.Chunk): void; generate(): string; getGeneratedCode(): string; } export abstract class RuntimeTemplate { - outputOptions: internals.Output; - requestShortener: internals.RequestShortener; + outputOptions: webpack.Output; + requestShortener: webpack.RequestShortener; isIIFE(): boolean; supportsConst(): boolean; supportsArrowFunction(): boolean; @@ -7712,11 +7625,11 @@ declare namespace internals { /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the request that should be printed as comment */ @@ -7734,11 +7647,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7752,11 +7665,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7774,11 +7687,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7796,11 +7709,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7822,15 +7735,15 @@ declare namespace internals { /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the current dependencies block */ - block?: internals.AsyncDependenciesBlock; + block?: webpack.AsyncDependenciesBlock; /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the request that should be printed as comment */ @@ -7860,11 +7773,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7876,7 +7789,7 @@ declare namespace internals { /** * module in which the statement is emitted */ - originModule: internals.Module; + originModule: webpack.Module; /** * true, if this is a weak dependency */ @@ -7890,11 +7803,11 @@ declare namespace internals { /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the request */ @@ -7906,7 +7819,7 @@ declare namespace internals { /** * the origin module */ - originModule: internals.Module; + originModule: webpack.Module; /** * true, if location is safe for ASI, a bracket can be emitted */ @@ -7930,7 +7843,7 @@ declare namespace internals { /** * init fragments will be added here */ - initFragments: Array; + initFragments: Array; /** * if set, will be filled with runtime requirements */ @@ -7940,7 +7853,7 @@ declare namespace internals { /** * the async block */ - block: internals.AsyncDependenciesBlock; + block: webpack.AsyncDependenciesBlock; /** * the message */ @@ -7948,7 +7861,7 @@ declare namespace internals { /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * if set, will be filled with runtime requirements */ @@ -7972,9 +7885,9 @@ declare namespace internals { } export const SKIP_OVER_NAME: unique symbol; export interface ScopeInfo { - definitions: internals.StackedMap< + definitions: webpack.StackedMap< string, - internals.ScopeInfo | internals.VariableInfo + webpack.ScopeInfo | webpack.VariableInfo >; topLevelScope: boolean | "arrow"; inShorthand: boolean; @@ -7995,7 +7908,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static moduleHasSideEffects( moduleName?: any, flagValue?: any, @@ -8008,13 +7921,13 @@ declare namespace internals { */ export interface Snapshot { startTime?: number; - fileTimestamps?: Map; + fileTimestamps?: Map; fileHashes?: Map; - contextTimestamps?: Map; + contextTimestamps?: Map; contextHashes?: Map; missingExistence?: Map; managedItemInfo?: Map; - children?: Set; + children?: Set; } export abstract class SortableSet extends Set { /** @@ -8026,21 +7939,27 @@ declare namespace internals { /** * Get data from cache */ - getFromCache(fn: (arg0: internals.SortableSet) => R): R; + getFromCache(fn: (arg0: webpack.SortableSet) => R): R; /** * Get data from cache (ignoring sorting) */ - getFromUnorderedCache(fn: (arg0: internals.SortableSet) => R): R; + getFromUnorderedCache(fn: (arg0: webpack.SortableSet) => R): R; toJSON(): Array; + + /** + * Iterates over values in the set. + */ + [Symbol.iterator](): IterableIterator; + readonly [Symbol.toStringTag]: string; } export abstract class Source { size(): number; - map(options: internals.MapOptions): Object; + map(options: webpack.MapOptions): Object; sourceAndMap( - options: internals.MapOptions + options: webpack.MapOptions ): { source: string | Buffer; map: Object }; - updateHash(hash: internals.Hash): void; + updateHash(hash: webpack.Hash): void; source(): string | Buffer; buffer(): Buffer; } @@ -8048,22 +7967,22 @@ declare namespace internals { /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the type of source that should be generated @@ -8071,18 +7990,18 @@ declare namespace internals { type?: string; } export class SourceMapDevToolPlugin { - constructor(options?: internals.SourceMapDevToolPluginOptions); + constructor(options?: webpack.SourceMapDevToolPluginOptions); sourceMapFilename: string | false; sourceMappingURLComment: string | false; moduleFilenameTemplate: string | Function; fallbackModuleFilenameTemplate: string | Function; namespace: string; - options: internals.SourceMapDevToolPluginOptions; + options: webpack.SourceMapDevToolPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface SourceMapDevToolPluginOptions { /** @@ -8160,7 +8079,7 @@ declare namespace internals { column?: number; } export interface SplitChunksOptions { - chunksFilter: (chunk: internals.Chunk) => boolean; + chunksFilter: (chunk: webpack.Chunk) => boolean; minSize: Record; minRemainingSize: Record; maxInitialSize: Record; @@ -8171,35 +8090,32 @@ declare namespace internals { hidePathInfo: boolean; filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); automaticNameDelimiter: string; getCacheGroups: ( - module: internals.Module, - context: internals.CacheGroupsContext - ) => Array; + module: webpack.Module, + context: webpack.CacheGroupsContext + ) => Array; getName: ( - module?: internals.Module, - chunks?: Array, + module?: webpack.Module, + chunks?: Array, key?: string ) => string; - fallbackCacheGroup: internals.FallbackCacheGroup; + fallbackCacheGroup: webpack.FallbackCacheGroup; } export class SplitChunksPlugin { - constructor(options?: internals.OptimizationSplitChunksOptions); - options: internals.SplitChunksOptions; + constructor(options?: webpack.OptimizationSplitChunksOptions); + options: webpack.SplitChunksOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export abstract class StackedMap { - map: Map< - K, - V | typeof internals.TOMBSTONE | typeof internals.UNDEFINED_MARKER - >; + map: Map; stack: Array< - Map + Map >; set(item: K, value: V): void; delete(item: K): void; @@ -8210,7 +8126,7 @@ declare namespace internals { asPairArray(): Array<[K, V]>; asMap(): Map; readonly size: number; - createChild(): internals.StackedMap; + createChild(): webpack.StackedMap; } export type Statement = | ExpressionStatement @@ -8235,8 +8151,8 @@ declare namespace internals { | VariableDeclaration | ClassDeclaration; export class Stats { - constructor(compilation: internals.Compilation); - compilation: internals.Compilation; + constructor(compilation: webpack.Compilation); + compilation: webpack.Compilation; hash: string; startTime: any; endTime: any; @@ -8578,7 +8494,7 @@ declare namespace internals { hooks: Readonly<{ sortElements: HookMap, any], any>>; printElements: HookMap< - SyncBailHook<[Array, any], any> + SyncBailHook<[Array, any], any> >; sortItems: HookMap, any], any>>; getItemName: HookMap>; @@ -8597,7 +8513,7 @@ declare namespace internals { | "detailed" | "verbose" | "errors-warnings" - | internals.StatsOptions; + | webpack.StatsOptions; export interface SyntheticDependencyLocation { name: string; index?: number; @@ -8606,7 +8522,7 @@ declare namespace internals { export interface TagInfo { tag: any; data: any; - next: internals.TagInfo; + next: webpack.TagInfo; } export type Target = | "web" @@ -8617,7 +8533,7 @@ declare namespace internals { | "electron-main" | "electron-renderer" | "electron-preload" - | ((compiler: internals.Compiler) => void); + | ((compiler: webpack.Compiler) => void); export class Template { constructor(); static getFunctionContent(fn: Function): string; @@ -8631,22 +8547,22 @@ declare namespace internals { static prefix(s: string | Array, prefix: string): string; static asString(str: string | Array): string; static getModulesArrayBounds( - modules: Array + modules: Array ): false | [number, number]; static renderChunkModules( - renderContext: internals.RenderContextModuleTemplate, - modules: Array, - renderModule: (arg0: internals.Module) => internals.Source, + renderContext: webpack.RenderContextModuleTemplate, + modules: Array, + renderModule: (arg0: webpack.Module) => webpack.Source, prefix?: string - ): internals.Source; + ): webpack.Source; static renderRuntimeModules( - runtimeModules: Array, - renderContext: internals.RenderContextModuleTemplate - ): internals.Source; + runtimeModules: Array, + renderContext: webpack.RenderContextModuleTemplate + ): webpack.Source; static renderChunkRuntimeModules( - runtimeModules: Array, - renderContext: internals.RenderContextModuleTemplate - ): internals.Source; + runtimeModules: Array, + renderContext: webpack.RenderContextModuleTemplate + ): webpack.Source; static NUMBER_OF_IDENTIFIER_START_CHARS: number; static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number; } @@ -8655,26 +8571,26 @@ declare namespace internals { /** * the module */ - module: internals.NormalModule; + module: webpack.NormalModule; /** * the compilation */ - compilation: internals.Compilation; + compilation: webpack.Compilation; } export abstract class VariableInfo { - declaredScope: internals.ScopeInfo; + declaredScope: webpack.ScopeInfo; freeName: string | true; - tagInfo: internals.TagInfo; + tagInfo: webpack.TagInfo; } export class WatchIgnorePlugin { - constructor(options: internals.WatchIgnorePluginOptions); + constructor(options: webpack.WatchIgnorePluginOptions); paths: [string | RegExp, string | RegExp]; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -8716,8 +8632,8 @@ declare namespace internals { export abstract class Watching { startTime: number; invalid: boolean; - handler: internals.CallbackCompiler; - callbacks: Array>; + handler: webpack.CallbackCompiler; + callbacks: Array>; closed: boolean; suspended: boolean; watchOptions: { @@ -8738,7 +8654,7 @@ declare namespace internals { */ stdin?: boolean; }; - compiler: internals.Compiler; + compiler: webpack.Compiler; running: boolean; watcher: any; pausedWatcher: any; @@ -8747,10 +8663,10 @@ declare namespace internals { dirs: Iterable, missing: Iterable ): void; - invalidate(callback: internals.CallbackCompiler): void; + invalidate(callback?: webpack.CallbackCompiler): void; suspend(): void; resume(): void; - close(callback: internals.CallbackCompiler): void; + close(callback: webpack.CallbackCompiler): void; } export class WebWorkerTemplatePlugin { constructor(); @@ -8758,22 +8674,20 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface WebpackError extends Error { details: any; - module: internals.Module; - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation; + module: webpack.Module; + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; hideStack: boolean; - chunk: internals.Chunk; + chunk: webpack.Chunk; file: string; serialize(__0: { write: any }): void; deserialize(__0: { read: any }): void; } export abstract class WebpackLogger { - getChildLogger: (arg0: string | (() => string)) => internals.WebpackLogger; + getChildLogger: (arg0: string | (() => string)) => webpack.WebpackLogger; error(...args: Array): void; warn(...args: Array): void; info(...args: Array): void; @@ -8812,7 +8726,7 @@ declare namespace internals { /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ - cache?: boolean | internals.MemoryCacheOptions | internals.FileCacheOptions; + cache?: boolean | webpack.MemoryCacheOptions | webpack.FileCacheOptions; /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. @@ -8827,7 +8741,7 @@ declare namespace internals { /** * Options for the webpack-dev-server. */ - devServer?: internals.DevServer; + devServer?: webpack.DevServer; /** * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). @@ -8841,16 +8755,16 @@ declare namespace internals { | string | (() => | string - | internals.EntryObject + | webpack.EntryObject | [string, string] - | Promise) - | internals.EntryObject + | Promise) + | webpack.EntryObject | [string, string]; /** * Enables/Disables experiments (experimental features with relax SemVer compatibility). */ - experiments?: internals.Experiments; + experiments?: webpack.Experiments; /** * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. @@ -8911,12 +8825,12 @@ declare namespace internals { /** * Options for infrastructure level logging. */ - infrastructureLogging?: internals.InfrastructureLogging; + infrastructureLogging?: webpack.InfrastructureLogging; /** * Custom values available in the loader context. */ - loader?: internals.Loader; + loader?: webpack.Loader; /** * Enable production optimizations or development hints. @@ -8926,7 +8840,7 @@ declare namespace internals { /** * Options affecting the normal modules (`NormalModuleFactory`). */ - module?: internals.ModuleOptions; + module?: webpack.ModuleOptions; /** * Name of the configuration. Used when loading multiple configurations. @@ -8936,17 +8850,17 @@ declare namespace internals { /** * Include polyfills or mocks for various node stuff. */ - node?: false | internals.NodeOptions; + node?: false | webpack.NodeOptions; /** * Enables/Disables integrated optimizations. */ - optimization?: internals.Optimization; + optimization?: webpack.Optimization; /** * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. */ - output?: internals.Output; + output?: webpack.Output; /** * The number of parallel processed modules in the compilation. @@ -8956,13 +8870,14 @@ declare namespace internals { /** * Configuration for web performance recommendations. */ - performance?: false | internals.PerformanceOptions; + performance?: false | webpack.PerformanceOptions; /** * Add additional plugins to the compiler. */ plugins?: Array< - internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) + | webpack.WebpackPluginInstance >; /** @@ -8988,12 +8903,12 @@ declare namespace internals { /** * Options for the resolver. */ - resolve?: internals.ResolveOptions; + resolve?: webpack.ResolveOptions; /** * Options for the resolver when resolving loaders. */ - resolveLoader?: internals.ResolveOptions; + resolveLoader?: webpack.ResolveOptions; /** * Stats options object or preset name. @@ -9007,7 +8922,7 @@ declare namespace internals { | "detailed" | "verbose" | "errors-warnings" - | internals.StatsOptions; + | webpack.StatsOptions; /** * Environment to build for. @@ -9021,7 +8936,7 @@ declare namespace internals { | "electron-main" | "electron-renderer" | "electron-preload" - | ((compiler: internals.Compiler) => void); + | ((compiler: webpack.Compiler) => void); /** * Enter watch mode, which rebuilds on file change. @@ -9031,9 +8946,9 @@ declare namespace internals { /** * Options for the watcher. */ - watchOptions?: internals.WatchOptions; + watchOptions?: webpack.WatchOptions; } - export class WebpackOptionsApply extends internals.OptionsApply { + export class WebpackOptionsApply extends webpack.OptionsApply { constructor(); } export class WebpackOptionsDefaulter { @@ -9058,7 +8973,7 @@ declare namespace internals { /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ - cache: false | internals.MemoryCacheOptions | internals.FileCacheOptions; + cache: false | webpack.MemoryCacheOptions | webpack.FileCacheOptions; /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. @@ -9073,7 +8988,7 @@ declare namespace internals { /** * Options for the webpack-dev-server. */ - devServer?: internals.DevServer; + devServer?: webpack.DevServer; /** * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). @@ -9084,13 +8999,13 @@ declare namespace internals { * The entry point(s) of the compilation. */ entry: - | (() => Promise) - | internals.EntryStaticNormalized; + | (() => Promise) + | webpack.EntryStaticNormalized; /** * Enables/Disables experiments (experimental features with relax SemVer compatibility). */ - experiments: internals.Experiments; + experiments: webpack.Experiments; /** * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. @@ -9151,12 +9066,12 @@ declare namespace internals { /** * Options for infrastructure level logging. */ - infrastructureLogging: internals.InfrastructureLogging; + infrastructureLogging: webpack.InfrastructureLogging; /** * Custom values available in the loader context. */ - loader?: internals.Loader; + loader?: webpack.Loader; /** * Enable production optimizations or development hints. @@ -9166,7 +9081,7 @@ declare namespace internals { /** * Options affecting the normal modules (`NormalModuleFactory`). */ - module: internals.ModuleOptions; + module: webpack.ModuleOptions; /** * Name of the configuration. Used when loading multiple configurations. @@ -9176,17 +9091,17 @@ declare namespace internals { /** * Include polyfills or mocks for various node stuff. */ - node: false | internals.NodeOptions; + node: false | webpack.NodeOptions; /** * Enables/Disables integrated optimizations. */ - optimization: internals.Optimization; + optimization: webpack.Optimization; /** * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. */ - output: internals.OutputNormalized; + output: webpack.OutputNormalized; /** * The number of parallel processed modules in the compilation. @@ -9196,13 +9111,14 @@ declare namespace internals { /** * Configuration for web performance recommendations. */ - performance?: false | internals.PerformanceOptions; + performance?: false | webpack.PerformanceOptions; /** * Add additional plugins to the compiler. */ plugins: Array< - internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) + | webpack.WebpackPluginInstance >; /** @@ -9223,12 +9139,12 @@ declare namespace internals { /** * Options for the resolver. */ - resolve: internals.ResolveOptions; + resolve: webpack.ResolveOptions; /** * Options for the resolver when resolving loaders. */ - resolveLoader: internals.ResolveOptions; + resolveLoader: webpack.ResolveOptions; /** * Stats options object or preset name. @@ -9242,7 +9158,7 @@ declare namespace internals { | "detailed" | "verbose" | "errors-warnings" - | internals.StatsOptions; + | webpack.StatsOptions; /** * Environment to build for. @@ -9256,7 +9172,7 @@ declare namespace internals { | "electron-main" | "electron-renderer" | "electron-preload" - | ((compiler: internals.Compiler) => void); + | ((compiler: webpack.Compiler) => void); /** * Enter watch mode, which rebuilds on file change. @@ -9266,7 +9182,7 @@ declare namespace internals { /** * Options for the watcher. */ - watchOptions: internals.WatchOptions; + watchOptions: webpack.WatchOptions; } /** @@ -9278,7 +9194,7 @@ declare namespace internals { /** * The run point of the plugin, required method. */ - apply: (compiler: internals.Compiler) => void; + apply: (compiler: webpack.Compiler) => void; } export interface WithId { id: string | number; @@ -9287,29 +9203,28 @@ declare namespace internals { /** * create a resolver with additional/different options */ - withOptions: (arg0?: any) => internals.Resolver & internals.WithOptions; + withOptions: (arg0?: any) => webpack.Resolver & webpack.WithOptions; } export interface WriteOnlySet { add(item: T): void; } export namespace __TypeLibIndex { - export let webpack: ( - options: internals.WebpackOptions | Array, - callback: internals.CallbackWebpack< - internals.Stats | internals.MultiStats - > - ) => internals.Compiler | internals.MultiCompiler; - export let validate: any; - export let validateSchema: (schema?: any, options?: any) => void; - export let version: any; + export const webpack: ( + options: webpack.WebpackOptions | Array, + callback?: webpack.CallbackWebpack + ) => webpack.Compiler | webpack.MultiCompiler; + export const validate: any; + export const validateSchema: (schema?: any, options?: any) => void; + export const version: any; export const WebpackOptionsValidationError: ValidationError; export const ValidationError: ValidationError; export { - WebpackOptionsApply, cli, AutomaticPrefetchPlugin, BannerPlugin, Cache, + Chunk, + ChunkGraph, Compilation, Compiler, ContextExclusionPlugin, @@ -9323,6 +9238,7 @@ declare namespace internals { EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, + ExternalModule, ExternalsPlugin, Generator, HotModuleReplacementPlugin, @@ -9334,6 +9250,7 @@ declare namespace internals { LoaderTargetPlugin, Module, ModuleFilenameHelpers, + ModuleGraph, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, @@ -9349,6 +9266,7 @@ declare namespace internals { Stats, Template, WatchIgnorePlugin, + WebpackOptionsApply, WebpackOptionsDefaulter, __TypeLiteral_12 as cache, __TypeLiteral_1 as config, @@ -9366,10 +9284,10 @@ declare namespace internals { } export namespace __TypeLiteral_1 { export const getNormalizedWebpackOptions: ( - config: internals.WebpackOptions - ) => internals.WebpackOptionsNormalized; + config: webpack.WebpackOptions + ) => webpack.WebpackOptionsNormalized; export const applyWebpackOptionsDefaults: ( - options: internals.WebpackOptionsNormalized + options: webpack.WebpackOptionsNormalized ) => void; } export namespace __TypeLiteral_10 { @@ -9377,8 +9295,8 @@ declare namespace internals { } export namespace __TypeLiteral_11 { export const createHash: ( - algorithm: string | typeof internals.Hash - ) => internals.Hash; + algorithm: string | typeof webpack.Hash + ) => webpack.Hash; export { comparators, serialization }; } export namespace __TypeLiteral_12 { @@ -9449,11 +9367,9 @@ declare namespace internals { | __TypeWebpackOptions | Array; export namespace cli { - export let getArguments: ( - schema?: any - ) => Record; + export let getArguments: (schema?: any) => Record; export let processArguments: ( - args: Record, + args: Record, config: any, values: Record< string, @@ -9463,41 +9379,41 @@ declare namespace internals { | RegExp | Array > - ) => Array; + ) => Array; } export namespace comparators { export let compareChunksById: ( - a: internals.Chunk, - b: internals.Chunk + a: webpack.Chunk, + b: webpack.Chunk ) => 0 | 1 | -1; export let compareModulesByIdentifier: ( - a: internals.Module, - b: internals.Module + a: webpack.Module, + b: webpack.Module ) => 0 | 1 | -1; export let compareModulesById: ( - arg0: internals.ChunkGraph - ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + arg0: webpack.ChunkGraph + ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; export let compareNumbers: (a: number, b: number) => 0 | 1 | -1; export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1; export let compareModulesByPostOrderIndexOrIdentifier: ( - arg0: internals.ModuleGraph - ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + arg0: webpack.ModuleGraph + ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; export let compareModulesByPreOrderIndexOrIdentifier: ( - arg0: internals.ModuleGraph - ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + arg0: webpack.ModuleGraph + ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; export let compareModulesByIdOrIdentifier: ( - arg0: internals.ChunkGraph - ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + arg0: webpack.ChunkGraph + ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; export let compareChunks: ( - arg0: internals.ChunkGraph - ) => (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1; + arg0: webpack.ChunkGraph + ) => (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1; export let compareIds: ( a: string | number, b: string | number ) => 0 | 1 | -1; export let compareChunkGroupsByIndex: ( - a: internals.ChunkGroup, - b: internals.ChunkGroup + a: webpack.ChunkGroup, + b: webpack.ChunkGroup ) => 0 | 1 | -1; export let concatComparators: ( c1: (arg0: T, arg1: T) => 0 | 1 | -1, @@ -9515,39 +9431,39 @@ declare namespace internals { iterable: Iterable ) => (arg0: T, arg1: T) => 0 | 1 | -1; export let compareChunksNatural: ( - chunkGraph: internals.ChunkGraph - ) => (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1; + chunkGraph: webpack.ChunkGraph + ) => (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1; export let compareLocations: ( - a: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation, - b: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation + a: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, + b: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation ) => 0 | 1 | -1; } export function exports( - options: internals.WebpackOptions | Array, - callback: internals.CallbackWebpack - ): internals.Compiler | internals.MultiCompiler; + options: webpack.WebpackOptions | Array, + callback?: webpack.CallbackWebpack + ): webpack.Compiler | webpack.MultiCompiler; export namespace exports { - export let webpack: ( - options: internals.WebpackOptions | Array, - callback: internals.CallbackWebpack< - internals.Stats | internals.MultiStats - > - ) => internals.Compiler | internals.MultiCompiler; - export let validate: any; - export let validateSchema: (schema?: any, options?: any) => void; - export let version: any; + export const webpack: ( + options: webpack.WebpackOptions | Array, + callback?: webpack.CallbackWebpack + ) => webpack.Compiler | webpack.MultiCompiler; + export const validate: any; + export const validateSchema: (schema?: any, options?: any) => void; + export const version: any; export const WebpackOptionsValidationError: ValidationError; export const ValidationError: ValidationError; + export type WebpackPluginFunction = ( + this: webpack.Compiler, + compiler: webpack.Compiler + ) => void; + export type ParserState = Record & webpack.ParserStateBase; export { - WebpackOptionsApply, cli, AutomaticPrefetchPlugin, BannerPlugin, Cache, + Chunk, + ChunkGraph, Compilation, Compiler, ContextExclusionPlugin, @@ -9561,6 +9477,7 @@ declare namespace internals { EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, + ExternalModule, ExternalsPlugin, Generator, HotModuleReplacementPlugin, @@ -9572,6 +9489,7 @@ declare namespace internals { LoaderTargetPlugin, Module, ModuleFilenameHelpers, + ModuleGraph, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, @@ -9587,6 +9505,7 @@ declare namespace internals { Stats, Template, WatchIgnorePlugin, + WebpackOptionsApply, WebpackOptionsDefaulter, __TypeLiteral_12 as cache, __TypeLiteral_1 as config, @@ -9600,7 +9519,8 @@ declare namespace internals { __TypeLiteral_9 as library, __TypeLiteral_10 as debug, __TypeLiteral_11 as util, - WebpackOptions as Configuration + WebpackOptions as Configuration, + WebpackPluginInstance }; } export namespace serialization { @@ -9608,7 +9528,7 @@ declare namespace internals { Constructor: { new (...params: Array): any }, request: string, name: string, - serializer: internals.ObjectSerializer + serializer: webpack.ObjectSerializer ) => void; export let registerLoader: ( regExp: RegExp, @@ -9618,10 +9538,10 @@ declare namespace internals { new (...params: Array): any; }) => void; export let NOT_SERIALIZABLE: {}; - export let buffersSerializer: internals.Serializer; - export let createFileSerializer: (fs?: any) => internals.Serializer; + export let buffersSerializer: webpack.Serializer; + export let createFileSerializer: (fs?: any) => webpack.Serializer; export { MEASURE_START_OPERATION, MEASURE_END_OPERATION }; } } -export = internals.exports; +export = webpack.exports; diff --git a/yarn.lock b/yarn.lock index 2103623af..d633df1be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6765,9 +6765,9 @@ toml@^3.0.0: resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== -tooling@webpack/tooling: +tooling@webpack/tooling#v1.0.0: version "1.0.0" - resolved "https://codeload.github.com/webpack/tooling/tar.gz/c960d3590c197b9a68a17c5f0ca4896623c6c0d6" + resolved "https://codeload.github.com/webpack/tooling/tar.gz/275ad8a94cca2040934655c07ea70bcb6d92c7b9" dependencies: "@yarnpkg/lockfile" "^1.1.0" commondir "^1.0.1" From 51e33706f9567f034f2e32391ccdc51733b41f91 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 20 Apr 2020 09:11:47 +0200 Subject: [PATCH 23/30] fix azure pipeline for updated linting step --- azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5151e2bc9..959d37413 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -85,9 +85,11 @@ jobs: set -e export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" yarn -s run code-lint --format junit > junit.xml - yarn jest-lint - yarn type-lint yarn special-lint + yarn type-lint + yarn typings-lint + yarn pretty-lint + yarn spellcheck displayName: "Run linting" - task: PublishTestResults@2 inputs: From cbb6ee68093f61076adf057b732e08234e207168 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 20 Apr 2020 09:23:10 +0200 Subject: [PATCH 24/30] test more test cases for typings and fix typing bug --- declarations/WebpackOptions.d.ts | 20 +++++++++---------- lib/optimize/SplitChunksPlugin.js | 4 ++-- schemas/WebpackOptions.json | 3 ++- .../include-chunk-id/webpack.config.js | 1 + .../xxhash/webpack.config.js | 1 + .../json-custom/webpack.config.js | 1 + .../externals-array/webpack.config.js | 1 + .../webpack.config.js | 1 + .../hashed-module-ids/webpack.config.js | 1 + .../output-filename/webpack.config.js | 1 + .../issues/issue-7470/webpack.config.js | 1 + .../issues/issue-7563/webpack.config.js | 1 + .../0-create-library/webpack.config.js | 1 + .../library/1-use-library/webpack.config.js | 1 + .../loaders/hot-in-context/webpack.config.js | 1 + .../parsing/system.import/webpack.config.js | 1 + .../environment-plugin/webpack.config.js | 1 + .../webpack.config.js | 1 + .../simple/multi-compiler/webpack.config.js | 1 + .../target-node/webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../webpack.config.js | 1 + .../context-independence/webpack.config.js | 1 + .../define-plugin/webpack.config.js | 1 + .../filter-warnings/webpack.config.js | 1 + test/statsCases/issue-7577/webpack.config.js | 1 + .../webpack.config.js | 1 + .../named-chunk-groups/webpack.config.js | 1 + .../webpack.config.js | 1 + .../preset-mixed-array/webpack.config.js | 1 + .../preset-none-array/webpack.config.js | 1 + .../webpack.config.js | 1 + .../scope-hoisting-multi/webpack.config.js | 1 + .../split-chunks-max-size/webpack.config.js | 1 + .../statsCases/split-chunks/webpack.config.js | 1 + .../simple/multi-compiler/webpack.config.js | 1 + types.d.ts | 11 +--------- 38 files changed, 49 insertions(+), 23 deletions(-) diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 146fcdc8e..91b72c8d8 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -301,15 +301,6 @@ export type OptimizationRuntimeChunk = */ name?: string | Function; }; -/** - * A function returning cache groups. - */ -export type OptimizationSplitChunksGetCacheGroups = ( - module: import("../lib/Module") -) => - | OptimizationSplitChunksCacheGroup - | OptimizationSplitChunksCacheGroup[] - | void; /** * Size description for limits. */ @@ -548,6 +539,15 @@ export type OptimizationRuntimeChunkNormalized = */ name?: Function; }; +/** + * A function returning cache groups. + */ +export type OptimizationSplitChunksGetCacheGroups = ( + module: import("../lib/Module") +) => + | OptimizationSplitChunksCacheGroup + | OptimizationSplitChunksCacheGroup[] + | void; /** * Options object as provided by the user. @@ -1421,7 +1421,7 @@ export interface OptimizationSplitChunksCacheGroup { */ chunks?: | ("initial" | "async" | "all") - | OptimizationSplitChunksGetCacheGroups; + | ((chunk: import("../lib/Chunk")) => boolean); /** * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group. */ diff --git a/lib/optimize/SplitChunksPlugin.js b/lib/optimize/SplitChunksPlugin.js index b5fb0e0dd..f9a1d25ca 100644 --- a/lib/optimize/SplitChunksPlugin.js +++ b/lib/optimize/SplitChunksPlugin.js @@ -342,7 +342,7 @@ const normalizeName = name => { }; /** - * @param {"initial"|"async"|"all"|Function} chunks the chunk filter option + * @param {OptimizationSplitChunksCacheGroup["chunks"]} chunks the chunk filter option * @returns {ChunkFilterFunction} the chunk filter function */ const normalizeChunksFilter = chunks => { @@ -356,7 +356,7 @@ const normalizeChunksFilter = chunks => { return ALL_CHUNK_FILTER; } if (typeof chunks === "function") { - return /** @type {ChunkFilterFunction} */ (chunks); + return chunks; } }; diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 4a22e03d9..41d8bbf22 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -1248,7 +1248,8 @@ "enum": ["initial", "async", "all"] }, { - "$ref": "#/definitions/OptimizationSplitChunksGetCacheGroups" + "instanceof": "Function", + "tsType": "((chunk: import('../lib/Chunk')) => boolean)" } ] }, diff --git a/test/configCases/contenthash/include-chunk-id/webpack.config.js b/test/configCases/contenthash/include-chunk-id/webpack.config.js index c5a898a94..004bb036c 100644 --- a/test/configCases/contenthash/include-chunk-id/webpack.config.js +++ b/test/configCases/contenthash/include-chunk-id/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { mode: "production", diff --git a/test/configCases/custom-hash-function/xxhash/webpack.config.js b/test/configCases/custom-hash-function/xxhash/webpack.config.js index b2d734eab..66e792708 100644 --- a/test/configCases/custom-hash-function/xxhash/webpack.config.js +++ b/test/configCases/custom-hash-function/xxhash/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { output: { diff --git a/test/configCases/custom-modules/json-custom/webpack.config.js b/test/configCases/custom-modules/json-custom/webpack.config.js index a763d5d65..028fea1e6 100644 --- a/test/configCases/custom-modules/json-custom/webpack.config.js +++ b/test/configCases/custom-modules/json-custom/webpack.config.js @@ -1,5 +1,6 @@ const toml = require("toml"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { mode: "development", diff --git a/test/configCases/externals/externals-array/webpack.config.js b/test/configCases/externals/externals-array/webpack.config.js index af6b62d05..3c4de33bf 100644 --- a/test/configCases/externals/externals-array/webpack.config.js +++ b/test/configCases/externals/externals-array/webpack.config.js @@ -1,4 +1,5 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { output: { diff --git a/test/configCases/hash-length/deterministic-module-ids/webpack.config.js b/test/configCases/hash-length/deterministic-module-ids/webpack.config.js index f5425a84e..5894d15d8 100644 --- a/test/configCases/hash-length/deterministic-module-ids/webpack.config.js +++ b/test/configCases/hash-length/deterministic-module-ids/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { optimization: { diff --git a/test/configCases/hash-length/hashed-module-ids/webpack.config.js b/test/configCases/hash-length/hashed-module-ids/webpack.config.js index 62db5be09..fd2248911 100644 --- a/test/configCases/hash-length/hashed-module-ids/webpack.config.js +++ b/test/configCases/hash-length/hashed-module-ids/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { optimization: { diff --git a/test/configCases/hash-length/output-filename/webpack.config.js b/test/configCases/hash-length/output-filename/webpack.config.js index be0211d9d..1947fa3f3 100644 --- a/test/configCases/hash-length/output-filename/webpack.config.js +++ b/test/configCases/hash-length/output-filename/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); /** @type {import("../../../../").Configuration[]} */ +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { name: "hash with length in publicPath", diff --git a/test/configCases/issues/issue-7470/webpack.config.js b/test/configCases/issues/issue-7470/webpack.config.js index 7b123d952..747d6b356 100644 --- a/test/configCases/issues/issue-7470/webpack.config.js +++ b/test/configCases/issues/issue-7470/webpack.config.js @@ -2,6 +2,7 @@ const DefinePlugin = require("../../../../").DefinePlugin; +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { name: "development", diff --git a/test/configCases/issues/issue-7563/webpack.config.js b/test/configCases/issues/issue-7563/webpack.config.js index 6794aaa51..3fcd6c3bc 100644 --- a/test/configCases/issues/issue-7563/webpack.config.js +++ b/test/configCases/issues/issue-7563/webpack.config.js @@ -4,6 +4,7 @@ const testAllButHash = "[chunkhash].[chunkhash:16].[name].[id].[query]"; const testHash = "[fullhash].[fullhash:16]"; +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { name: "webworker-all", diff --git a/test/configCases/library/0-create-library/webpack.config.js b/test/configCases/library/0-create-library/webpack.config.js index 67ead16a0..a1408d063 100644 --- a/test/configCases/library/0-create-library/webpack.config.js +++ b/test/configCases/library/0-create-library/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { output: { diff --git a/test/configCases/library/1-use-library/webpack.config.js b/test/configCases/library/1-use-library/webpack.config.js index bf736a163..2ed7d6379 100644 --- a/test/configCases/library/1-use-library/webpack.config.js +++ b/test/configCases/library/1-use-library/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); var path = require("path"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { resolve: { diff --git a/test/configCases/loaders/hot-in-context/webpack.config.js b/test/configCases/loaders/hot-in-context/webpack.config.js index 925a31824..d4d85f9d8 100644 --- a/test/configCases/loaders/hot-in-context/webpack.config.js +++ b/test/configCases/loaders/hot-in-context/webpack.config.js @@ -1,4 +1,5 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { // no hmr diff --git a/test/configCases/parsing/system.import/webpack.config.js b/test/configCases/parsing/system.import/webpack.config.js index ae747d611..1b2f73779 100644 --- a/test/configCases/parsing/system.import/webpack.config.js +++ b/test/configCases/parsing/system.import/webpack.config.js @@ -22,6 +22,7 @@ function createConfig(system) { }; } +/** @type {import("../../../../").Configuration[]} */ module.exports = [ createConfig(undefined), createConfig(true), diff --git a/test/configCases/plugins/environment-plugin/webpack.config.js b/test/configCases/plugins/environment-plugin/webpack.config.js index e9671851d..132ce72aa 100644 --- a/test/configCases/plugins/environment-plugin/webpack.config.js +++ b/test/configCases/plugins/environment-plugin/webpack.config.js @@ -10,6 +10,7 @@ process.env.FFF = "fff"; process.env.GGG = "ggg"; process.env.III = ""; +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { name: "aaa", diff --git a/test/configCases/simple/multi-compiler-functions/webpack.config.js b/test/configCases/simple/multi-compiler-functions/webpack.config.js index b87474636..4a405a8b2 100644 --- a/test/configCases/simple/multi-compiler-functions/webpack.config.js +++ b/test/configCases/simple/multi-compiler-functions/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration[]} */ module.exports = [ function () { return {}; diff --git a/test/configCases/simple/multi-compiler/webpack.config.js b/test/configCases/simple/multi-compiler/webpack.config.js index c5578074b..a309ecd2e 100644 --- a/test/configCases/simple/multi-compiler/webpack.config.js +++ b/test/configCases/simple/multi-compiler/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration[]} */ module.exports = [{}]; diff --git a/test/configCases/split-chunks-common/target-node/webpack.config.js b/test/configCases/split-chunks-common/target-node/webpack.config.js index dc55044e1..796b09dc1 100644 --- a/test/configCases/split-chunks-common/target-node/webpack.config.js +++ b/test/configCases/split-chunks-common/target-node/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { name: "default", diff --git a/test/statsCases/aggressive-splitting-entry/webpack.config.js b/test/statsCases/aggressive-splitting-entry/webpack.config.js index 1b66d966f..791151d5f 100644 --- a/test/statsCases/aggressive-splitting-entry/webpack.config.js +++ b/test/statsCases/aggressive-splitting-entry/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../"); +/** @type {import("../../../").Configuration[]} */ module.exports = ["fitting", "content-change"].map(type => ({ name: type, mode: "production", diff --git a/test/statsCases/async-commons-chunk-auto/webpack.config.js b/test/statsCases/async-commons-chunk-auto/webpack.config.js index f82f99c21..710fb0d3d 100644 --- a/test/statsCases/async-commons-chunk-auto/webpack.config.js +++ b/test/statsCases/async-commons-chunk-auto/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration[]} */ module.exports = [ { name: "disabled", diff --git a/test/statsCases/commons-plugin-issue-4980/webpack.config.js b/test/statsCases/commons-plugin-issue-4980/webpack.config.js index 732a00e67..eac99f48b 100644 --- a/test/statsCases/commons-plugin-issue-4980/webpack.config.js +++ b/test/statsCases/commons-plugin-issue-4980/webpack.config.js @@ -1,4 +1,5 @@ // should generate vendor chunk with the same chunkhash for both entries +/** @type {import("../../../").Configuration[]} */ module.exports = [ { mode: "production", diff --git a/test/statsCases/context-independence/webpack.config.js b/test/statsCases/context-independence/webpack.config.js index 998b793f6..63f1fe444 100644 --- a/test/statsCases/context-independence/webpack.config.js +++ b/test/statsCases/context-independence/webpack.config.js @@ -20,6 +20,7 @@ const base2 = { devtool: "eval-source-map" }; +/** @type {import("../../../").Configuration[]} */ module.exports = [ { ...base, diff --git a/test/statsCases/define-plugin/webpack.config.js b/test/statsCases/define-plugin/webpack.config.js index d663053a3..1a3a41f33 100644 --- a/test/statsCases/define-plugin/webpack.config.js +++ b/test/statsCases/define-plugin/webpack.config.js @@ -8,6 +8,7 @@ function read(path) { ); } +/** @type {import("../../../").Configuration[]} */ module.exports = [ { mode: "production", diff --git a/test/statsCases/filter-warnings/webpack.config.js b/test/statsCases/filter-warnings/webpack.config.js index 38e273ce9..622970f7d 100644 --- a/test/statsCases/filter-warnings/webpack.config.js +++ b/test/statsCases/filter-warnings/webpack.config.js @@ -29,6 +29,7 @@ const baseConfig = { } }; +/** @type {import("../../../").Configuration[]} */ module.exports = [ undefined, "Terser", diff --git a/test/statsCases/issue-7577/webpack.config.js b/test/statsCases/issue-7577/webpack.config.js index 63ea3ce88..423cb47a4 100644 --- a/test/statsCases/issue-7577/webpack.config.js +++ b/test/statsCases/issue-7577/webpack.config.js @@ -15,6 +15,7 @@ const base = { } } }; +/** @type {import("../../../").Configuration[]} */ module.exports = [ { entry: "./a.js", diff --git a/test/statsCases/limit-chunk-count-plugin/webpack.config.js b/test/statsCases/limit-chunk-count-plugin/webpack.config.js index ed78fc7d8..5fadb1934 100644 --- a/test/statsCases/limit-chunk-count-plugin/webpack.config.js +++ b/test/statsCases/limit-chunk-count-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../"); +/** @type {import("../../../").Configuration[]} */ module.exports = [1, 2, 3, 4].map(n => ({ name: `${n} chunks`, mode: "production", diff --git a/test/statsCases/named-chunk-groups/webpack.config.js b/test/statsCases/named-chunk-groups/webpack.config.js index 7306ac0ba..5707a8b1e 100644 --- a/test/statsCases/named-chunk-groups/webpack.config.js +++ b/test/statsCases/named-chunk-groups/webpack.config.js @@ -28,6 +28,7 @@ const config = { } }; +/** @type {import("../../../").Configuration[]} */ module.exports = [ { stats: { entrypoints: false, chunkGroups: true, ...stats }, diff --git a/test/statsCases/performance-different-mode-and-target/webpack.config.js b/test/statsCases/performance-different-mode-and-target/webpack.config.js index 6e23f0dac..99f80423c 100644 --- a/test/statsCases/performance-different-mode-and-target/webpack.config.js +++ b/test/statsCases/performance-different-mode-and-target/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration[]} */ module.exports = [ { entry: "./index", diff --git a/test/statsCases/preset-mixed-array/webpack.config.js b/test/statsCases/preset-mixed-array/webpack.config.js index a4d33def3..e4282dcf3 100644 --- a/test/statsCases/preset-mixed-array/webpack.config.js +++ b/test/statsCases/preset-mixed-array/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration[]} */ module.exports = [ { name: "minimal", diff --git a/test/statsCases/preset-none-array/webpack.config.js b/test/statsCases/preset-none-array/webpack.config.js index f6d77361b..8beaeabc6 100644 --- a/test/statsCases/preset-none-array/webpack.config.js +++ b/test/statsCases/preset-none-array/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration[]} */ module.exports = [ { mode: "production", diff --git a/test/statsCases/runtime-chunk-integration/webpack.config.js b/test/statsCases/runtime-chunk-integration/webpack.config.js index 407623d01..5aa48e608 100644 --- a/test/statsCases/runtime-chunk-integration/webpack.config.js +++ b/test/statsCases/runtime-chunk-integration/webpack.config.js @@ -46,4 +46,5 @@ const withNamedEntry = { } }; +/** @type {import("../../../").Configuration[]} */ module.exports = [withoutNamedEntry, withNamedEntry]; diff --git a/test/statsCases/scope-hoisting-multi/webpack.config.js b/test/statsCases/scope-hoisting-multi/webpack.config.js index 0d81f6af2..392007e70 100644 --- a/test/statsCases/scope-hoisting-multi/webpack.config.js +++ b/test/statsCases/scope-hoisting-multi/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration[]} */ module.exports = [ { mode: "production", diff --git a/test/statsCases/split-chunks-max-size/webpack.config.js b/test/statsCases/split-chunks-max-size/webpack.config.js index ababca247..cf4776727 100644 --- a/test/statsCases/split-chunks-max-size/webpack.config.js +++ b/test/statsCases/split-chunks-max-size/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration[]} */ module.exports = [ { name: "production", diff --git a/test/statsCases/split-chunks/webpack.config.js b/test/statsCases/split-chunks/webpack.config.js index 9de56d308..8370c7e49 100644 --- a/test/statsCases/split-chunks/webpack.config.js +++ b/test/statsCases/split-chunks/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration[]} */ module.exports = [ { name: "default", diff --git a/test/watchCases/simple/multi-compiler/webpack.config.js b/test/watchCases/simple/multi-compiler/webpack.config.js index 24bc32aca..1c53840c3 100644 --- a/test/watchCases/simple/multi-compiler/webpack.config.js +++ b/test/watchCases/simple/multi-compiler/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { name: "changing", diff --git a/types.d.ts b/types.d.ts index ed3f44644..28d9f96e3 100644 --- a/types.d.ts +++ b/types.d.ts @@ -5828,16 +5828,7 @@ declare namespace webpack { /** * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML). */ - chunks?: - | "initial" - | "async" - | "all" - | (( - module: webpack.Module - ) => - | void - | webpack.OptimizationSplitChunksCacheGroup - | Array); + chunks?: "initial" | "async" | "all" | ((chunk: webpack.Chunk) => boolean); /** * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group. From c7a962604fa7fdf53bcd5e6706382266f4c52dbe Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Mon, 20 Apr 2020 09:26:08 +0200 Subject: [PATCH 25/30] fix splitChunks typings --- declarations/WebpackOptions.d.ts | 4 +++- schemas/WebpackOptions.json | 2 +- types.d.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index 91b72c8d8..bbf939de3 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -1332,7 +1332,9 @@ export interface OptimizationSplitChunksOptions { /** * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML). */ - chunks?: ("initial" | "async" | "all") | Function; + chunks?: + | ("initial" | "async" | "all") + | ((chunk: import("../lib/Chunk")) => boolean); /** * Options for modules not selected by any other cache group. */ diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 41d8bbf22..23da9837d 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -1460,7 +1460,7 @@ }, { "instanceof": "Function", - "tsType": "Function" + "tsType": "((chunk: import('../lib/Chunk')) => boolean)" } ] }, diff --git a/types.d.ts b/types.d.ts index 28d9f96e3..80b2366f8 100644 --- a/types.d.ts +++ b/types.d.ts @@ -5937,7 +5937,7 @@ declare namespace webpack { /** * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML). */ - chunks?: Function | "initial" | "async" | "all"; + chunks?: "initial" | "async" | "all" | ((chunk: webpack.Chunk) => boolean); /** * Options for modules not selected by any other cache group. From ad55eb72330da55c578d3eba269a254c0e0ad363 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 21 Apr 2020 08:45:35 +0200 Subject: [PATCH 26/30] improve the code generation of the typings --- generate-types-config.js | 6 +- package.json | 2 +- types.d.ts | 16347 ++++++++++++++++--------------------- yarn.lock | 4 +- 4 files changed, 7129 insertions(+), 9230 deletions(-) diff --git a/generate-types-config.js b/generate-types-config.js index 2af0bdcbf..59d8b7892 100644 --- a/generate-types-config.js +++ b/generate-types-config.js @@ -1,5 +1,7 @@ module.exports = { nameMapping: { - FsStats: /^Stats Import fs/ - } + FsStats: /^Stats Import fs/, + Configuration: /^WebpackOptions / + }, + exclude: [/^devServer in WebpackOptions /] }; diff --git a/package.json b/package.json index c95660694..945aa9c81 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "strip-ansi": "^6.0.0", "style-loader": "^1.0.0", "toml": "^3.0.0", - "tooling": "webpack/tooling#v1.0.0", + "tooling": "webpack/tooling#v1.1.0", "ts-loader": "^6.0.4", "typescript": "^3.6.4", "url-loader": "^2.1.0", diff --git a/types.d.ts b/types.d.ts index 80b2366f8..25d273758 100644 --- a/types.d.ts +++ b/types.d.ts @@ -75,4961 +75,7081 @@ import { SyncWaterfallHook } from "tapable"; -declare namespace webpack { - export class AbstractLibraryPlugin { - constructor(__0: { - /** - * name of the plugin - */ - pluginName: string; - /** - * used library type - */ - type: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - }); - +declare class AbstractLibraryPlugin { + constructor(__0: { /** - * Apply the plugin + * name of the plugin */ - apply(compiler: webpack.Compiler): void; - parseOptions(library: webpack.LibraryOptions): false | T; - finishEntryModule( - module: webpack.Module, - libraryContext: webpack.LibraryContext - ): void; - runtimeRequirements( - chunk: webpack.Chunk, - set: Set, - libraryContext: webpack.LibraryContext - ): void; - render( - source: webpack.Source, - renderContext: webpack.RenderContextJavascriptModulesPlugin, - libraryContext: webpack.LibraryContext - ): webpack.Source; - chunkHash( - chunk: webpack.Chunk, - hash: webpack.Hash, - chunkHashContext: webpack.ChunkHashContext, - libraryContext: webpack.LibraryContext - ): void; - } - export class AggressiveMergingPlugin { - constructor(options?: any); - options: any; - + pluginName: string; /** - * Apply the plugin + * used library type */ - apply(compiler: webpack.Compiler): void; - } - export class AggressiveSplittingPlugin { - constructor(options?: webpack.AggressiveSplittingPluginOptions); - options: webpack.AggressiveSplittingPluginOptions; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - static wasChunkRecorded(chunk: webpack.Chunk): boolean; - } + type: ExternalsType; + }); /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update + * Apply the plugin */ - export interface AggressiveSplittingPluginOptions { - /** - * Extra cost for each chunk (Default: 9.8kiB). - */ - chunkOverhead?: number; + apply(compiler: Compiler): void; + parseOptions(library: LibraryOptions): false | T; + finishEntryModule(module: Module, libraryContext: LibraryContext): void; + runtimeRequirements( + chunk: Chunk, + set: Set, + libraryContext: LibraryContext + ): void; + render( + source: Source, + renderContext: RenderContextJavascriptModulesPlugin, + libraryContext: LibraryContext + ): Source; + chunkHash( + chunk: Chunk, + hash: Hash, + chunkHashContext: ChunkHashContext, + libraryContext: LibraryContext + ): void; +} +declare class AggressiveMergingPlugin { + constructor(options?: any); + options: any; - /** - * Extra cost multiplicator for entry chunks (Default: 10). - */ - entryChunkMultiplicator?: number; + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class AggressiveSplittingPlugin { + constructor(options?: AggressiveSplittingPluginOptions); + options: AggressiveSplittingPluginOptions; - /** - * Byte, max size of per file (Default: 50kiB). - */ - maxSize?: number; + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + static wasChunkRecorded(chunk: Chunk): boolean; +} - /** - * Byte, split point. (Default: 30kiB). - */ - minSize?: number; - } - export type Amd = false | { [index: string]: any }; - export interface Argument { - description: string; - simpleType: "string" | "number" | "boolean"; - multiple: boolean; - configs: Array; - } - export interface ArgumentConfig { - description: string; - path: string; - multiple: boolean; - type: - | "string" - | "number" - | "boolean" - | "path" - | "enum" - | "RegExp" - | "reset"; - values?: Array; - } - export interface Asset { - /** - * the filename of the asset - */ - name: string; +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface AggressiveSplittingPluginOptions { + /** + * Extra cost for each chunk (Default: 9.8kiB). + */ + chunkOverhead?: number; - /** - * source of the asset - */ - source: webpack.Source; + /** + * Extra cost multiplicator for entry chunks (Default: 10). + */ + entryChunkMultiplicator?: number; - /** - * info about the asset - */ - info: webpack.AssetInfo; - } - export interface AssetEmittedInfo { - content: Buffer; - source: webpack.Source; - compilation: webpack.Compilation; - outputPath: string; - targetPath: string; - } - export interface AssetInfo { - /** - * true, if the asset can be long term cached forever (contains a hash) - */ - immutable?: boolean; + /** + * Byte, max size of per file (Default: 50kiB). + */ + maxSize?: number; - /** - * size in bytes, only set after asset has been emitted - */ - size?: number; + /** + * Byte, split point. (Default: 30kiB). + */ + minSize?: number; +} +type Amd = false | { [index: string]: any }; +declare interface Argument { + description: string; + simpleType: "string" | "number" | "boolean"; + multiple: boolean; + configs: Array; +} +declare interface ArgumentConfig { + description: string; + path: string; + multiple: boolean; + type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset"; + values?: Array; +} +declare interface Asset { + /** + * the filename of the asset + */ + name: string; - /** - * true, when asset is only used for development and doesn't count towards user-facing assets - */ - development?: boolean; + /** + * source of the asset + */ + source: Source; - /** - * true, when asset ships data for updating an existing application (HMR) - */ - hotModuleReplacement?: boolean; - } - export type AssetModuleFilename = + /** + * info about the asset + */ + info: AssetInfo; +} +declare interface AssetEmittedInfo { + content: Buffer; + source: Source; + compilation: Compilation; + outputPath: string; + targetPath: string; +} +declare interface AssetInfo { + /** + * true, if the asset can be long term cached forever (contains a hash) + */ + immutable?: boolean; + + /** + * size in bytes, only set after asset has been emitted + */ + size?: number; + + /** + * true, when asset is only used for development and doesn't count towards user-facing assets + */ + development?: boolean; + + /** + * true, when asset ships data for updating an existing application (HMR) + */ + hotModuleReplacement?: boolean; +} +type AssetModuleFilename = + | string + | ((pathData: PathData, assetInfo: AssetInfo) => string); +declare abstract class AsyncDependenciesBlock extends DependenciesBlock { + groupOptions: { preloadOrder?: number; prefetchOrder?: number; name: string }; + loc: SyntheticDependencyLocation | RealDependencyLocation; + request: string; + parent: DependenciesBlock; + chunkName: string; + module: any; +} +declare abstract class AsyncQueue { + hooks: { + beforeAdd: AsyncSeriesHook<[T]>; + added: SyncHook<[T], void>; + beforeStart: AsyncSeriesHook<[T]>; + started: SyncHook<[T], void>; + result: SyncHook<[T, Error, R], void>; + }; + add(item: T, callback: CallbackFunction): void; + invalidate(item: T): void; + stop(): void; + increaseParallelism(): void; + decreaseParallelism(): void; + isProcessing(item: T): boolean; + isQueued(item: T): boolean; + isDone(item: T): boolean; +} +declare class AsyncWebAssemblyModulesPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + renderModule(module?: any, renderContext?: any, hooks?: any): any; + static getCompilationHooks( + compilation: Compilation + ): CompilationHooksAsyncWebAssemblyModulesPlugin; +} +declare class AutomaticPrefetchPlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +type AuxiliaryComment = string | LibraryCustomUmdCommentObject; +declare class BannerPlugin { + constructor(options: BannerPluginArgument); + options: BannerPluginOptions; + banner: (data: { hash: string; chunk: Chunk; filename: string }) => string; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +type BannerPluginArgument = + | string + | BannerPluginOptions + | ((data: { hash: string; chunk: Chunk; filename: string }) => string); +declare interface BannerPluginOptions { + /** + * Specifies the banner. + */ + banner: | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - export abstract class AsyncDependenciesBlock extends webpack.DependenciesBlock { - groupOptions: { - preloadOrder?: number; - prefetchOrder?: number; - name: string; - }; - loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; + | ((data: { hash: string; chunk: Chunk; filename: string }) => string); + + /** + * If true, the banner will only be added to the entry chunks. + */ + entryOnly?: boolean; + + /** + * Exclude all modules matching any of these conditions. + */ + exclude?: RulesBannerPlugin; + + /** + * Include all modules matching any of these conditions. + */ + include?: RulesBannerPlugin; + + /** + * If true, banner will not be wrapped in a comment. + */ + raw?: boolean; + + /** + * Include all modules that pass test assertion. + */ + test?: RulesBannerPlugin; +} +declare abstract class BasicEvaluatedExpression { + type: number; + range: any; + falsy: boolean; + truthy: boolean; + bool: any; + number: any; + bigint: any; + regExp: any; + string: any; + quasis: any; + parts: any; + array: any; + items: any; + options: any; + prefix: any; + postfix: any; + wrappedInnerExpressions: any; + identifier: any; + rootInfo: any; + getMembers: any; + expression: any; + isNull(): boolean; + isString(): boolean; + isNumber(): boolean; + isBigInt(): boolean; + isBoolean(): boolean; + isRegExp(): boolean; + isConditional(): boolean; + isArray(): boolean; + isConstArray(): boolean; + isIdentifier(): boolean; + isWrapped(): boolean; + isTemplateString(): boolean; + isTruthy(): boolean; + isFalsy(): boolean; + asBool(): any; + asString(): any; + setString(string?: any): BasicEvaluatedExpression; + setNull(): BasicEvaluatedExpression; + setNumber(number?: any): BasicEvaluatedExpression; + setBigInt(bigint?: any): BasicEvaluatedExpression; + setBoolean(bool?: any): BasicEvaluatedExpression; + setRegExp(regExp?: any): BasicEvaluatedExpression; + setIdentifier( + identifier?: any, + rootInfo?: any, + getMembers?: any + ): BasicEvaluatedExpression; + setWrapped( + prefix?: any, + postfix?: any, + innerExpressions?: any + ): BasicEvaluatedExpression; + setOptions(options?: any): BasicEvaluatedExpression; + addOptions(options?: any): BasicEvaluatedExpression; + setItems(items?: any): BasicEvaluatedExpression; + setArray(array?: any): BasicEvaluatedExpression; + setTemplateString( + quasis?: any, + parts?: any, + kind?: any + ): BasicEvaluatedExpression; + templateStringKind: any; + setTruthy(): BasicEvaluatedExpression; + setFalsy(): BasicEvaluatedExpression; + setRange(range?: any): BasicEvaluatedExpression; + setExpression(expression?: any): BasicEvaluatedExpression; +} +declare abstract class ByTypeGenerator extends Generator { + map: any; +} +declare class Cache { + constructor(); + hooks: { + get: AsyncSeriesBailHook< + [string, Etag, Array<(result: any, stats: CallbackCache) => void>], + any + >; + store: AsyncParallelHook<[string, Etag, any]>; + storeBuildDependencies: AsyncParallelHook<[Iterable]>; + beginIdle: SyncHook<[], void>; + endIdle: AsyncParallelHook<[]>; + shutdown: AsyncParallelHook<[]>; + }; + get(identifier: string, etag: Etag, callback: CallbackCache): void; + store( + identifier: string, + etag: Etag, + data: T, + callback: CallbackCache + ): void; + + /** + * After this method has succeeded the cache can only be restored when build dependencies are + */ + storeBuildDependencies( + dependencies: Iterable, + callback: CallbackCache + ): void; + beginIdle(): void; + endIdle(callback: CallbackCache): void; + shutdown(callback: CallbackCache): void; + static STAGE_MEMORY: number; + static STAGE_DEFAULT: number; + static STAGE_DISK: number; + static STAGE_NETWORK: number; +} +declare interface CacheGroupSource { + key?: string; + priority?: number; + getName?: (module?: Module, chunks?: Array, key?: string) => string; + chunksFilter?: (chunk: Chunk) => boolean; + enforce?: boolean; + minSize: Record; + minRemainingSize: Record; + maxAsyncSize: Record; + maxInitialSize: Record; + minChunks?: number; + maxAsyncRequests?: number; + maxInitialRequests?: number; + filename?: string | ((arg0: PathData, arg1: AssetInfo) => string); + idHint?: string; + automaticNameDelimiter: string; + reuseExistingChunk?: boolean; +} +declare interface CacheGroupsContext { + moduleGraph: ModuleGraph; + chunkGraph: ChunkGraph; +} +type CacheOptions = boolean | MemoryCacheOptions | FileCacheOptions; +type CacheOptionsNormalized = false | MemoryCacheOptions | FileCacheOptions; +type CallExpression = SimpleCallExpression | NewExpression; +declare interface CallbackCache { + (err?: WebpackError, stats?: T): void; +} +declare interface CallbackFunction { + (err?: Error, result?: T): any; +} +declare interface CallbackWebpack { + (err?: Error, stats?: T): void; +} +declare class Chunk { + constructor(name?: string); + id: string | number; + ids: Array; + debugId: number; + name: string; + idNameHints: SortableSet; + preventIntegration: boolean; + filenameTemplate: string | ((arg0: PathData, arg1: AssetInfo) => string); + files: Set; + auxiliaryFiles: Set; + rendered: boolean; + hash: string; + contentHash: Record; + renderedHash: string; + chunkReason: string; + extraAsync: boolean; + readonly entryModule: Module; + hasEntryModule(): boolean; + addModule(module: Module): boolean; + removeModule(module: Module): void; + getNumberOfModules(): number; + readonly modulesIterable: Iterable; + compareTo(otherChunk: Chunk): 0 | 1 | -1; + containsModule(module: Module): boolean; + getModules(): Array; + remove(): void; + moveModule(module: Module, otherChunk: Chunk): void; + integrate(otherChunk: Chunk): boolean; + canBeIntegrated(otherChunk: Chunk): boolean; + isEmpty(): boolean; + modulesSize(): number; + size(options?: ChunkSizeOptions): number; + integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number; + getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps; + hasModuleInGraph( + filterFn: (m: Module) => boolean, + filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean + ): boolean; + getChunkMaps(realHash: boolean): ChunkMaps; + hasRuntime(): boolean; + canBeInitial(): boolean; + isOnlyInitial(): boolean; + addGroup(chunkGroup: ChunkGroup): void; + removeGroup(chunkGroup: ChunkGroup): void; + isInGroup(chunkGroup: ChunkGroup): boolean; + getNumberOfGroups(): number; + readonly groupsIterable: Iterable; + disconnectFromGroups(): void; + split(newChunk: Chunk): void; + updateHash(hash: Hash, chunkGraph: ChunkGraph): void; + getAllAsyncChunks(): Set; + getAllReferencedChunks(): Set; + hasAsyncChunks(): boolean; + getChildIdsByOrders( + chunkGraph: ChunkGraph, + filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean + ): Record>; + getChildIdsByOrdersMap( + chunkGraph: ChunkGraph, + includeDirectChildren?: boolean, + filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean + ): Record>>; +} +declare class ChunkGraph { + constructor(moduleGraph: ModuleGraph); + moduleGraph: ModuleGraph; + connectChunkAndModule(chunk: Chunk, module: Module): void; + disconnectChunkAndModule(chunk: Chunk, module: Module): void; + disconnectChunk(chunk: Chunk): void; + attachModules(chunk: Chunk, modules: Iterable): void; + attachRuntimeModules(chunk: Chunk, modules: Iterable): void; + replaceModule(oldModule: Module, newModule: Module): void; + isModuleInChunk(module: Module, chunk: Chunk): boolean; + isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean; + isEntryModule(module: Module): boolean; + getModuleChunksIterable(module: Module): Iterable; + getOrderedModuleChunksIterable( + module: Module, + sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1 + ): Iterable; + getModuleChunks(module: Module): Array; + getNumberOfModuleChunks(module: Module): number; + haveModulesEqualChunks(moduleA: Module, moduleB: Module): boolean; + getNumberOfChunkModules(chunk: Chunk): number; + getChunkModulesIterable(chunk: Chunk): Iterable; + getChunkModulesIterableBySourceType( + chunk: Chunk, + sourceType: string + ): Iterable; + getOrderedChunkModulesIterable( + chunk: Chunk, + comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1 + ): Iterable; + getOrderedChunkModulesIterableBySourceType( + chunk: Chunk, + sourceType: string, + comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1 + ): Iterable; + getChunkModules(chunk: Chunk): Array; + getOrderedChunkModules( + chunk: Chunk, + comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1 + ): Array; + getChunkModuleMaps( + chunk: Chunk, + filterFn: (m: Module) => boolean, + includeAllChunks?: boolean + ): ChunkModuleMaps; + getChunkConditionMap( + chunk: Chunk, + filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean + ): Record; + hasModuleInChunk(chunk: Chunk, filterFn: (m: Module) => boolean): boolean; + hasModuleInGraph( + chunk: Chunk, + filterFn: (m: Module) => boolean, + filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean + ): boolean; + compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1; + getChunkModulesSize(chunk: Chunk): number; + getChunkModulesSizes(chunk: Chunk): Record; + getChunkRootModules(chunk: Chunk): Array; + getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number; + getIntegratedChunksSize( + chunkA: Chunk, + chunkB: Chunk, + options?: ChunkSizeOptions + ): number; + canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean; + integrateChunks(chunkA: Chunk, chunkB: Chunk): void; + isEntryModuleInChunk(module: Module, chunk: Chunk): boolean; + connectChunkAndEntryModule( + chunk: Chunk, + module: Module, + entrypoint?: Entrypoint + ): void; + connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void; + disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void; + disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void; + disconnectEntryModule(module: Module): void; + disconnectEntries(chunk: Chunk): void; + getNumberOfEntryModules(chunk: Chunk): number; + getNumberOfRuntimeModules(chunk: Chunk): number; + getChunkEntryModulesIterable(chunk: Chunk): Iterable; + getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable; + hasChunkEntryDependentChunks(chunk: Chunk): boolean; + getChunkRuntimeModulesIterable(chunk: Chunk): Iterable; + getChunkRuntimeModulesInOrder(chunk: Chunk): Array; + getChunkEntryModulesWithChunkGroupIterable( + chunk: Chunk + ): Iterable<[Module, Entrypoint]>; + getBlockChunkGroup(depBlock: AsyncDependenciesBlock): ChunkGroup; + connectBlockAndChunkGroup( + depBlock: AsyncDependenciesBlock, + chunkGroup: ChunkGroup + ): void; + disconnectChunkGroup(chunkGroup: ChunkGroup): void; + getModuleId(module: Module): string | number; + setModuleId(module: Module, id: string | number): void; + getModuleHash(module: Module): string; + getRenderedModuleHash(module: Module): string; + setModuleHashes(module: Module, hash: string, renderedHash: string): void; + addModuleRuntimeRequirements(module: Module, items: Set): void; + addChunkRuntimeRequirements(chunk: Chunk, items: Set): void; + addTreeRuntimeRequirements(chunk: Chunk, items: Iterable): void; + getModuleRuntimeRequirements(module: Module): ReadonlySet; + getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet; + getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet; + static getChunkGraphForModule( + module: Module, + deprecateMessage: string, + deprecationCode: string + ): ChunkGraph; + static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void; + static getChunkGraphForChunk( + chunk: Chunk, + deprecateMessage: string, + deprecationCode: string + ): ChunkGraph; + static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void; +} +declare abstract class ChunkGroup { + groupDebugId: number; + options: { preloadOrder?: number; prefetchOrder?: number; name: string }; + chunks: Array; + origins: Array<{ + module: Module; + loc: SyntheticDependencyLocation | RealDependencyLocation; request: string; - parent: webpack.DependenciesBlock; - chunkName: string; - module: any; - } - export abstract class AsyncQueue { - hooks: { - beforeAdd: AsyncSeriesHook<[T]>; - added: SyncHook<[T], void>; - beforeStart: AsyncSeriesHook<[T]>; - started: SyncHook<[T], void>; - result: SyncHook<[T, Error, R], void>; - }; - add(item: T, callback: webpack.CallbackCompiler): void; - invalidate(item: T): void; - stop(): void; - increaseParallelism(): void; - decreaseParallelism(): void; - isProcessing(item: T): boolean; - isQueued(item: T): boolean; - isDone(item: T): boolean; - } - export class AsyncWebAssemblyModulesPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - renderModule(module?: any, renderContext?: any, hooks?: any): any; - static getCompilationHooks( - compilation: webpack.Compilation - ): webpack.CompilationHooksAsyncWebAssemblyModulesPlugin; - } - export class AutomaticPrefetchPlugin { - constructor(); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export type AuxiliaryComment = string | webpack.LibraryCustomUmdCommentObject; - export class BannerPlugin { - constructor( - options: - | string - | webpack.BannerPluginOptions - | ((data: { - hash: string; - chunk: webpack.Chunk; - filename: string; - }) => string) - ); - options: webpack.BannerPluginOptions; - banner: (data: { - hash: string; - chunk: webpack.Chunk; - filename: string; - }) => string; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export type BannerPluginArgument = - | string - | webpack.BannerPluginOptions - | ((data: { - hash: string; - chunk: webpack.Chunk; - filename: string; - }) => string); - export interface BannerPluginOptions { - /** - * Specifies the banner. - */ - banner: - | string - | ((data: { - hash: string; - chunk: webpack.Chunk; - filename: string; - }) => string); - - /** - * If true, the banner will only be added to the entry chunks. - */ - entryOnly?: boolean; - - /** - * Exclude all modules matching any of these conditions. - */ - exclude?: string | RegExp | Array; - - /** - * Include all modules matching any of these conditions. - */ - include?: string | RegExp | Array; - - /** - * If true, banner will not be wrapped in a comment. - */ - raw?: boolean; - - /** - * Include all modules that pass test assertion. - */ - test?: string | RegExp | Array; - } - export abstract class BasicEvaluatedExpression { - type: number; - range: any; - falsy: boolean; - truthy: boolean; - bool: any; - number: any; - bigint: any; - regExp: any; - string: any; - quasis: any; - parts: any; - array: any; - items: any; - options: any; - prefix: any; - postfix: any; - wrappedInnerExpressions: any; - identifier: any; - rootInfo: any; - getMembers: any; - expression: any; - isNull(): boolean; - isString(): boolean; - isNumber(): boolean; - isBigInt(): boolean; - isBoolean(): boolean; - isRegExp(): boolean; - isConditional(): boolean; - isArray(): boolean; - isConstArray(): boolean; - isIdentifier(): boolean; - isWrapped(): boolean; - isTemplateString(): boolean; - isTruthy(): boolean; - isFalsy(): boolean; - asBool(): any; - asString(): any; - setString(string?: any): webpack.BasicEvaluatedExpression; - setNull(): webpack.BasicEvaluatedExpression; - setNumber(number?: any): webpack.BasicEvaluatedExpression; - setBigInt(bigint?: any): webpack.BasicEvaluatedExpression; - setBoolean(bool?: any): webpack.BasicEvaluatedExpression; - setRegExp(regExp?: any): webpack.BasicEvaluatedExpression; - setIdentifier( - identifier?: any, - rootInfo?: any, - getMembers?: any - ): webpack.BasicEvaluatedExpression; - setWrapped( - prefix?: any, - postfix?: any, - innerExpressions?: any - ): webpack.BasicEvaluatedExpression; - setOptions(options?: any): webpack.BasicEvaluatedExpression; - addOptions(options?: any): webpack.BasicEvaluatedExpression; - setItems(items?: any): webpack.BasicEvaluatedExpression; - setArray(array?: any): webpack.BasicEvaluatedExpression; - setTemplateString( - quasis?: any, - parts?: any, - kind?: any - ): webpack.BasicEvaluatedExpression; - templateStringKind: any; - setTruthy(): webpack.BasicEvaluatedExpression; - setFalsy(): webpack.BasicEvaluatedExpression; - setRange(range?: any): webpack.BasicEvaluatedExpression; - setExpression(expression?: any): webpack.BasicEvaluatedExpression; - } - export abstract class ByTypeGenerator extends webpack.Generator { - map: any; - } - export class Cache { - constructor(); - hooks: { - get: AsyncSeriesBailHook< - [ - string, - webpack.Etag, - Array<(result: any, stats: webpack.CallbackCache) => void> - ], - any - >; - store: AsyncParallelHook<[string, webpack.Etag, any]>; - storeBuildDependencies: AsyncParallelHook<[Iterable]>; - beginIdle: SyncHook<[], void>; - endIdle: AsyncParallelHook<[]>; - shutdown: AsyncParallelHook<[]>; - }; - get( - identifier: string, - etag: webpack.Etag, - callback: webpack.CallbackCache - ): void; - store( - identifier: string, - etag: webpack.Etag, - data: T, - callback: webpack.CallbackCache - ): void; - - /** - * After this method has succeeded the cache can only be restored when build dependencies are - */ - storeBuildDependencies( - dependencies: Iterable, - callback: webpack.CallbackCache - ): void; - beginIdle(): void; - endIdle(callback: webpack.CallbackCache): void; - shutdown(callback: webpack.CallbackCache): void; - static STAGE_MEMORY: number; - static STAGE_DEFAULT: number; - static STAGE_DISK: number; - static STAGE_NETWORK: number; - } - export interface CacheGroupSource { - key?: string; - priority?: number; - getName?: ( - module?: webpack.Module, - chunks?: Array, - key?: string - ) => string; - chunksFilter?: (chunk: webpack.Chunk) => boolean; - enforce?: boolean; - minSize: Record; - minRemainingSize: Record; - maxAsyncSize: Record; - maxInitialSize: Record; - minChunks?: number; - maxAsyncRequests?: number; - maxInitialRequests?: number; - filename?: - | string - | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); - idHint?: string; - automaticNameDelimiter: string; - reuseExistingChunk?: boolean; - } - export interface CacheGroupsContext { - moduleGraph: webpack.ModuleGraph; - chunkGraph: webpack.ChunkGraph; - } - export type CacheOptions = - | boolean - | webpack.MemoryCacheOptions - | webpack.FileCacheOptions; - export type CacheOptionsNormalized = - | false - | webpack.MemoryCacheOptions - | webpack.FileCacheOptions; - export type CallExpression = SimpleCallExpression | NewExpression; - export interface CallbackCache { - (err?: webpack.WebpackError, stats?: T): void; - } - export interface CallbackCompiler { - (err?: Error, result?: T): any; - } - export interface CallbackWebpack { - (err?: Error, stats?: T): void; - } - export class Chunk { - constructor(name?: string); - id: string | number; - ids: Array; - debugId: number; - name: string; - idNameHints: webpack.SortableSet; - preventIntegration: boolean; - filenameTemplate: - | string - | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); - files: Set; - auxiliaryFiles: Set; - rendered: boolean; - hash: string; - contentHash: Record; - renderedHash: string; - chunkReason: string; - extraAsync: boolean; - readonly entryModule: webpack.Module; - hasEntryModule(): boolean; - addModule(module: webpack.Module): boolean; - removeModule(module: webpack.Module): void; - getNumberOfModules(): number; - readonly modulesIterable: Iterable; - compareTo(otherChunk: webpack.Chunk): 0 | 1 | -1; - containsModule(module: webpack.Module): boolean; - getModules(): Array; - remove(): void; - moveModule(module: webpack.Module, otherChunk: webpack.Chunk): void; - integrate(otherChunk: webpack.Chunk): boolean; - canBeIntegrated(otherChunk: webpack.Chunk): boolean; - isEmpty(): boolean; - modulesSize(): number; - size(options?: webpack.ChunkSizeOptions): number; - integratedSize( - otherChunk: webpack.Chunk, - options: webpack.ChunkSizeOptions - ): number; - getChunkModuleMaps( - filterFn: (m: webpack.Module) => boolean - ): webpack.ChunkModuleMaps; - hasModuleInGraph( - filterFn: (m: webpack.Module) => boolean, - filterChunkFn?: ( - c: webpack.Chunk, - chunkGraph: webpack.ChunkGraph - ) => boolean - ): boolean; - getChunkMaps(realHash: boolean): webpack.ChunkMaps; - hasRuntime(): boolean; - canBeInitial(): boolean; - isOnlyInitial(): boolean; - addGroup(chunkGroup: webpack.ChunkGroup): void; - removeGroup(chunkGroup: webpack.ChunkGroup): void; - isInGroup(chunkGroup: webpack.ChunkGroup): boolean; - getNumberOfGroups(): number; - readonly groupsIterable: Iterable; - disconnectFromGroups(): void; - split(newChunk: webpack.Chunk): void; - updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; - getAllAsyncChunks(): Set; - getAllReferencedChunks(): Set; - hasAsyncChunks(): boolean; - getChildIdsByOrders( - chunkGraph: webpack.ChunkGraph, - filterFn?: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean - ): Record>; - getChildIdsByOrdersMap( - chunkGraph: webpack.ChunkGraph, - includeDirectChildren?: boolean, - filterFn?: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean - ): Record>>; - } - export class ChunkGraph { - constructor(moduleGraph: webpack.ModuleGraph); - moduleGraph: webpack.ModuleGraph; - connectChunkAndModule(chunk: webpack.Chunk, module: webpack.Module): void; - disconnectChunkAndModule( - chunk: webpack.Chunk, - module: webpack.Module - ): void; - disconnectChunk(chunk: webpack.Chunk): void; - attachModules( - chunk: webpack.Chunk, - modules: Iterable - ): void; - attachRuntimeModules( - chunk: webpack.Chunk, - modules: Iterable - ): void; - replaceModule(oldModule: webpack.Module, newModule: webpack.Module): void; - isModuleInChunk(module: webpack.Module, chunk: webpack.Chunk): boolean; - isModuleInChunkGroup( - module: webpack.Module, - chunkGroup: webpack.ChunkGroup - ): boolean; - isEntryModule(module: webpack.Module): boolean; - getModuleChunksIterable(module: webpack.Module): Iterable; - getOrderedModuleChunksIterable( - module: webpack.Module, - sortFn: (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1 - ): Iterable; - getModuleChunks(module: webpack.Module): Array; - getNumberOfModuleChunks(module: webpack.Module): number; - haveModulesEqualChunks( - moduleA: webpack.Module, - moduleB: webpack.Module - ): boolean; - getNumberOfChunkModules(chunk: webpack.Chunk): number; - getChunkModulesIterable(chunk: webpack.Chunk): Iterable; - getChunkModulesIterableBySourceType( - chunk: webpack.Chunk, - sourceType: string - ): Iterable; - getOrderedChunkModulesIterable( - chunk: webpack.Chunk, - comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 - ): Iterable; - getOrderedChunkModulesIterableBySourceType( - chunk: webpack.Chunk, - sourceType: string, - comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 - ): Iterable; - getChunkModules(chunk: webpack.Chunk): Array; - getOrderedChunkModules( - chunk: webpack.Chunk, - comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 - ): Array; - getChunkModuleMaps( - chunk: webpack.Chunk, - filterFn: (m: webpack.Module) => boolean, - includeAllChunks?: boolean - ): webpack.ChunkModuleMaps; - getChunkConditionMap( - chunk: webpack.Chunk, - filterFn: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean - ): Record; - hasModuleInChunk( - chunk: webpack.Chunk, - filterFn: (m: webpack.Module) => boolean - ): boolean; - hasModuleInGraph( - chunk: webpack.Chunk, - filterFn: (m: webpack.Module) => boolean, - filterChunkFn?: ( - c: webpack.Chunk, - chunkGraph: webpack.ChunkGraph - ) => boolean - ): boolean; - compareChunks(chunkA: webpack.Chunk, chunkB: webpack.Chunk): 0 | 1 | -1; - getChunkModulesSize(chunk: webpack.Chunk): number; - getChunkModulesSizes(chunk: webpack.Chunk): Record; - getChunkRootModules(chunk: webpack.Chunk): Array; - getChunkSize( - chunk: webpack.Chunk, - options?: webpack.ChunkSizeOptions - ): number; - getIntegratedChunksSize( - chunkA: webpack.Chunk, - chunkB: webpack.Chunk, - options?: webpack.ChunkSizeOptions - ): number; - canChunksBeIntegrated( - chunkA: webpack.Chunk, - chunkB: webpack.Chunk - ): boolean; - integrateChunks(chunkA: webpack.Chunk, chunkB: webpack.Chunk): void; - isEntryModuleInChunk(module: webpack.Module, chunk: webpack.Chunk): boolean; - connectChunkAndEntryModule( - chunk: webpack.Chunk, - module: webpack.Module, - entrypoint?: webpack.Entrypoint - ): void; - connectChunkAndRuntimeModule( - chunk: webpack.Chunk, - module: webpack.RuntimeModule - ): void; - disconnectChunkAndEntryModule( - chunk: webpack.Chunk, - module: webpack.Module - ): void; - disconnectChunkAndRuntimeModule( - chunk: webpack.Chunk, - module: webpack.RuntimeModule - ): void; - disconnectEntryModule(module: webpack.Module): void; - disconnectEntries(chunk: webpack.Chunk): void; - getNumberOfEntryModules(chunk: webpack.Chunk): number; - getNumberOfRuntimeModules(chunk: webpack.Chunk): number; - getChunkEntryModulesIterable( - chunk: webpack.Chunk - ): Iterable; - getChunkEntryDependentChunksIterable( - chunk: webpack.Chunk - ): Iterable; - hasChunkEntryDependentChunks(chunk: webpack.Chunk): boolean; - getChunkRuntimeModulesIterable( - chunk: webpack.Chunk - ): Iterable; - getChunkRuntimeModulesInOrder( - chunk: webpack.Chunk - ): Array; - getChunkEntryModulesWithChunkGroupIterable( - chunk: webpack.Chunk - ): Iterable<[webpack.Module, webpack.Entrypoint]>; - getBlockChunkGroup( - depBlock: webpack.AsyncDependenciesBlock - ): webpack.ChunkGroup; - connectBlockAndChunkGroup( - depBlock: webpack.AsyncDependenciesBlock, - chunkGroup: webpack.ChunkGroup - ): void; - disconnectChunkGroup(chunkGroup: webpack.ChunkGroup): void; - getModuleId(module: webpack.Module): string | number; - setModuleId(module: webpack.Module, id: string | number): void; - getModuleHash(module: webpack.Module): string; - getRenderedModuleHash(module: webpack.Module): string; - setModuleHashes( - module: webpack.Module, - hash: string, - renderedHash: string - ): void; - addModuleRuntimeRequirements( - module: webpack.Module, - items: Set - ): void; - addChunkRuntimeRequirements(chunk: webpack.Chunk, items: Set): void; - addTreeRuntimeRequirements( - chunk: webpack.Chunk, - items: Iterable - ): void; - getModuleRuntimeRequirements(module: webpack.Module): ReadonlySet; - getChunkRuntimeRequirements(chunk: webpack.Chunk): ReadonlySet; - getTreeRuntimeRequirements(chunk: webpack.Chunk): ReadonlySet; - static getChunkGraphForModule( - module: webpack.Module, - deprecateMessage: string, - deprecationCode: string - ): webpack.ChunkGraph; - static setChunkGraphForModule( - module: webpack.Module, - chunkGraph: webpack.ChunkGraph - ): void; - static getChunkGraphForChunk( - chunk: webpack.Chunk, - deprecateMessage: string, - deprecationCode: string - ): webpack.ChunkGraph; - static setChunkGraphForChunk( - chunk: webpack.Chunk, - chunkGraph: webpack.ChunkGraph - ): void; - } - export abstract class ChunkGroup { - groupDebugId: number; - options: { preloadOrder?: number; prefetchOrder?: number; name: string }; - chunks: Array; - origins: Array<{ - module: webpack.Module; - loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; - request: string; - }>; - index: number; - - /** - * when a new chunk is added to a chunkGroup, addingOptions will occur. - */ - addOptions(options: { - preloadOrder?: number; - prefetchOrder?: number; - name: string; - }): void; - - /** - * returns the name of current ChunkGroup - * - * - * sets a new name for current ChunkGroup - */ - name: string; - - /** - * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's - */ - readonly debugId: string; - - /** - * get a unique id for ChunkGroup, made up of its member Chunk id's - */ - readonly id: string; - - /** - * Performs an unshift of a specific chunk - */ - unshiftChunk(chunk: webpack.Chunk): boolean; - - /** - * inserts a chunk before another existing chunk in group - */ - insertChunk(chunk: webpack.Chunk, before: webpack.Chunk): boolean; - - /** - * add a chunk into ChunkGroup. Is pushed on or prepended - */ - pushChunk(chunk: webpack.Chunk): boolean; - replaceChunk(oldChunk: webpack.Chunk, newChunk: webpack.Chunk): boolean; - removeChunk(chunk: webpack.Chunk): boolean; - isInitial(): boolean; - addChild(group: webpack.ChunkGroup): boolean; - getChildren(): Array; - getNumberOfChildren(): number; - readonly childrenIterable: webpack.SortableSet; - removeChild(group: webpack.ChunkGroup): boolean; - addParent(parentChunk: webpack.ChunkGroup): boolean; - getParents(): Array; - getNumberOfParents(): number; - hasParent(parent: webpack.ChunkGroup): boolean; - readonly parentsIterable: webpack.SortableSet; - removeParent(chunkGroup: webpack.ChunkGroup): boolean; - getBlocks(): Array; - getNumberOfBlocks(): number; - hasBlock(block?: any): boolean; - readonly blocksIterable: Iterable; - addBlock(block: webpack.AsyncDependenciesBlock): boolean; - addOrigin( - module: webpack.Module, - loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, - request: string - ): void; - getFiles(): Array; - remove(): void; - sortItems(): void; - - /** - * Sorting predicate which allows current ChunkGroup to be compared against another. - * Sorting values are based off of number of chunks in ChunkGroup. - */ - compareTo( - chunkGraph: webpack.ChunkGraph, - otherGroup: webpack.ChunkGroup - ): 0 | 1 | -1; - getChildrenByOrders( - moduleGraph: webpack.ModuleGraph, - chunkGraph: webpack.ChunkGraph - ): Record>; - - /** - * Sets the top-down index of a module in this ChunkGroup - */ - setModulePreOrderIndex(module: webpack.Module, index: number): void; - - /** - * Gets the top-down index of a module in this ChunkGroup - */ - getModulePreOrderIndex(module: webpack.Module): number; - - /** - * Sets the bottom-up index of a module in this ChunkGroup - */ - setModulePostOrderIndex(module: webpack.Module, index: number): void; - - /** - * Gets the bottom-up index of a module in this ChunkGroup - */ - getModulePostOrderIndex(module: webpack.Module): number; - checkConstraints(): void; - getModuleIndex: (module: webpack.Module) => number; - getModuleIndex2: (module: webpack.Module) => number; - } - export interface ChunkHashContext { - /** - * the runtime template - */ - runtimeTemplate: webpack.RuntimeTemplate; - - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - } + }>; + index: number; /** - * Compare two Modules based on their ids for sorting + * when a new chunk is added to a chunkGroup, addingOptions will occur. */ - export interface ChunkMaps { - hash: Record; - contentHash: Record>; - name: Record; - } - export class ChunkModuleIdRangePlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export interface ChunkModuleMaps { - id: Record>; - hash: Record; - } - export interface ChunkPathData { - id: string | number; - name?: string; - hash: string; - hashWithLength?: (arg0: number) => string; - contentHash?: Record; - contentHashWithLength?: Record string>; - } - export interface ChunkSizeOptions { - /** - * constant overhead for a chunk - */ - chunkOverhead?: number; - - /** - * multiplicator for initial chunks - */ - entryChunkMultiplicator?: number; - } - export abstract class ChunkTemplate { - hooks: Readonly<{ - renderManifest: { tap: (options?: any, fn?: any) => void }; - modules: { tap: (options?: any, fn?: any) => void }; - render: { tap: (options?: any, fn?: any) => void }; - renderWithEntry: { tap: (options?: any, fn?: any) => void }; - hash: { tap: (options?: any, fn?: any) => void }; - hashForChunk: { tap: (options?: any, fn?: any) => void }; - }>; - readonly outputOptions: any; - } - export interface CodeGenerationContext { - /** - * the dependency templates - */ - dependencyTemplates: webpack.DependencyTemplates; - - /** - * the runtime template - */ - runtimeTemplate: webpack.RuntimeTemplate; - - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - } - export interface CodeGenerationResult { - /** - * the resulting sources for all source types - */ - sources: Map; - - /** - * the runtime requirements - */ - runtimeRequirements: ReadonlySet; - } - export class Compilation { - /** - * Creates an instance of Compilation. - */ - constructor(compiler: webpack.Compiler); - hooks: Readonly<{ - buildModule: SyncHook<[webpack.Module], void>; - rebuildModule: SyncHook<[webpack.Module], void>; - failedModule: SyncHook<[webpack.Module, webpack.WebpackError], void>; - succeedModule: SyncHook<[webpack.Module], void>; - stillValidModule: SyncHook<[webpack.Module], void>; - addEntry: SyncHook< - [ - webpack.Dependency, - { name: string } & Pick< - webpack.EntryDescriptionNormalized, - "filename" | "dependOn" | "library" - > - ], - void - >; - failedEntry: SyncHook< - [ - webpack.Dependency, - { name: string } & Pick< - webpack.EntryDescriptionNormalized, - "filename" | "dependOn" | "library" - >, - Error - ], - void - >; - succeedEntry: SyncHook< - [ - webpack.Dependency, - { name: string } & Pick< - webpack.EntryDescriptionNormalized, - "filename" | "dependOn" | "library" - >, - webpack.Module - ], - void - >; - dependencyReferencedExports: SyncWaterfallHook< - [Array>, webpack.Dependency] - >; - finishModules: AsyncSeriesHook<[Iterable]>; - finishRebuildingModule: AsyncSeriesHook<[webpack.Module]>; - unseal: SyncHook<[], void>; - seal: SyncHook<[], void>; - beforeChunks: SyncHook<[], void>; - afterChunks: SyncHook<[Iterable], void>; - optimizeDependencies: SyncBailHook<[Iterable], any>; - afterOptimizeDependencies: SyncHook<[Iterable], void>; - optimize: SyncHook<[], void>; - optimizeModules: SyncBailHook<[Iterable], any>; - afterOptimizeModules: SyncHook<[Iterable], void>; - optimizeChunks: SyncBailHook< - [Iterable, Array], - any - >; - afterOptimizeChunks: SyncHook< - [Iterable, Array], - void - >; - optimizeTree: AsyncSeriesHook< - [Iterable, Iterable] - >; - afterOptimizeTree: SyncHook< - [Iterable, Iterable], - void - >; - optimizeChunkModules: AsyncSeriesBailHook< - [Iterable, Iterable], - any - >; - afterOptimizeChunkModules: SyncHook< - [Iterable, Iterable], - void - >; - shouldRecord: SyncBailHook<[], boolean>; - additionalChunkRuntimeRequirements: SyncHook< - [webpack.Chunk, Set], - void - >; - runtimeRequirementInChunk: HookMap< - SyncBailHook<[webpack.Chunk, Set], any> - >; - additionalModuleRuntimeRequirements: SyncHook< - [webpack.Module, Set], - void - >; - runtimeRequirementInModule: HookMap< - SyncBailHook<[webpack.Module, Set], any> - >; - additionalTreeRuntimeRequirements: SyncHook< - [webpack.Chunk, Set], - void - >; - runtimeRequirementInTree: HookMap< - SyncBailHook<[webpack.Chunk, Set], any> - >; - runtimeModule: SyncHook<[webpack.RuntimeModule, webpack.Chunk], void>; - reviveModules: SyncHook<[Iterable, any], void>; - beforeModuleIds: SyncHook<[Iterable], void>; - moduleIds: SyncHook<[Iterable], void>; - optimizeModuleIds: SyncHook<[Iterable], void>; - afterOptimizeModuleIds: SyncHook<[Iterable], void>; - reviveChunks: SyncHook<[Iterable, any], void>; - beforeChunkIds: SyncHook<[Iterable], void>; - chunkIds: SyncHook<[Iterable], void>; - optimizeChunkIds: SyncHook<[Iterable], void>; - afterOptimizeChunkIds: SyncHook<[Iterable], void>; - recordModules: SyncHook<[Iterable, any], void>; - recordChunks: SyncHook<[Iterable, any], void>; - optimizeCodeGeneration: SyncHook<[Iterable], void>; - beforeModuleHash: SyncHook<[], void>; - afterModuleHash: SyncHook<[], void>; - beforeCodeGeneration: SyncHook<[], void>; - afterCodeGeneration: SyncHook<[], void>; - beforeRuntimeRequirements: SyncHook<[], void>; - afterRuntimeRequirements: SyncHook<[], void>; - beforeHash: SyncHook<[], void>; - contentHash: SyncHook<[webpack.Chunk], void>; - afterHash: SyncHook<[], void>; - recordHash: SyncHook<[any], void>; - record: SyncHook<[webpack.Compilation, any], void>; - beforeModuleAssets: SyncHook<[], void>; - shouldGenerateChunkAssets: SyncBailHook<[], boolean>; - beforeChunkAssets: SyncHook<[], void>; - additionalChunkAssets: SyncHook<[Iterable], void>; - additionalAssets: AsyncSeriesHook<[]>; - optimizeChunkAssets: AsyncSeriesHook<[Iterable]>; - afterOptimizeChunkAssets: SyncHook<[Iterable], void>; - optimizeAssets: AsyncSeriesHook<[Record]>; - afterOptimizeAssets: SyncHook<[Record], void>; - finishAssets: AsyncSeriesHook<[Record]>; - afterFinishAssets: SyncHook<[Record], void>; - needAdditionalSeal: SyncBailHook<[], boolean>; - afterSeal: AsyncSeriesHook<[]>; - renderManifest: SyncWaterfallHook< - [Array, webpack.RenderManifestOptions] - >; - fullHash: SyncHook<[webpack.Hash], void>; - chunkHash: SyncHook< - [webpack.Chunk, webpack.Hash, webpack.ChunkHashContext], - void - >; - moduleAsset: SyncHook<[webpack.Module, string], void>; - chunkAsset: SyncHook<[webpack.Chunk, string], void>; - assetPath: SyncWaterfallHook<[string, any, webpack.AssetInfo]>; - needAdditionalPass: SyncBailHook<[], boolean>; - childCompiler: SyncHook<[webpack.Compiler, string, number], void>; - log: SyncBailHook<[string, webpack.LogEntry], true>; - statsPreset: HookMap>; - statsNormalize: SyncHook<[any, any], void>; - statsFactory: SyncHook<[webpack.StatsFactory, any], void>; - statsPrinter: SyncHook<[webpack.StatsPrinter, any], void>; - readonly normalModuleLoader: SyncHook<[any, webpack.NormalModule], void>; - }>; + addOptions(options: { + preloadOrder?: number; + prefetchOrder?: number; name: string; - compiler: webpack.Compiler; - resolverFactory: webpack.ResolverFactory; - inputFileSystem: webpack.InputFileSystem; - fileSystemInfo: webpack.FileSystemInfo; - requestShortener: webpack.RequestShortener; - compilerPath: string; - cache: webpack.Cache; - logger: webpack.WebpackLogger; - options: webpack.WebpackOptionsNormalized; - outputOptions: webpack.OutputNormalized; - bail: boolean; - profile: boolean; - mainTemplate: webpack.MainTemplate; - chunkTemplate: webpack.ChunkTemplate; - runtimeTemplate: webpack.RuntimeTemplate; - moduleTemplates: { javascript: webpack.ModuleTemplate }; - moduleGraph: webpack.ModuleGraph; - chunkGraph: webpack.ChunkGraph; - codeGenerationResults: Map; - factorizeQueue: webpack.AsyncQueue< - webpack.FactorizeModuleOptions, - string, - webpack.Module - >; - addModuleQueue: webpack.AsyncQueue; - buildQueue: webpack.AsyncQueue< - webpack.Module, - webpack.Module, - webpack.Module - >; - rebuildQueue: webpack.AsyncQueue< - webpack.Module, - webpack.Module, - webpack.Module - >; - processDependenciesQueue: webpack.AsyncQueue< - webpack.Module, - webpack.Module, - webpack.Module - >; + }): void; - /** - * Modules in value are building during the build of Module in key. - * Means value blocking key from finishing. - * Needed to detect build cycles. - */ - creatingModuleDuringBuild: WeakMap>; - entries: Map; - entrypoints: Map; - chunks: Set; - chunkGroups: Array; - namedChunkGroups: Map; - namedChunks: Map; - modules: Set; - records: any; - additionalChunkAssets: Array; - assets: Record; - assetsInfo: Map; - errors: Array; - warnings: Array; - children: Array; - logging: Map>; - dependencyFactories: Map< - { new (...args: Array): webpack.Dependency }, - webpack.ModuleFactory - >; - dependencyTemplates: webpack.DependencyTemplates; - childrenCounters: {}; - usedChunkIds: Set; - usedModuleIds: Set; - needAdditionalPass: boolean; - builtModules: WeakSet; - emittedAssets: Set; - comparedForEmitAssets: Set; - fileDependencies: webpack.LazySet; - contextDependencies: webpack.LazySet; - missingDependencies: webpack.LazySet; - buildDependencies: webpack.LazySet; - compilationDependencies: { add: (item?: any) => webpack.LazySet }; - getStats(): webpack.Stats; - createStatsOptions(optionsOrPreset?: any, context?: {}): {}; - createStatsFactory(options?: any): webpack.StatsFactory; - createStatsPrinter(options?: any): webpack.StatsPrinter; - getLogger(name: string | (() => string)): webpack.WebpackLogger; - addModule( - module: webpack.Module, - callback: (err?: webpack.WebpackError, result?: webpack.Module) => void - ): void; + /** + * returns the name of current ChunkGroup + * + * + * sets a new name for current ChunkGroup + */ + name: string; - /** - * Fetches a module from a compilation by its identifier - */ - getModule(module: webpack.Module): webpack.Module; + /** + * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's + */ + readonly debugId: string; - /** - * Attempts to search for a module by its identifier - */ - findModule(identifier: string): webpack.Module; + /** + * get a unique id for ChunkGroup, made up of its member Chunk id's + */ + readonly id: string; - /** - * Schedules a build of the module object - */ - buildModule( - module: webpack.Module, - callback: (err?: webpack.WebpackError, result?: webpack.Module) => void - ): void; - processModuleDependencies( - module: webpack.Module, - callback: (err?: webpack.WebpackError, result?: webpack.Module) => void - ): void; - handleModuleCreation( - __0: webpack.HandleModuleCreationOptions, - callback: (err?: webpack.WebpackError, result?: webpack.Module) => void - ): void; - factorizeModule( - options: webpack.FactorizeModuleOptions, - callback: (err?: webpack.WebpackError, result?: webpack.Module) => void - ): void; - addModuleChain( - context: string, - dependency: webpack.Dependency, - callback: (err?: webpack.WebpackError, result?: webpack.Module) => void - ): void; - addEntry( - context: string, - entry: webpack.EntryDependency, - optionsOrName: - | string - | ({ name: string } & Pick< - webpack.EntryDescriptionNormalized, - "filename" | "dependOn" | "library" - >), - callback: (err?: webpack.WebpackError, result?: webpack.Module) => void - ): void; - rebuildModule( - module: webpack.Module, - callback: (err?: webpack.WebpackError, result?: webpack.Module) => void - ): void; - finish(callback?: any): void; - unseal(): void; - seal(callback: (err?: webpack.WebpackError) => void): void; - reportDependencyErrorsAndWarnings( - module: webpack.Module, - blocks: Array - ): void; - codeGeneration(): Map; - processRuntimeRequirements(entrypoints: Iterable): void; - addRuntimeModule(chunk: webpack.Chunk, module: webpack.RuntimeModule): void; - addChunkInGroup( - groupOptions: - | string - | { preloadOrder?: number; prefetchOrder?: number; name: string }, - module: webpack.Module, - loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, - request: string - ): webpack.ChunkGroup; + /** + * Performs an unshift of a specific chunk + */ + unshiftChunk(chunk: Chunk): boolean; - /** - * This method first looks to see if a name is provided for a new chunk, - * and first looks to see if any named chunks already exist and reuse that chunk instead. - */ - addChunk(name?: string): webpack.Chunk; - assignDepth(module: webpack.Module): void; - getDependencyReferencedExports( - dependency: webpack.Dependency - ): Array>; - removeReasonsOfDependencyBlock( - module: webpack.Module, - block: webpack.DependenciesBlockLike - ): void; - patchChunksAfterReasonRemoval( - module: webpack.Module, - chunk: webpack.Chunk - ): void; - removeChunkFromDependencies( - block: webpack.DependenciesBlock, - chunk: webpack.Chunk - ): void; - sortItemsWithChunkIds(): void; - summarizeDependencies(): void; - createModuleHashes(): void; - createHash(): void; - fullHash: string; - hash: string; - modifyHash(update: string): void; - emitAsset( - file: string, - source: webpack.Source, - assetInfo?: webpack.AssetInfo - ): void; - updateAsset( - file: string, - newSourceOrFunction: - | webpack.Source - | ((arg0: webpack.Source) => webpack.Source), - assetInfoUpdateOrFunction?: - | webpack.AssetInfo - | ((arg0: webpack.AssetInfo) => webpack.AssetInfo) - ): void; - getAssets(): Array; - getAsset(name: string): webpack.Asset; - clearAssets(): void; - createModuleAssets(): void; - getRenderManifest( - options: webpack.RenderManifestOptions - ): Array; - createChunkAssets(callback: (err?: webpack.WebpackError) => void): void; - getPath( - filename: - | string - | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), - data?: webpack.PathData - ): string; - getPathWithInfo( - filename: - | string - | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), - data?: webpack.PathData - ): { path: string; info: webpack.AssetInfo }; - getAssetPath( - filename: - | string - | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), - data: webpack.PathData - ): string; - getAssetPathWithInfo( - filename: - | string - | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), - data: webpack.PathData - ): { path: string; info: webpack.AssetInfo }; + /** + * inserts a chunk before another existing chunk in group + */ + insertChunk(chunk: Chunk, before: Chunk): boolean; - /** - * This function allows you to run another instance of webpack inside of webpack however as - * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins - * from parent (or top level compiler) and creates a child Compilation - */ - createChildCompiler( - name: string, - outputOptions: webpack.OutputNormalized, - plugins: Array - ): webpack.Compiler; - checkConstraints(): void; - } - export interface CompilationHooksAsyncWebAssemblyModulesPlugin { - renderModuleContent: SyncWaterfallHook< + /** + * add a chunk into ChunkGroup. Is pushed on or prepended + */ + pushChunk(chunk: Chunk): boolean; + replaceChunk(oldChunk: Chunk, newChunk: Chunk): boolean; + removeChunk(chunk: Chunk): boolean; + isInitial(): boolean; + addChild(group: ChunkGroup): boolean; + getChildren(): Array; + getNumberOfChildren(): number; + readonly childrenIterable: SortableSet; + removeChild(group: ChunkGroup): boolean; + addParent(parentChunk: ChunkGroup): boolean; + getParents(): Array; + getNumberOfParents(): number; + hasParent(parent: ChunkGroup): boolean; + readonly parentsIterable: SortableSet; + removeParent(chunkGroup: ChunkGroup): boolean; + getBlocks(): Array; + getNumberOfBlocks(): number; + hasBlock(block?: any): boolean; + readonly blocksIterable: Iterable; + addBlock(block: AsyncDependenciesBlock): boolean; + addOrigin( + module: Module, + loc: SyntheticDependencyLocation | RealDependencyLocation, + request: string + ): void; + getFiles(): Array; + remove(): void; + sortItems(): void; + + /** + * Sorting predicate which allows current ChunkGroup to be compared against another. + * Sorting values are based off of number of chunks in ChunkGroup. + */ + compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1; + getChildrenByOrders( + moduleGraph: ModuleGraph, + chunkGraph: ChunkGraph + ): Record>; + + /** + * Sets the top-down index of a module in this ChunkGroup + */ + setModulePreOrderIndex(module: Module, index: number): void; + + /** + * Gets the top-down index of a module in this ChunkGroup + */ + getModulePreOrderIndex(module: Module): number; + + /** + * Sets the bottom-up index of a module in this ChunkGroup + */ + setModulePostOrderIndex(module: Module, index: number): void; + + /** + * Gets the bottom-up index of a module in this ChunkGroup + */ + getModulePostOrderIndex(module: Module): number; + checkConstraints(): void; + getModuleIndex: (module: Module) => number; + getModuleIndex2: (module: Module) => number; +} +declare interface ChunkHashContext { + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; +} + +/** + * Compare two Modules based on their ids for sorting + */ +declare interface ChunkMaps { + hash: Record; + contentHash: Record>; + name: Record; +} +declare class ChunkModuleIdRangePlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface ChunkModuleMaps { + id: Record>; + hash: Record; +} +declare interface ChunkPathData { + id: string | number; + name?: string; + hash: string; + hashWithLength?: (arg0: number) => string; + contentHash?: Record; + contentHashWithLength?: Record string>; +} +declare interface ChunkSizeOptions { + /** + * constant overhead for a chunk + */ + chunkOverhead?: number; + + /** + * multiplicator for initial chunks + */ + entryChunkMultiplicator?: number; +} +declare abstract class ChunkTemplate { + hooks: Readonly<{ + renderManifest: { tap: (options?: any, fn?: any) => void }; + modules: { tap: (options?: any, fn?: any) => void }; + render: { tap: (options?: any, fn?: any) => void }; + renderWithEntry: { tap: (options?: any, fn?: any) => void }; + hash: { tap: (options?: any, fn?: any) => void }; + hashForChunk: { tap: (options?: any, fn?: any) => void }; + }>; + readonly outputOptions: any; +} +declare interface CodeGenerationContext { + /** + * the dependency templates + */ + dependencyTemplates: DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; +} +declare interface CodeGenerationResult { + /** + * the resulting sources for all source types + */ + sources: Map; + + /** + * the runtime requirements + */ + runtimeRequirements: ReadonlySet; +} +declare class Compilation { + /** + * Creates an instance of Compilation. + */ + constructor(compiler: Compiler); + hooks: Readonly<{ + buildModule: SyncHook<[Module], void>; + rebuildModule: SyncHook<[Module], void>; + failedModule: SyncHook<[Module, WebpackError], void>; + succeedModule: SyncHook<[Module], void>; + stillValidModule: SyncHook<[Module], void>; + addEntry: SyncHook< [ - webpack.Source, - webpack.Module, - webpack.RenderContextAsyncWebAssemblyModulesPlugin - ] - >; - } - export interface CompilationHooksJavascriptModulesPlugin { - renderModuleContent: SyncWaterfallHook< - [ - webpack.Source, - webpack.Module, - webpack.RenderContextJavascriptModulesPlugin - ] - >; - renderModuleContainer: SyncWaterfallHook< - [ - webpack.Source, - webpack.Module, - webpack.RenderContextJavascriptModulesPlugin - ] - >; - renderModulePackage: SyncWaterfallHook< - [ - webpack.Source, - webpack.Module, - webpack.RenderContextJavascriptModulesPlugin - ] - >; - renderChunk: SyncWaterfallHook< - [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] - >; - renderMain: SyncWaterfallHook< - [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] - >; - render: SyncWaterfallHook< - [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] - >; - renderRequire: SyncWaterfallHook<[string, webpack.RenderBootstrapContext]>; - chunkHash: SyncHook< - [webpack.Chunk, webpack.Hash, webpack.ChunkHashContext], + Dependency, + { name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + > + ], void >; - } - export interface CompilationParams { - normalModuleFactory: webpack.NormalModuleFactory; - contextModuleFactory: webpack.ContextModuleFactory; - } - export class Compiler { - constructor(context: string); - hooks: Readonly<{ - initialize: SyncHook<[], void>; - shouldEmit: SyncBailHook<[webpack.Compilation], boolean>; - done: AsyncSeriesHook<[webpack.Stats]>; - afterDone: SyncHook<[webpack.Stats], void>; - additionalPass: AsyncSeriesHook<[]>; - beforeRun: AsyncSeriesHook<[webpack.Compiler]>; - run: AsyncSeriesHook<[webpack.Compiler]>; - emit: AsyncSeriesHook<[webpack.Compilation]>; - assetEmitted: AsyncSeriesHook<[string, webpack.AssetEmittedInfo]>; - afterEmit: AsyncSeriesHook<[webpack.Compilation]>; - thisCompilation: SyncHook< - [webpack.Compilation, webpack.CompilationParams], - void - >; - compilation: SyncHook< - [webpack.Compilation, webpack.CompilationParams], - void - >; - normalModuleFactory: SyncHook<[webpack.NormalModuleFactory], void>; - contextModuleFactory: SyncHook<[webpack.ContextModuleFactory], void>; - beforeCompile: AsyncSeriesHook<[webpack.CompilationParams]>; - compile: SyncHook<[webpack.CompilationParams], void>; - make: AsyncParallelHook<[webpack.Compilation]>; - afterCompile: AsyncSeriesHook<[webpack.Compilation]>; - watchRun: AsyncSeriesHook<[webpack.Compiler]>; - failed: SyncHook<[Error], void>; - invalid: SyncHook<[string, string], void>; - watchClose: SyncHook<[], void>; - infrastructureLog: SyncBailHook<[string, string, Array], true>; - environment: SyncHook<[], void>; - afterEnvironment: SyncHook<[], void>; - afterPlugins: SyncHook<[webpack.Compiler], void>; - afterResolvers: SyncHook<[webpack.Compiler], void>; - entryOption: SyncBailHook< - [ - string, - ( - | (() => Promise) - | webpack.EntryStaticNormalized - ) - ], - boolean - >; - }>; - name: string; - parentCompilation: webpack.Compilation; - root: webpack.Compiler; - outputPath: string; - outputFileSystem: webpack.OutputFileSystem; - intermediateFileSystem: webpack.InputFileSystem & - webpack.OutputFileSystem & - webpack.IntermediateFileSystemExtras; - inputFileSystem: webpack.InputFileSystem; - watchFileSystem: any; - recordsInputPath: string; - recordsOutputPath: string; - records: {}; - managedPaths: Set; - immutablePaths: Set; - modifiedFiles: Set; - removedFiles: Set; - fileTimestamps: Map; - contextTimestamps: Map; - resolverFactory: webpack.ResolverFactory; - infrastructureLogger: any; - options: webpack.WebpackOptionsNormalized; - context: string; - requestShortener: webpack.RequestShortener; - cache: webpack.Cache; - compilerPath: string; - running: boolean; - watchMode: boolean; - getInfrastructureLogger( - name: string | (() => string) - ): webpack.WebpackLogger; - watch( - watchOptions: webpack.WatchOptions, - handler: webpack.CallbackCompiler - ): webpack.Watching; - run(callback: webpack.CallbackCompiler): void; - runAsChild( - callback: ( - err?: Error, - entries?: Array, - compilation?: webpack.Compilation - ) => any - ): void; - purgeInputFileSystem(): void; - emitAssets( - compilation: webpack.Compilation, - callback: webpack.CallbackCompiler - ): void; - emitRecords(callback: webpack.CallbackCompiler): void; - readRecords(callback: webpack.CallbackCompiler): void; - createChildCompiler( - compilation: webpack.Compilation, - compilerName: string, - compilerIndex: number, - outputOptions: webpack.OutputNormalized, - plugins: Array - ): webpack.Compiler; - isChild(): boolean; - createCompilation(): webpack.Compilation; - newCompilation(params: webpack.CompilationParams): webpack.Compilation; - createNormalModuleFactory(): webpack.NormalModuleFactory; - createContextModuleFactory(): webpack.ContextModuleFactory; - newCompilationParams(): { - normalModuleFactory: webpack.NormalModuleFactory; - contextModuleFactory: webpack.ContextModuleFactory; - }; - compile(callback: webpack.CallbackCompiler): void; - close(callback: webpack.CallbackCompiler): void; - } - export class ContextExclusionPlugin { - constructor(negativeMatcher: RegExp); - negativeMatcher: RegExp; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export abstract class ContextModuleFactory extends webpack.ModuleFactory { - hooks: Readonly<{ - beforeResolve: AsyncSeriesWaterfallHook<[any]>; - afterResolve: AsyncSeriesWaterfallHook<[any]>; - contextModuleFiles: SyncWaterfallHook<[Array]>; - alternatives: AsyncSeriesWaterfallHook<[Array]>; - }>; - resolverFactory: any; - resolveDependencies(fs?: any, options?: any, callback?: any): any; - } - export class ContextReplacementPlugin { - constructor( - resourceRegExp?: any, - newContentResource?: any, - newContentRecursive?: any, - newContentRegExp?: any - ); - resourceRegExp: any; - newContentCallback: any; - newContentResource: any; - newContentCreateContextMap: any; - newContentRecursive: any; - newContentRegExp: any; - apply(compiler?: any): void; - } - export type CrossOriginLoading = false | "anonymous" | "use-credentials"; - export type Declaration = - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration; - export class DefinePlugin { - /** - * Create a new define plugin - */ - constructor( - definitions: Record< - string, - | string - | number - | bigint - | boolean - | Function - | RegExp - | webpack.RuntimeValue - | { [index: string]: RecursiveArrayOrRecordDeclarations } - | Array - > - ); - definitions: Record< - string, - | string - | number - | bigint - | boolean - | Function - | RegExp - | webpack.RuntimeValue - | { [index: string]: RecursiveArrayOrRecordDeclarations } - | Array + failedEntry: SyncHook< + [ + Dependency, + { name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >, + Error + ], + void >; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - static runtimeValue(fn?: any, fileDependencies?: any): webpack.RuntimeValue; - } - export class DelegatedPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export abstract class DependenciesBlock { - dependencies: Array; - blocks: Array; - - /** - * Adds a DependencyBlock to DependencyBlock relationship. - * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting) - */ - addBlock(block: webpack.AsyncDependenciesBlock): void; - addDependency(dependency: webpack.Dependency): void; - removeDependency(dependency: webpack.Dependency): void; - - /** - * Removes all dependencies and blocks - */ - clearDependenciesAndBlocks(): void; - updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; - serialize(__0: { write: any }): void; - deserialize(__0: { read: any }): void; - } - export interface DependenciesBlockLike { - dependencies: Array; - blocks: Array; - } - export class Dependency { - constructor(); - weak: boolean; - optional: boolean; - loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; - readonly type: string; - getResourceIdentifier(): string; - getReference(moduleGraph: webpack.ModuleGraph): never; - - /** - * Returns list of exports referenced by this dependency - */ - getReferencedExports( - moduleGraph: webpack.ModuleGraph - ): Array>; - getCondition(moduleGraph: webpack.ModuleGraph): () => boolean; - - /** - * Returns the exported names - */ - getExports(moduleGraph: webpack.ModuleGraph): webpack.ExportsSpec; - - /** - * Returns warnings - */ - getWarnings(moduleGraph: webpack.ModuleGraph): Array; - - /** - * Returns errors - */ - getErrors(moduleGraph: webpack.ModuleGraph): Array; - updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; - - /** - * implement this method to allow the occurrence order plugin to count correctly - */ - getNumberOfIdOccurrences(): number; - serialize(__0: { write: any }): void; - deserialize(__0: { read: any }): void; - module: any; - readonly disconnect: any; - static NO_EXPORTS_REFERENCED: Array; - static NS_OBJECT_REFERENCED: Array>; - static DEFAULT_EXPORT_REFERENCED: Array>; - } - export abstract class DependencyTemplate { - apply( - dependency: webpack.Dependency, - source: webpack.ReplaceSource, - templateContext: webpack.DependencyTemplateContext - ): void; - } - export interface DependencyTemplateContext { - /** - * the runtime template - */ - runtimeTemplate: webpack.RuntimeTemplate; - - /** - * the dependency templates - */ - dependencyTemplates: webpack.DependencyTemplates; - - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - - /** - * the requirements for runtime - */ - runtimeRequirements: Set; - - /** - * current module - */ - module: webpack.Module; - - /** - * mutable array of init fragments for the current module - */ - initFragments: Array; - } - export abstract class DependencyTemplates { - get(dependency: { - new (...args: Array): webpack.Dependency; - }): webpack.DependencyTemplate; - set( - dependency: { new (...args: Array): webpack.Dependency }, - dependencyTemplate: webpack.DependencyTemplate - ): void; - updateHash(part: string): void; - getHash(): string; - clone(): webpack.DependencyTemplates; - } - export class DeterministicModuleIdsPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - - /** - * Options for the webpack-dev-server. - */ - export interface DevServer { - [index: string]: any; - } - export type DevTool = string | false; - export type DevtoolFallbackModuleFilenameTemplate = string | Function; - export class DllPlugin { - constructor(options: webpack.DllPluginOptions); - options: { - entryOnly: boolean; - /** - * Context of requests in the manifest file (defaults to the webpack context). - */ - context?: string; - /** - * If true, manifest json file (output) will be formatted. - */ - format?: boolean; - /** - * Name of the exposed dll function (external name, use value of 'output.library'). - */ - name?: string; - /** - * Absolute path to the manifest json file (output). - */ - path: string; - /** - * Type of the dll bundle (external type, use value of 'output.libraryTarget'). - */ - type?: string; - }; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - - /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - export interface DllPluginOptions { - /** - * Context of requests in the manifest file (defaults to the webpack context). - */ - context?: string; - - /** - * If true, only entry points will be exposed (default: true). - */ - entryOnly?: boolean; - - /** - * If true, manifest json file (output) will be formatted. - */ - format?: boolean; - - /** - * Name of the exposed dll function (external name, use value of 'output.library'). - */ - name?: string; - - /** - * Absolute path to the manifest json file (output). - */ - path: string; - - /** - * Type of the dll bundle (external type, use value of 'output.libraryTarget'). - */ - type?: string; - } - export class DllReferencePlugin { - constructor( - options: - | { - /** - * Context of requests in the manifest (or content property) as absolute path. - */ - context?: string; - /** - * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). - */ - extensions?: Array; - /** - * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. - */ - manifest: string | webpack.DllReferencePluginOptionsManifest; - /** - * The name where the dll is exposed (external name, defaults to manifest.name). - */ - name?: string; - /** - * Prefix which is used for accessing the content of the dll. - */ - scope?: string; - /** - * How the dll is exposed (libraryTarget, defaults to manifest.type). - */ - sourceType?: - | "var" - | "assign" - | "this" - | "window" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - /** - * The way how the export of the dll bundle is used. - */ - type?: "object" | "require"; - } - | { - /** - * The mappings from request to module info. - */ - content: webpack.DllReferencePluginOptionsContent; - /** - * Context of requests in the manifest (or content property) as absolute path. - */ - context?: string; - /** - * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). - */ - extensions?: Array; - /** - * The name where the dll is exposed (external name). - */ - name: string; - /** - * Prefix which is used for accessing the content of the dll. - */ - scope?: string; - /** - * How the dll is exposed (libraryTarget). - */ - sourceType?: - | "var" - | "assign" - | "this" - | "window" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - /** - * The way how the export of the dll bundle is used. - */ - type?: "object" | "require"; - } - ); - options: - | { - /** - * Context of requests in the manifest (or content property) as absolute path. - */ - context?: string; - /** - * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). - */ - extensions?: Array; - /** - * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. - */ - manifest: string | webpack.DllReferencePluginOptionsManifest; - /** - * The name where the dll is exposed (external name, defaults to manifest.name). - */ - name?: string; - /** - * Prefix which is used for accessing the content of the dll. - */ - scope?: string; - /** - * How the dll is exposed (libraryTarget, defaults to manifest.type). - */ - sourceType?: - | "var" - | "assign" - | "this" - | "window" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - /** - * The way how the export of the dll bundle is used. - */ - type?: "object" | "require"; - } - | { - /** - * The mappings from request to module info. - */ - content: webpack.DllReferencePluginOptionsContent; - /** - * Context of requests in the manifest (or content property) as absolute path. - */ - context?: string; - /** - * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). - */ - extensions?: Array; - /** - * The name where the dll is exposed (external name). - */ - name: string; - /** - * Prefix which is used for accessing the content of the dll. - */ - scope?: string; - /** - * How the dll is exposed (libraryTarget). - */ - sourceType?: - | "var" - | "assign" - | "this" - | "window" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - /** - * The way how the export of the dll bundle is used. - */ - type?: "object" | "require"; - }; - apply(compiler?: any): void; - } - export type DllReferencePluginOptions = - | { - /** - * Context of requests in the manifest (or content property) as absolute path. - */ - context?: string; - /** - * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). - */ - extensions?: Array; - /** - * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. - */ - manifest: string | webpack.DllReferencePluginOptionsManifest; - /** - * The name where the dll is exposed (external name, defaults to manifest.name). - */ - name?: string; - /** - * Prefix which is used for accessing the content of the dll. - */ - scope?: string; - /** - * How the dll is exposed (libraryTarget, defaults to manifest.type). - */ - sourceType?: - | "var" - | "assign" - | "this" - | "window" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - /** - * The way how the export of the dll bundle is used. - */ - type?: "object" | "require"; - } - | { - /** - * The mappings from request to module info. - */ - content: webpack.DllReferencePluginOptionsContent; - /** - * Context of requests in the manifest (or content property) as absolute path. - */ - context?: string; - /** - * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). - */ - extensions?: Array; - /** - * The name where the dll is exposed (external name). - */ - name: string; - /** - * Prefix which is used for accessing the content of the dll. - */ - scope?: string; - /** - * How the dll is exposed (libraryTarget). - */ - sourceType?: - | "var" - | "assign" - | "this" - | "window" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - /** - * The way how the export of the dll bundle is used. - */ - type?: "object" | "require"; - }; - - /** - * The mappings from request to module info. - */ - export interface DllReferencePluginOptionsContent { - [index: string]: { - /** - * Meta information about the module. - */ - buildMeta?: { [index: string]: any }; - /** - * Information about the provided exports of the module. - */ - exports?: true | Array; - /** - * Module ID. - */ - id: string | number; - }; - } - - /** - * An object containing content, name and type. - */ - export interface DllReferencePluginOptionsManifest { - /** - * The mappings from request to module info. - */ - content: webpack.DllReferencePluginOptionsContent; - - /** - * The name where the dll is exposed (external name). - */ - name?: string; - - /** - * The type how the dll is exposed (external type). - */ - type?: - | "var" - | "assign" - | "this" - | "window" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - } - export type DllReferencePluginOptionsSourceType = - | "var" - | "assign" - | "this" - | "window" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - export interface Effect { - type: string; - value: any; - } - export class EnableLibraryPlugin { - constructor( - type: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system" - ); - type: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - static checkEnabled( - compiler: webpack.Compiler, - type: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system" - ): void; - } - export type Entry = - | string - | (() => - | string - | webpack.EntryObject - | [string, string] - | Promise) - | webpack.EntryObject - | [string, string]; - export interface EntryData { - /** - * dependencies of the entrypoint - */ - dependencies: Array; - - /** - * options of the entrypoint - */ - options: { name: string } & Pick< - webpack.EntryDescriptionNormalized, - "filename" | "dependOn" | "library" + succeedEntry: SyncHook< + [ + Dependency, + { name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >, + Module + ], + void >; - } - export abstract class EntryDependency extends webpack.ModuleDependency {} + dependencyReferencedExports: SyncWaterfallHook< + [Array>, Dependency] + >; + finishModules: AsyncSeriesHook<[Iterable]>; + finishRebuildingModule: AsyncSeriesHook<[Module]>; + unseal: SyncHook<[], void>; + seal: SyncHook<[], void>; + beforeChunks: SyncHook<[], void>; + afterChunks: SyncHook<[Iterable], void>; + optimizeDependencies: SyncBailHook<[Iterable], any>; + afterOptimizeDependencies: SyncHook<[Iterable], void>; + optimize: SyncHook<[], void>; + optimizeModules: SyncBailHook<[Iterable], any>; + afterOptimizeModules: SyncHook<[Iterable], void>; + optimizeChunks: SyncBailHook<[Iterable, Array], any>; + afterOptimizeChunks: SyncHook<[Iterable, Array], void>; + optimizeTree: AsyncSeriesHook<[Iterable, Iterable]>; + afterOptimizeTree: SyncHook<[Iterable, Iterable], void>; + optimizeChunkModules: AsyncSeriesBailHook< + [Iterable, Iterable], + any + >; + afterOptimizeChunkModules: SyncHook< + [Iterable, Iterable], + void + >; + shouldRecord: SyncBailHook<[], boolean>; + additionalChunkRuntimeRequirements: SyncHook<[Chunk, Set], void>; + runtimeRequirementInChunk: HookMap], any>>; + additionalModuleRuntimeRequirements: SyncHook<[Module, Set], void>; + runtimeRequirementInModule: HookMap< + SyncBailHook<[Module, Set], any> + >; + additionalTreeRuntimeRequirements: SyncHook<[Chunk, Set], void>; + runtimeRequirementInTree: HookMap], any>>; + runtimeModule: SyncHook<[RuntimeModule, Chunk], void>; + reviveModules: SyncHook<[Iterable, any], void>; + beforeModuleIds: SyncHook<[Iterable], void>; + moduleIds: SyncHook<[Iterable], void>; + optimizeModuleIds: SyncHook<[Iterable], void>; + afterOptimizeModuleIds: SyncHook<[Iterable], void>; + reviveChunks: SyncHook<[Iterable, any], void>; + beforeChunkIds: SyncHook<[Iterable], void>; + chunkIds: SyncHook<[Iterable], void>; + optimizeChunkIds: SyncHook<[Iterable], void>; + afterOptimizeChunkIds: SyncHook<[Iterable], void>; + recordModules: SyncHook<[Iterable, any], void>; + recordChunks: SyncHook<[Iterable, any], void>; + optimizeCodeGeneration: SyncHook<[Iterable], void>; + beforeModuleHash: SyncHook<[], void>; + afterModuleHash: SyncHook<[], void>; + beforeCodeGeneration: SyncHook<[], void>; + afterCodeGeneration: SyncHook<[], void>; + beforeRuntimeRequirements: SyncHook<[], void>; + afterRuntimeRequirements: SyncHook<[], void>; + beforeHash: SyncHook<[], void>; + contentHash: SyncHook<[Chunk], void>; + afterHash: SyncHook<[], void>; + recordHash: SyncHook<[any], void>; + record: SyncHook<[Compilation, any], void>; + beforeModuleAssets: SyncHook<[], void>; + shouldGenerateChunkAssets: SyncBailHook<[], boolean>; + beforeChunkAssets: SyncHook<[], void>; + additionalChunkAssets: SyncHook<[Iterable], void>; + additionalAssets: AsyncSeriesHook<[]>; + optimizeChunkAssets: AsyncSeriesHook<[Iterable]>; + afterOptimizeChunkAssets: SyncHook<[Iterable], void>; + optimizeAssets: AsyncSeriesHook<[Record]>; + afterOptimizeAssets: SyncHook<[Record], void>; + finishAssets: AsyncSeriesHook<[Record]>; + afterFinishAssets: SyncHook<[Record], void>; + needAdditionalSeal: SyncBailHook<[], boolean>; + afterSeal: AsyncSeriesHook<[]>; + renderManifest: SyncWaterfallHook< + [Array, RenderManifestOptions] + >; + fullHash: SyncHook<[Hash], void>; + chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext], void>; + moduleAsset: SyncHook<[Module, string], void>; + chunkAsset: SyncHook<[Chunk, string], void>; + assetPath: SyncWaterfallHook<[string, any, AssetInfo]>; + needAdditionalPass: SyncBailHook<[], boolean>; + childCompiler: SyncHook<[Compiler, string, number], void>; + log: SyncBailHook<[string, LogEntry], true>; + statsPreset: HookMap>; + statsNormalize: SyncHook<[any, any], void>; + statsFactory: SyncHook<[StatsFactory, any], void>; + statsPrinter: SyncHook<[StatsPrinter, any], void>; + readonly normalModuleLoader: SyncHook<[any, NormalModule], void>; + }>; + name: string; + compiler: Compiler; + resolverFactory: ResolverFactory; + inputFileSystem: InputFileSystem; + fileSystemInfo: FileSystemInfo; + requestShortener: RequestShortener; + compilerPath: string; + cache: Cache; + logger: WebpackLogger; + options: WebpackOptionsNormalized; + outputOptions: OutputNormalized; + bail: boolean; + profile: boolean; + mainTemplate: MainTemplate; + chunkTemplate: ChunkTemplate; + runtimeTemplate: RuntimeTemplate; + moduleTemplates: { javascript: ModuleTemplate }; + moduleGraph: ModuleGraph; + chunkGraph: ChunkGraph; + codeGenerationResults: Map; + factorizeQueue: AsyncQueue; + addModuleQueue: AsyncQueue; + buildQueue: AsyncQueue; + rebuildQueue: AsyncQueue; + processDependenciesQueue: AsyncQueue; /** - * An object with entry point description. + * Modules in value are building during the build of Module in key. + * Means value blocking key from finishing. + * Needed to detect build cycles. */ - export interface EntryDescription { - /** - * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded. - */ - dependOn?: string | [string, string]; - - /** - * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. - */ - filename?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * Module(s) that are loaded upon startup. - */ - import: string | [string, string]; - - /** - * Options for library. - */ - library?: webpack.LibraryOptions; - } + creatingModuleDuringBuild: WeakMap>; + entries: Map; + entrypoints: Map; + chunks: Set; + chunkGroups: Array; + namedChunkGroups: Map; + namedChunks: Map; + modules: Set; + records: any; + additionalChunkAssets: Array; + assets: Record; + assetsInfo: Map; + errors: Array; + warnings: Array; + children: Array; + logging: Map>; + dependencyFactories: Map< + { new (...args: Array): Dependency }, + ModuleFactory + >; + dependencyTemplates: DependencyTemplates; + childrenCounters: {}; + usedChunkIds: Set; + usedModuleIds: Set; + needAdditionalPass: boolean; + builtModules: WeakSet; + emittedAssets: Set; + comparedForEmitAssets: Set; + fileDependencies: LazySet; + contextDependencies: LazySet; + missingDependencies: LazySet; + buildDependencies: LazySet; + compilationDependencies: { add: (item?: any) => LazySet }; + getStats(): Stats; + createStatsOptions(optionsOrPreset?: any, context?: {}): {}; + createStatsFactory(options?: any): StatsFactory; + createStatsPrinter(options?: any): StatsPrinter; + getLogger(name: string | (() => string)): WebpackLogger; + addModule( + module: Module, + callback: (err?: WebpackError, result?: Module) => void + ): void; /** - * An object with entry point description. + * Fetches a module from a compilation by its identifier */ - export interface EntryDescriptionNormalized { - /** - * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded. - */ - dependOn?: [string, string]; - - /** - * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. - */ - filename?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * Module(s) that are loaded upon startup. The last one is exported. - */ - import: [string, string]; - - /** - * Options for library. - */ - library?: webpack.LibraryOptions; - } - export type EntryItem = string | [string, string]; - export type EntryNormalized = - | (() => Promise) - | webpack.EntryStaticNormalized; + getModule(module: Module): Module; /** - * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object. + * Attempts to search for a module by its identifier */ - export interface EntryObject { - [index: string]: string | [string, string] | webpack.EntryDescription; - } - export class EntryPlugin { - /** - * An entry plugin which will handle - * creation of the EntryDependency - */ - constructor( - context: string, - entry: string, - options: - | string - | ({ name: string } & Pick< - webpack.EntryDescriptionNormalized, - "filename" | "dependOn" | "library" - >) - ); - context: string; - entry: string; - options: + findModule(identifier: string): Module; + + /** + * Schedules a build of the module object + */ + buildModule( + module: Module, + callback: (err?: WebpackError, result?: Module) => void + ): void; + processModuleDependencies( + module: Module, + callback: (err?: WebpackError, result?: Module) => void + ): void; + handleModuleCreation( + __0: HandleModuleCreationOptions, + callback: (err?: WebpackError, result?: Module) => void + ): void; + factorizeModule( + options: FactorizeModuleOptions, + callback: (err?: WebpackError, result?: Module) => void + ): void; + addModuleChain( + context: string, + dependency: Dependency, + callback: (err?: WebpackError, result?: Module) => void + ): void; + addEntry( + context: string, + entry: EntryDependency, + optionsOrName: | string | ({ name: string } & Pick< - webpack.EntryDescriptionNormalized, + EntryDescriptionNormalized, "filename" | "dependOn" | "library" - >); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - static createDependency( - entry: string, - options: - | string - | ({ name: string } & Pick< - webpack.EntryDescriptionNormalized, - "filename" | "dependOn" | "library" - >) - ): webpack.EntryDependency; - } - export type EntryStatic = string | webpack.EntryObject | [string, string]; + >), + callback: (err?: WebpackError, result?: Module) => void + ): void; + rebuildModule( + module: Module, + callback: (err?: WebpackError, result?: Module) => void + ): void; + finish(callback?: any): void; + unseal(): void; + seal(callback: (err?: WebpackError) => void): void; + reportDependencyErrorsAndWarnings( + module: Module, + blocks: Array + ): void; + codeGeneration(): Map; + processRuntimeRequirements(entrypoints: Iterable): void; + addRuntimeModule(chunk: Chunk, module: RuntimeModule): void; + addChunkInGroup( + groupOptions: + | string + | { preloadOrder?: number; prefetchOrder?: number; name: string }, + module: Module, + loc: SyntheticDependencyLocation | RealDependencyLocation, + request: string + ): ChunkGroup; /** - * Multiple entry bundles are created. The key is the entry name. The value is an entry description object. + * This method first looks to see if a name is provided for a new chunk, + * and first looks to see if any named chunks already exist and reuse that chunk instead. */ - export interface EntryStaticNormalized { - [index: string]: webpack.EntryDescriptionNormalized; - } - export abstract class Entrypoint extends webpack.ChunkGroup { - runtimeChunk: webpack.Chunk; + addChunk(name?: string): Chunk; + assignDepth(module: Module): void; + getDependencyReferencedExports(dependency: Dependency): Array>; + removeReasonsOfDependencyBlock( + module: Module, + block: DependenciesBlockLike + ): void; + patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void; + removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void; + sortItemsWithChunkIds(): void; + summarizeDependencies(): void; + createModuleHashes(): void; + createHash(): void; + fullHash: string; + hash: string; + modifyHash(update: string): void; + emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void; + updateAsset( + file: string, + newSourceOrFunction: Source | ((arg0: Source) => Source), + assetInfoUpdateOrFunction?: AssetInfo | ((arg0: AssetInfo) => AssetInfo) + ): void; + getAssets(): Array; + getAsset(name: string): Asset; + clearAssets(): void; + createModuleAssets(): void; + getRenderManifest(options: RenderManifestOptions): Array; + createChunkAssets(callback: (err?: WebpackError) => void): void; + getPath( + filename: string | ((arg0: PathData, arg1: AssetInfo) => string), + data?: PathData + ): string; + getPathWithInfo( + filename: string | ((arg0: PathData, arg1: AssetInfo) => string), + data?: PathData + ): { path: string; info: AssetInfo }; + getAssetPath( + filename: string | ((arg0: PathData, arg1: AssetInfo) => string), + data: PathData + ): string; + getAssetPathWithInfo( + filename: string | ((arg0: PathData, arg1: AssetInfo) => string), + data: PathData + ): { path: string; info: AssetInfo }; - /** - * Sets the runtimeChunk for an entrypoint. - */ - setRuntimeChunk(chunk: webpack.Chunk): void; + /** + * This function allows you to run another instance of webpack inside of webpack however as + * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins + * from parent (or top level compiler) and creates a child Compilation + */ + createChildCompiler( + name: string, + outputOptions: OutputNormalized, + plugins: Array + ): Compiler; + checkConstraints(): void; +} +declare interface CompilationHooksAsyncWebAssemblyModulesPlugin { + renderModuleContent: SyncWaterfallHook< + [Source, Module, RenderContextAsyncWebAssemblyModulesPlugin] + >; +} +declare interface CompilationHooksJavascriptModulesPlugin { + renderModuleContent: SyncWaterfallHook< + [Source, Module, RenderContextJavascriptModulesPlugin] + >; + renderModuleContainer: SyncWaterfallHook< + [Source, Module, RenderContextJavascriptModulesPlugin] + >; + renderModulePackage: SyncWaterfallHook< + [Source, Module, RenderContextJavascriptModulesPlugin] + >; + renderChunk: SyncWaterfallHook< + [Source, RenderContextJavascriptModulesPlugin] + >; + renderMain: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>; + render: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>; + renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>; + chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext], void>; +} +declare interface CompilationParams { + normalModuleFactory: NormalModuleFactory; + contextModuleFactory: ContextModuleFactory; +} +declare class Compiler { + constructor(context: string); + hooks: Readonly<{ + initialize: SyncHook<[], void>; + shouldEmit: SyncBailHook<[Compilation], boolean>; + done: AsyncSeriesHook<[Stats]>; + afterDone: SyncHook<[Stats], void>; + additionalPass: AsyncSeriesHook<[]>; + beforeRun: AsyncSeriesHook<[Compiler]>; + run: AsyncSeriesHook<[Compiler]>; + emit: AsyncSeriesHook<[Compilation]>; + assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>; + afterEmit: AsyncSeriesHook<[Compilation]>; + thisCompilation: SyncHook<[Compilation, CompilationParams], void>; + compilation: SyncHook<[Compilation, CompilationParams], void>; + normalModuleFactory: SyncHook<[NormalModuleFactory], void>; + contextModuleFactory: SyncHook<[ContextModuleFactory], void>; + beforeCompile: AsyncSeriesHook<[CompilationParams]>; + compile: SyncHook<[CompilationParams], void>; + make: AsyncParallelHook<[Compilation]>; + afterCompile: AsyncSeriesHook<[Compilation]>; + watchRun: AsyncSeriesHook<[Compiler]>; + failed: SyncHook<[Error], void>; + invalid: SyncHook<[string, string], void>; + watchClose: SyncHook<[], void>; + infrastructureLog: SyncBailHook<[string, string, Array], true>; + environment: SyncHook<[], void>; + afterEnvironment: SyncHook<[], void>; + afterPlugins: SyncHook<[Compiler], void>; + afterResolvers: SyncHook<[Compiler], void>; + entryOption: SyncBailHook<[string, EntryNormalized], boolean>; + }>; + name: string; + parentCompilation: Compilation; + root: Compiler; + outputPath: string; + outputFileSystem: OutputFileSystem; + intermediateFileSystem: InputFileSystem & + OutputFileSystem & + IntermediateFileSystemExtras; + inputFileSystem: InputFileSystem; + watchFileSystem: any; + recordsInputPath: string; + recordsOutputPath: string; + records: {}; + managedPaths: Set; + immutablePaths: Set; + modifiedFiles: Set; + removedFiles: Set; + fileTimestamps: Map; + contextTimestamps: Map; + resolverFactory: ResolverFactory; + infrastructureLogger: any; + options: WebpackOptionsNormalized; + context: string; + requestShortener: RequestShortener; + cache: Cache; + compilerPath: string; + running: boolean; + watchMode: boolean; + getInfrastructureLogger(name: string | (() => string)): WebpackLogger; + watch(watchOptions: WatchOptions, handler: CallbackFunction): Watching; + run(callback: CallbackFunction): void; + runAsChild( + callback: ( + err?: Error, + entries?: Array, + compilation?: Compilation + ) => any + ): void; + purgeInputFileSystem(): void; + emitAssets(compilation: Compilation, callback: CallbackFunction): void; + emitRecords(callback: CallbackFunction): void; + readRecords(callback: CallbackFunction): void; + createChildCompiler( + compilation: Compilation, + compilerName: string, + compilerIndex: number, + outputOptions: OutputNormalized, + plugins: Array + ): Compiler; + isChild(): boolean; + createCompilation(): Compilation; + newCompilation(params: CompilationParams): Compilation; + createNormalModuleFactory(): NormalModuleFactory; + createContextModuleFactory(): ContextModuleFactory; + newCompilationParams(): { + normalModuleFactory: NormalModuleFactory; + contextModuleFactory: ContextModuleFactory; + }; + compile(callback: CallbackFunction): void; + close(callback: CallbackFunction): void; +} - /** - * Fetches the chunk reference containing the webpack bootstrap code - */ - getRuntimeChunk(): webpack.Chunk; - } - export class EnvironmentPlugin { - constructor(...keys: Array); - keys: Array; - defaultValues: any; +/** + * Options object as provided by the user. + */ +declare interface Configuration { + /** + * Set the value of `require.amd` and `define.amd`. Or disable AMD support. + */ + amd?: Amd; - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export interface Etag { - toString: () => string; - } - export class EvalDevToolModulePlugin { - constructor(options?: any); - namespace: any; - sourceUrlComment: any; - moduleFilenameTemplate: any; + /** + * Report the first error as a hard error instead of tolerating it. + */ + bail?: boolean; - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export class EvalSourceMapDevToolPlugin { - constructor(options?: any); - sourceMapComment: any; - moduleFilenameTemplate: any; - namespace: any; - options: any; + /** + * Cache generated modules and chunks to improve performance for multiple incremental builds. + */ + cache?: CacheOptions; - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } + /** + * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. + */ + context?: string; + + /** + * References to other configurations to depend on. + */ + dependencies?: Array; + + /** + * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + */ + devtool?: DevTool; + + /** + * The entry point(s) of the compilation. + */ + entry?: Entry; /** * Enables/Disables experiments (experimental features with relax SemVer compatibility). */ - export interface Experiments { - /** - * Allow module type 'asset' to generate assets. - */ - asset?: boolean; - - /** - * Support WebAssembly as asynchronous EcmaScript Module. - */ - asyncWebAssembly?: boolean; - - /** - * Allow 'import/export' syntax to import async modules. - */ - importAsync?: boolean; - - /** - * Allow 'import/export await' syntax to import async modules. - */ - importAwait?: boolean; - - /** - * Support .mjs files as way to define strict ESM file (node.js). - */ - mjs?: boolean; - - /** - * Allow output javascript files as module source type. - */ - outputModule?: boolean; - - /** - * Support WebAssembly as synchronous EcmaScript Module (outdated). - */ - syncWebAssembly?: boolean; - - /** - * Allow using top-level-await in EcmaScript Modules. - */ - topLevelAwait?: boolean; - } - export class ExportInfo { - constructor(name: string, initFrom?: webpack.ExportInfo); - name: string; - usedName: string | typeof webpack.SKIP_OVER_NAME; - used: 0 | 1 | 2 | 3 | 4; - - /** - * true: it is provided - * false: it is not provided - * null: only the runtime knows if it is provided - * undefined: it was not determined if it is provided - */ - provided: boolean; - - /** - * true: it can be mangled - * false: is can not be mangled - * undefined: it was not determined if it can be mangled - */ - canMangleProvide: boolean; - - /** - * true: it can be mangled - * false: is can not be mangled - * undefined: it was not determined if it can be mangled - */ - canMangleUse: boolean; - exportsInfoOwned: boolean; - exportsInfo: webpack.ExportsInfo; - readonly canMangle: boolean; - getUsedName(fallbackName?: any): any; - createNestedExportsInfo(): webpack.ExportsInfo; - getNestedExportsInfo(): webpack.ExportsInfo; - getUsedInfo(): - | "used" - | "no usage info" - | "maybe used (runtime-defined)" - | "unused" - | "only properties used"; - getProvidedInfo(): - | "no provided info" - | "maybe provided (runtime-defined)" - | "provided" - | "not provided"; - getRenameInfo(): string; - } - export interface ExportSpec { - /** - * the name of the export - */ - name: string; - - /** - * can the export be renamed (defaults to true) - */ - canMangle?: boolean; - - /** - * nested exports - */ - exports?: Array; - - /** - * when reexported: from which module - */ - from?: webpack.Module; - - /** - * when reexported: from which export - */ - export?: Array; - } - export class ExportsInfo { - constructor(); - readonly ownedExports: Iterable; - readonly exports: Iterable; - readonly orderedExports: Iterable; - readonly otherExportsInfo: webpack.ExportInfo; - setRedirectNamedTo(exportsInfo?: any): void; - setHasProvideInfo(): void; - setHasUseInfo(): void; - getExportInfo(name: string): webpack.ExportInfo; - getReadOnlyExportInfo(name: string): webpack.ExportInfo; - getNestedExportsInfo(name?: Array): webpack.ExportsInfo; - setUnknownExportsProvided(canMangle?: boolean): boolean; - setUsedInUnknownWay(): boolean; - setAllKnownExportsUsed(): boolean; - setUsedForSideEffectsOnly(): boolean; - isUsed(): boolean; - getUsedExports(): any; - getProvidedExports(): true | Array; - isExportProvided(name: string | Array): boolean; - isExportUsed(name: string | Array): 0 | 1 | 2 | 3 | 4; - getUsedName(name: string | Array): string | false | Array; - getRestoreProvidedData(): any; - restoreProvided(__0: { - otherProvided: any; - otherCanMangleProvide: any; - exports: any; - }): void; - } - export interface ExportsSpec { - /** - * exported names, true for unknown exports or null for no exports - */ - exports: true | Array; - - /** - * can the export be renamed (defaults to true) - */ - canMangle?: boolean; - - /** - * module on which the result depends on - */ - dependencies?: Array; - } - export type Expression = - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression; - export type ExternalItem = - | string - | RegExp - | { - [index: string]: - | string - | boolean - | Array - | { [index: string]: any }; - } - | (( - context: string, - request: string, - callback: (err: Error, result: string) => void - ) => void); - export class ExternalModule extends webpack.Module { - constructor(request?: any, type?: any, userRequest?: any); - request: string | Array | Record>; - externalType: string; - userRequest: string; - getSourceString( - runtimeTemplate?: any, - moduleGraph?: any, - chunkGraph?: any - ): string; - } - export type Externals = - | string - | RegExp - | Array< - | string - | RegExp - | { - [index: string]: - | string - | boolean - | Array - | { [index: string]: any }; - } - | (( - context: string, - request: string, - callback: (err: Error, result: string) => void - ) => void) - > - | { - [index: string]: - | string - | boolean - | Array - | { [index: string]: any }; - } - | (( - context: string, - request: string, - callback: (err: Error, result: string) => void - ) => void); - export class ExternalsPlugin { - constructor(type?: any, externals?: any); - type: any; - externals: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export type ExternalsType = - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - export interface FactorizeModuleOptions { - currentProfile: webpack.ModuleProfile; - factory: webpack.ModuleFactory; - dependencies: Array; - originModule: webpack.Module; - context?: string; - } - export interface FallbackCacheGroup { - minSize: Record; - maxAsyncSize: Record; - maxInitialSize: Record; - automaticNameDelimiter: string; - } - export class FetchCompileWasmPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } + experiments?: Experiments; /** - * Options object for persistent file-based caching. + * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. */ - export interface FileCacheOptions { - /** - * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack'). - */ - buildDependencies?: { [index: string]: Array }; - - /** - * Base directory for the cache (defaults to node_modules/.cache/webpack). - */ - cacheDirectory?: string; - - /** - * Locations for the cache (defaults to cacheDirectory / name). - */ - cacheLocation?: string; - - /** - * Algorithm used for generation the hash (see node.js crypto package). - */ - hashAlgorithm?: string; - - /** - * Time in ms after which idle period the cache storing should happen (only for store: 'pack' or 'idle'). - */ - idleTimeout?: number; - - /** - * Time in ms after which idle period the initial cache storing should happen (only for store: 'pack' or 'idle'). - */ - idleTimeoutForInitialStore?: number; - - /** - * List of paths that are managed by a package manager and contain a version or hash in it's path so all files are immutable. - */ - immutablePaths?: Array; - - /** - * List of paths that are managed by a package manager and can be trusted to not be modified otherwise. - */ - managedPaths?: Array; - - /** - * Name for the cache. Different names will lead to different coexisting caches. - */ - name?: string; - - /** - * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file). - */ - store?: "pack"; - - /** - * Filesystem caching. - */ - type: "filesystem"; - - /** - * Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache. - */ - version?: string; - } - export abstract class FileSystemInfo { - fs: webpack.InputFileSystem; - logger: webpack.WebpackLogger; - fileTimestampQueue: webpack.AsyncQueue< - string, - string, - webpack.FileSystemInfoEntry - >; - fileHashQueue: webpack.AsyncQueue; - contextTimestampQueue: webpack.AsyncQueue< - string, - string, - webpack.FileSystemInfoEntry - >; - contextHashQueue: webpack.AsyncQueue; - managedItemQueue: webpack.AsyncQueue; - managedItemDirectoryQueue: webpack.AsyncQueue>; - managedPaths: Array; - managedPathsWithSlash: Array; - immutablePaths: Array; - immutablePathsWithSlash: Array; - addFileTimestamps( - map: Map - ): void; - addContextTimestamps( - map: Map - ): void; - getFileTimestamp( - path: string, - callback: ( - arg0: webpack.WebpackError, - arg1: webpack.FileSystemInfoEntry | "ignore" - ) => void - ): void; - getContextTimestamp( - path: string, - callback: ( - arg0: webpack.WebpackError, - arg1: webpack.FileSystemInfoEntry | "ignore" - ) => void - ): void; - getFileHash( - path: string, - callback: (arg0: webpack.WebpackError, arg1: string) => void - ): void; - getContextHash( - path: string, - callback: (arg0: webpack.WebpackError, arg1: string) => void - ): void; - resolveBuildDependencies( - context: string, - deps: Iterable, - callback: ( - arg0: Error, - arg1: webpack.ResolveBuildDependenciesResult - ) => void - ): void; - checkResolveResultsValid( - resolveResults: Map, - callback: (arg0: Error, arg1: boolean) => void - ): void; - createSnapshot( - startTime: number, - files: Iterable, - directories: Iterable, - missing: Iterable, - options: { - /** - * should use hash to snapshot - */ - hash?: boolean; - }, - callback: (arg0: webpack.WebpackError, arg1: webpack.Snapshot) => void - ): void; - mergeSnapshots( - snapshot1: webpack.Snapshot, - snapshot2: webpack.Snapshot - ): webpack.Snapshot; - checkSnapshotValid( - snapshot: webpack.Snapshot, - callback: (arg0: webpack.WebpackError, arg1: boolean) => void - ): void; - getDeprecatedFileTimestamps(): Map; - getDeprecatedContextTimestamps(): Map; - } + externals?: Externals; /** - * istanbul ignore next + * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value). */ - export interface FileSystemInfoEntry { - safeTime: number; - timestamp?: number; - timestampHash?: string; - } - export type Filename = - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - export type FilterItemTypes = string | RegExp | ((value: string) => boolean); - export type FilterTypes = - | string - | RegExp - | Array boolean)> - | ((value: string) => boolean); - export interface GenerateContext { - /** - * mapping from dependencies to templates - */ - dependencyTemplates: webpack.DependencyTemplates; - - /** - * the runtime template - */ - runtimeTemplate: webpack.RuntimeTemplate; - - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - - /** - * the requirements for runtime - */ - runtimeRequirements: Set; - - /** - * which kind of code should be generated - */ - type: string; - } - export class Generator { - constructor(); - getTypes(module: webpack.NormalModule): Set; - getSize(module: webpack.NormalModule, type?: string): number; - generate( - module: webpack.NormalModule, - __1: webpack.GenerateContext - ): webpack.Source; - updateHash(hash: webpack.Hash, __1: webpack.UpdateHashContext): void; - static byType(map?: any): webpack.ByTypeGenerator; - } - export interface HMRJavascriptParserHooks { - hotAcceptCallback: SyncBailHook<[any, Array], void>; - hotAcceptWithoutCallback: SyncBailHook<[any, Array], void>; - } - export interface HandleModuleCreationOptions { - factory: webpack.ModuleFactory; - dependencies: Array; - originModule: webpack.Module; - context?: string; - - /** - * recurse into dependencies of the created module - */ - recursive?: boolean; - } - export class Hash { - constructor(); - update(data: string | Buffer, inputEncoding?: string): webpack.Hash; - digest(encoding?: string): string | Buffer; - } - export type HashFunction = string | typeof webpack.Hash; - export class HashedModuleIdsPlugin { - constructor(options?: webpack.HashedModuleIdsPluginOptions); - options: webpack.HashedModuleIdsPluginOptions; - apply(compiler?: any): void; - } - - /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - export interface HashedModuleIdsPluginOptions { - /** - * The context directory for creating names. - */ - context?: string; - - /** - * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported. - */ - hashDigest?: "hex" | "latin1" | "base64"; - - /** - * The prefix length of the hash digest to use, defaults to 4. - */ - hashDigestLength?: number; - - /** - * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported. - */ - hashFunction?: string; - } - export class HotModuleReplacementPlugin { - constructor(options?: any); - options: any; - multiStep: any; - fullBuildTimeout: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - static getParserHooks( - parser: webpack.JavascriptParser - ): webpack.HMRJavascriptParserHooks; - } - export class IgnorePlugin { - constructor( - options: - | { - /** - * A RegExp to test the context (directory) against. - */ - contextRegExp?: RegExp; - /** - * A RegExp to test the request against. - */ - resourceRegExp?: RegExp; - } - | { - /** - * A filter function for resource and context. - */ - checkResource?: (resource: string, context: string) => boolean; - } - ); - options: - | { - /** - * A RegExp to test the context (directory) against. - */ - contextRegExp?: RegExp; - /** - * A RegExp to test the request against. - */ - resourceRegExp?: RegExp; - } - | { - /** - * A filter function for resource and context. - */ - checkResource?: (resource: string, context: string) => boolean; - }; - - /** - * Note that if "contextRegExp" is given, both the "resourceRegExp" - * and "contextRegExp" have to match. - */ - checkIgnore(resolveData: webpack.ResolveData): false; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export type IgnorePluginOptions = - | { - /** - * A RegExp to test the context (directory) against. - */ - contextRegExp?: RegExp; - /** - * A RegExp to test the request against. - */ - resourceRegExp?: RegExp; - } - | { - /** - * A filter function for resource and context. - */ - checkResource?: (resource: string, context: string) => boolean; - }; + externalsType?: ExternalsType; /** * Options for infrastructure level logging. */ - export interface InfrastructureLogging { - /** - * Enable debug logging for specific loggers. - */ - debug?: - | string - | boolean - | RegExp - | Array boolean)> - | ((value: string) => boolean); - - /** - * Log level. - */ - level?: "none" | "verbose" | "error" | "warn" | "info" | "log"; - } - export abstract class InitFragment { - content: string | webpack.Source; - stage: number; - position: number; - key: string; - endContent: string | webpack.Source; - getContent( - generateContext: webpack.GenerateContext - ): string | webpack.Source; - getEndContent( - generateContext: webpack.GenerateContext - ): string | webpack.Source; - merge: any; - } - export interface InputFileSystem { - readFile: ( - arg0: string, - arg1: (arg0: NodeJS.ErrnoException, arg1: Buffer) => void - ) => void; - readdir: ( - arg0: string, - arg1: (arg0: NodeJS.ErrnoException, arg1: Array) => void - ) => void; - stat: ( - arg0: string, - arg1: (arg0: NodeJS.ErrnoException, arg1: FsStats) => void - ) => void; - realpath?: ( - arg0: string, - arg1: (arg0: NodeJS.ErrnoException, arg1: string) => void - ) => void; - purge?: (arg0: string) => void; - join?: (arg0: string, arg1: string) => string; - relative?: (arg0: string, arg1: string) => string; - dirname?: (arg0: string) => string; - } - export interface IntermediateFileSystemExtras { - mkdirSync: (arg0: string) => void; - createWriteStream: (arg0: string) => WriteStream; - rename: ( - arg0: string, - arg1: string, - arg2: (arg0: NodeJS.ErrnoException) => void - ) => void; - } - export class JavascriptModulesPlugin { - constructor(options?: {}); - options: {}; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - renderModule( - module: webpack.Module, - renderContext: webpack.RenderContextJavascriptModulesPlugin, - hooks: webpack.CompilationHooksJavascriptModulesPlugin, - factory: boolean | "strict" - ): webpack.Source; - renderChunk( - renderContext: webpack.RenderContextJavascriptModulesPlugin, - hooks: webpack.CompilationHooksJavascriptModulesPlugin - ): webpack.Source; - renderMain( - renderContext: webpack.MainRenderContext, - hooks: webpack.CompilationHooksJavascriptModulesPlugin - ): webpack.Source; - renderBootstrap( - renderContext: webpack.RenderBootstrapContext, - hooks: webpack.CompilationHooksJavascriptModulesPlugin - ): { - header: Array; - startup: Array; - allowInlineStartup: boolean; - }; - renderRequire( - renderContext: webpack.RenderBootstrapContext, - hooks: webpack.CompilationHooksJavascriptModulesPlugin - ): string; - static getCompilationHooks( - compilation: webpack.Compilation - ): webpack.CompilationHooksJavascriptModulesPlugin; - static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any; - static chunkHasJs: ( - chunk: webpack.Chunk, - chunkGraph: webpack.ChunkGraph - ) => boolean; - } - export abstract class JavascriptParser extends webpack.Parser { - hooks: Readonly<{ - evaluateTypeof: HookMap< - SyncBailHook<[UnaryExpression], webpack.BasicEvaluatedExpression> - >; - evaluate: HookMap< - SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - webpack.BasicEvaluatedExpression - > - >; - evaluateIdentifier: HookMap< - SyncBailHook< - [ThisExpression | MemberExpression | Identifier], - webpack.BasicEvaluatedExpression - > - >; - evaluateDefinedIdentifier: HookMap< - SyncBailHook< - [ThisExpression | MemberExpression | Identifier], - webpack.BasicEvaluatedExpression - > - >; - evaluateCallExpressionMember: HookMap< - SyncBailHook< - [ - SimpleCallExpression | NewExpression, - webpack.BasicEvaluatedExpression - ], - webpack.BasicEvaluatedExpression - > - >; - preStatement: SyncBailHook< - [ - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - | ImportDeclaration - | ExportNamedDeclaration - | ExportDefaultDeclaration - | ExportAllDeclaration - ], - boolean | void - >; - blockPreStatement: SyncBailHook< - [ - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - | ImportDeclaration - | ExportNamedDeclaration - | ExportDefaultDeclaration - | ExportAllDeclaration - ], - boolean | void - >; - statement: SyncBailHook< - [ - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - | ImportDeclaration - | ExportNamedDeclaration - | ExportDefaultDeclaration - | ExportAllDeclaration - ], - boolean | void - >; - statementIf: SyncBailHook<[IfStatement], boolean | void>; - classExtendsExpression: SyncBailHook< - [ - ( - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ), - ClassExpression | ClassDeclaration - ], - boolean | void - >; - classBodyElement: SyncBailHook< - [MethodDefinition, ClassExpression | ClassDeclaration], - boolean | void - >; - label: HookMap>; - import: SyncBailHook< - [ - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ), - string | SimpleLiteral | RegExpLiteral - ], - boolean | void - >; - importSpecifier: SyncBailHook< - [ - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ), - string | SimpleLiteral | RegExpLiteral, - string, - string - ], - boolean | void - >; - export: SyncBailHook< - [ - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ], - boolean | void - >; - exportImport: SyncBailHook< - [ - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ), - string | SimpleLiteral | RegExpLiteral - ], - boolean | void - >; - exportDeclaration: SyncBailHook< - [ - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ), - FunctionDeclaration | VariableDeclaration | ClassDeclaration - ], - boolean | void - >; - exportExpression: SyncBailHook< - [ - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ), - FunctionDeclaration | VariableDeclaration | ClassDeclaration - ], - boolean | void - >; - exportSpecifier: SyncBailHook< - [ - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ), - string, - string, - number - ], - boolean | void - >; - exportImportSpecifier: SyncBailHook< - [ - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ), - string | SimpleLiteral | RegExpLiteral, - string, - string, - number - ], - boolean | void - >; - preDeclarator: SyncBailHook< - [ - VariableDeclarator, - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ) - ], - boolean | void - >; - declarator: SyncBailHook< - [ - VariableDeclarator, - ( - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration - ) - ], - boolean | void - >; - varDeclaration: HookMap< - SyncBailHook< - [FunctionDeclaration | VariableDeclaration | ClassDeclaration], - boolean | void - > - >; - varDeclarationLet: HookMap< - SyncBailHook< - [FunctionDeclaration | VariableDeclaration | ClassDeclaration], - boolean | void - > - >; - varDeclarationConst: HookMap< - SyncBailHook< - [FunctionDeclaration | VariableDeclaration | ClassDeclaration], - boolean | void - > - >; - varDeclarationVar: HookMap< - SyncBailHook< - [FunctionDeclaration | VariableDeclaration | ClassDeclaration], - boolean | void - > - >; - pattern: HookMap>; - canRename: HookMap< - SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - > - >; - rename: HookMap< - SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - > - >; - assign: HookMap>; - assignMemberChain: HookMap< - SyncBailHook<[AssignmentExpression, Array], boolean | void> - >; - typeof: HookMap< - SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - > - >; - importCall: SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - >; - topLevelAwait: SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - >; - call: HookMap< - SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - > - >; - callMemberChain: HookMap< - SyncBailHook< - [ - ( - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ), - Array - ], - boolean | void - > - >; - memberChainOfCallMemberChain: HookMap< - SyncBailHook< - [ - ( - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ), - Array, - SimpleCallExpression | NewExpression, - Array - ], - boolean | void - > - >; - callMemberChainOfCallMemberChain: HookMap< - SyncBailHook< - [ - ( - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ), - Array, - SimpleCallExpression | NewExpression, - Array - ], - boolean | void - > - >; - new: HookMap< - SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - > - >; - expression: HookMap< - SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - > - >; - expressionMemberChain: HookMap< - SyncBailHook< - [ - ( - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ), - Array - ], - boolean | void - > - >; - expressionConditionalOperator: SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - >; - expressionLogicalOperator: SyncBailHook< - [ - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ], - boolean | void - >; - program: SyncBailHook<[Program, Array], boolean | void>; - finish: SyncBailHook<[Program, Array], boolean | void>; - }>; - options: any; - sourceType: "module" | "script" | "auto"; - scope: webpack.ScopeInfo; - state: Record & webpack.ParserStateBase; - comments: any; - semicolons: any; - statementEndPos: any; - lastStatementEndPos: any; - statementStartPos: any; - currentTagData: any; - initializeEvaluating(): void; - getRenameIdentifier(expr?: any): any; - walkClass(classy: ClassExpression | ClassDeclaration): void; - walkMethodDefinition(methodDefinition?: any): void; - preWalkStatements(statements?: any): void; - blockPreWalkStatements(statements?: any): void; - walkStatements(statements?: any): void; - preWalkStatement(statement?: any): void; - blockPreWalkStatement(statement?: any): void; - walkStatement(statement?: any): void; - preWalkBlockStatement(statement?: any): void; - walkBlockStatement(statement?: any): void; - walkExpressionStatement(statement?: any): void; - preWalkIfStatement(statement?: any): void; - walkIfStatement(statement?: any): void; - preWalkLabeledStatement(statement?: any): void; - walkLabeledStatement(statement?: any): void; - preWalkWithStatement(statement?: any): void; - walkWithStatement(statement?: any): void; - preWalkSwitchStatement(statement?: any): void; - walkSwitchStatement(statement?: any): void; - walkTerminatingStatement(statement?: any): void; - walkReturnStatement(statement?: any): void; - walkThrowStatement(statement?: any): void; - preWalkTryStatement(statement?: any): void; - walkTryStatement(statement?: any): void; - preWalkWhileStatement(statement?: any): void; - walkWhileStatement(statement?: any): void; - preWalkDoWhileStatement(statement?: any): void; - walkDoWhileStatement(statement?: any): void; - preWalkForStatement(statement?: any): void; - walkForStatement(statement?: any): void; - preWalkForInStatement(statement?: any): void; - walkForInStatement(statement?: any): void; - preWalkForOfStatement(statement?: any): void; - walkForOfStatement(statement?: any): void; - preWalkFunctionDeclaration(statement?: any): void; - walkFunctionDeclaration(statement?: any): void; - blockPreWalkImportDeclaration(statement?: any): void; - enterDeclaration(declaration?: any, onIdent?: any): void; - blockPreWalkExportNamedDeclaration(statement?: any): void; - walkExportNamedDeclaration(statement?: any): void; - blockPreWalkExportDefaultDeclaration(statement?: any): void; - walkExportDefaultDeclaration(statement?: any): void; - blockPreWalkExportAllDeclaration(statement?: any): void; - preWalkVariableDeclaration(statement?: any): void; - blockPreWalkVariableDeclaration(statement?: any): void; - walkVariableDeclaration(statement?: any): void; - blockPreWalkClassDeclaration(statement?: any): void; - walkClassDeclaration(statement?: any): void; - preWalkSwitchCases(switchCases?: any): void; - walkSwitchCases(switchCases?: any): void; - preWalkCatchClause(catchClause?: any): void; - walkCatchClause(catchClause?: any): void; - walkPattern(pattern?: any): void; - walkAssignmentPattern(pattern?: any): void; - walkObjectPattern(pattern?: any): void; - walkArrayPattern(pattern?: any): void; - walkRestElement(pattern?: any): void; - walkExpressions(expressions?: any): void; - walkExpression(expression?: any): void; - walkAwaitExpression(expression?: any): void; - walkArrayExpression(expression?: any): void; - walkSpreadElement(expression?: any): void; - walkObjectExpression(expression?: any): void; - walkFunctionExpression(expression?: any): void; - walkArrowFunctionExpression(expression?: any): void; - walkSequenceExpression(expression?: any): void; - walkUpdateExpression(expression?: any): void; - walkUnaryExpression(expression?: any): void; - walkLeftRightExpression(expression?: any): void; - walkBinaryExpression(expression?: any): void; - walkLogicalExpression(expression?: any): void; - walkAssignmentExpression(expression?: any): void; - walkConditionalExpression(expression?: any): void; - walkNewExpression(expression?: any, args?: any): void; - walkYieldExpression(expression?: any): void; - walkTemplateLiteral(expression?: any): void; - walkTaggedTemplateExpression(expression?: any): void; - walkClassExpression(expression?: any): void; - walkImportExpression(expression?: any): void; - walkCallExpression(expression?: any, args?: any): void; - walkMemberExpression(expression?: any): void; - walkMemberExpressionWithExpressionName( - expression?: any, - name?: any, - rootInfo?: any, - members?: any - ): void; - walkThisExpression(expression?: any): void; - walkIdentifier(expression?: any): void; - callHooksForExpression(hookMap: any, expr: any, ...args: Array): any; - callHooksForExpressionWithFallback( - hookMap: HookMap>, - expr: MemberExpression, - fallback: ( - arg0: string, - arg1: string | webpack.ScopeInfo | webpack.VariableInfo, - arg2: () => Array - ) => any, - defined: (arg0: string) => any, - ...args: AsArray - ): R; - callHooksForName( - hookMap: HookMap>, - name: string, - ...args: AsArray - ): R; - callHooksForInfo( - hookMap: HookMap>, - info: string | webpack.ScopeInfo | webpack.VariableInfo, - ...args: AsArray - ): R; - callHooksForInfoWithFallback( - hookMap: HookMap>, - info: string | webpack.ScopeInfo | webpack.VariableInfo, - fallback: (arg0: string) => any, - defined: () => any, - ...args: AsArray - ): R; - callHooksForNameWithFallback( - hookMap: HookMap>, - name: string, - fallback: (arg0: string) => any, - defined: () => any, - ...args: AsArray - ): R; - inScope(params: any, fn: () => void): void; - inFunctionScope(hasThis?: any, params?: any, fn?: any): void; - inBlockScope(fn?: any): void; - detectMode(statements?: any): void; - enterPatterns(patterns?: any, onIdent?: any): void; - enterPattern(pattern?: any, onIdent?: any): void; - enterIdentifier(pattern?: any, onIdent?: any): void; - enterObjectPattern(pattern?: any, onIdent?: any): void; - enterArrayPattern(pattern?: any, onIdent?: any): void; - enterRestElement(pattern?: any, onIdent?: any): void; - enterAssignmentPattern(pattern?: any, onIdent?: any): void; - evaluateExpression( - expression: - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - ): webpack.BasicEvaluatedExpression; - parseString(expression?: any): any; - parseCalculatedString(expression?: any): any; - evaluate(source?: any): webpack.BasicEvaluatedExpression; - getComments(range?: any): any; - isAsiPosition(pos?: any): any; - getTagData(name?: any, tag?: any): any; - tagVariable(name?: any, tag?: any, data?: any): void; - defineVariable(name?: any): void; - undefineVariable(name?: any): void; - isVariableDefined(name?: any): boolean; - getVariableInfo( - name: string - ): string | webpack.ScopeInfo | webpack.VariableInfo; - setVariable( - name: string, - variableInfo: string | webpack.ScopeInfo | webpack.VariableInfo - ): void; - parseCommentOptions(range?: any): { options: any; errors: any }; - extractMemberExpressionChain( - expression: MemberExpression - ): { - members: Array; - object: - | UnaryExpression - | ThisExpression - | ArrayExpression - | ObjectExpression - | FunctionExpression - | ArrowFunctionExpression - | YieldExpression - | SimpleLiteral - | RegExpLiteral - | UpdateExpression - | BinaryExpression - | AssignmentExpression - | LogicalExpression - | MemberExpression - | ConditionalExpression - | SimpleCallExpression - | NewExpression - | SequenceExpression - | TemplateLiteral - | TaggedTemplateExpression - | ClassExpression - | MetaProperty - | Identifier - | AwaitExpression - | Super; - }; - getFreeInfoFromVariable( - varName: string - ): { name: string; info: string | webpack.VariableInfo }; - getMemberExpressionInfo( - expression: MemberExpression, - allowedTypes: Array<"expression" | "call"> - ): - | { - type: "call"; - call: SimpleCallExpression | NewExpression; - calleeName: string; - rootInfo: string | webpack.VariableInfo; - getCalleeMembers: () => Array; - name: string; - getMembers: () => Array; - } - | { - type: "expression"; - rootInfo: string | webpack.VariableInfo; - name: string; - getMembers: () => Array; - }; - getNameForExpression( - expression: MemberExpression - ): { - name: string; - rootInfo: string | webpack.ScopeInfo | webpack.VariableInfo; - getMembers: () => Array; - }; - } - export interface JsonpCompilationPluginHooks { - jsonpScript: SyncWaterfallHook<[string, webpack.Chunk, string]>; - linkPreload: SyncWaterfallHook<[string, webpack.Chunk, string]>; - linkPrefetch: SyncWaterfallHook<[string, webpack.Chunk, string]>; - } - export type JsonpScriptType = false | "module" | "text/javascript"; - export class JsonpTemplatePlugin { - constructor(); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - static getCompilationHooks( - compilation: webpack.Compilation - ): webpack.JsonpCompilationPluginHooks; - } - export interface KnownBuildMeta { - moduleArgument?: string; - exportsArgument?: string; - strict?: boolean; - moduleConcatenationBailout?: string; - exportsType?: "default" | "namespace" | "flagged"; - defaultObject?: boolean | "redirect" | "redirect-warn"; - strictHarmonyModule?: boolean; - async?: boolean; - } - export abstract class LazySet { - readonly size: number; - add(item: T): webpack.LazySet; - addAll(iterable: webpack.LazySet | Iterable): webpack.LazySet; - clear(): void; - delete(value: T): boolean; - entries(): IterableIterator<[T, T]>; - forEach( - callbackFn: (arg0: T, arg1: T, arg2: Set) => void, - thisArg?: any - ): void; - has(item: T): boolean; - keys(): IterableIterator; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator; - readonly [Symbol.toStringTag]: string; - serialize(__0: { write: any }): void; - } - export interface LibIdentOptions { - /** - * absolute context path to which lib ident is relative to - */ - context: string; - - /** - * object for caching - */ - associatedObjectForCache?: any; - } - export class LibManifestPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export type Library = - | string - | Array - | webpack.LibraryCustomUmdObject - | webpack.LibraryOptions; - export interface LibraryContext { - compilation: webpack.Compilation; - options: T; - } - - /** - * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`. - */ - export interface LibraryCustomUmdCommentObject { - /** - * Set comment for `amd` section in UMD. - */ - amd?: string; - - /** - * Set comment for `commonjs` (exports) section in UMD. - */ - commonjs?: string; - - /** - * Set comment for `commonjs2` (module.exports) section in UMD. - */ - commonjs2?: string; - - /** - * Set comment for `root` (global variable) section in UMD. - */ - root?: string; - } - - /** - * Description object for all UMD variants of the library name. - */ - export interface LibraryCustomUmdObject { - /** - * Name of the exposed AMD library in the UMD. - */ - amd?: string; - - /** - * Name of the exposed commonjs export in the UMD. - */ - commonjs?: string; - - /** - * Name of the property exposed globally by a UMD library. - */ - root?: string | Array; - } - export type LibraryExport = string | Array; - export type LibraryName = - | string - | Array - | webpack.LibraryCustomUmdObject; - - /** - * Options for library. - */ - export interface LibraryOptions { - /** - * Add a comment in the UMD wrapper. - */ - auxiliaryComment?: string | webpack.LibraryCustomUmdCommentObject; - - /** - * Specify which export should be exposed as library. - */ - export?: string | Array; - - /** - * The name of the library (some types allow unnamed libraries too). - */ - name?: string | Array | webpack.LibraryCustomUmdObject; - - /** - * Type of library. - */ - type: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - - /** - * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module. - */ - umdNamedDefine?: boolean; - } - export class LibraryTemplatePlugin { - constructor( - name: string | Array | webpack.LibraryCustomUmdObject, - target: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system", - umdNamedDefine: boolean, - auxiliaryComment: string | webpack.LibraryCustomUmdCommentObject, - exportProperty: string | Array - ); - library: { - type: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - name: string | Array | webpack.LibraryCustomUmdObject; - umdNamedDefine: boolean; - auxiliaryComment: string | webpack.LibraryCustomUmdCommentObject; - export: string | Array; - }; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export class LimitChunkCountPlugin { - constructor(options?: webpack.LimitChunkCountPluginOptions); - options: webpack.LimitChunkCountPluginOptions; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - - /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - export interface LimitChunkCountPluginOptions { - /** - * Constant overhead for a chunk. - */ - chunkOverhead?: number; - - /** - * Multiplicator for initial chunks. - */ - entryChunkMultiplicator?: number; - - /** - * Limit the maximum number of chunks using a value greater greater than or equal to 1. - */ - maxChunks: number; - } + infrastructureLogging?: InfrastructureLogging; /** * Custom values available in the loader context. */ - export interface Loader { - [index: string]: any; - } - export interface LoaderItem { - loader: string; - options: any; - ident: string; - } - export class LoaderOptionsPlugin { - constructor(options?: webpack.LoaderOptionsPluginOptions); - options: webpack.LoaderOptionsPluginOptions; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } + loader?: Loader; /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update + * Enable production optimizations or development hints. */ - export interface LoaderOptionsPluginOptions { - [index: string]: any; + mode?: Mode; - /** - * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3. - */ - debug?: boolean; + /** + * Options affecting the normal modules (`NormalModuleFactory`). + */ + module?: ModuleOptions; - /** - * Where loaders can be switched to minimize mode. - */ - minimize?: boolean; + /** + * Name of the configuration. Used when loading multiple configurations. + */ + name?: string; + /** + * Include polyfills or mocks for various node stuff. + */ + node?: Node; + + /** + * Enables/Disables integrated optimizations. + */ + optimization?: Optimization; + + /** + * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. + */ + output?: Output; + + /** + * The number of parallel processed modules in the compilation. + */ + parallelism?: number; + + /** + * Configuration for web performance recommendations. + */ + performance?: Performance; + + /** + * Add additional plugins to the compiler. + */ + plugins?: Array< + ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance + >; + + /** + * Capture timing information for each module. + */ + profile?: boolean; + + /** + * Store compiler state to a json file. + */ + recordsInputPath?: DevTool; + + /** + * Load compiler state from a json file. + */ + recordsOutputPath?: DevTool; + + /** + * Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined. + */ + recordsPath?: DevTool; + + /** + * Options for the resolver. + */ + resolve?: ResolveOptions; + + /** + * Options for the resolver when resolving loaders. + */ + resolveLoader?: ResolveOptions; + + /** + * Stats options object or preset name. + */ + stats?: StatsValue; + + /** + * Environment to build for. + */ + target?: Target; + + /** + * Enter watch mode, which rebuilds on file change. + */ + watch?: boolean; + + /** + * Options for the watcher. + */ + watchOptions?: WatchOptions; +} +declare class ContextExclusionPlugin { + constructor(negativeMatcher: RegExp); + negativeMatcher: RegExp; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare abstract class ContextModuleFactory extends ModuleFactory { + hooks: Readonly<{ + beforeResolve: AsyncSeriesWaterfallHook<[any]>; + afterResolve: AsyncSeriesWaterfallHook<[any]>; + contextModuleFiles: SyncWaterfallHook<[Array]>; + alternatives: AsyncSeriesWaterfallHook<[Array]>; + }>; + resolverFactory: any; + resolveDependencies(fs?: any, options?: any, callback?: any): any; +} +declare class ContextReplacementPlugin { + constructor( + resourceRegExp?: any, + newContentResource?: any, + newContentRecursive?: any, + newContentRegExp?: any + ); + resourceRegExp: any; + newContentCallback: any; + newContentResource: any; + newContentCreateContextMap: any; + newContentRecursive: any; + newContentRegExp: any; + apply(compiler?: any): void; +} +type CrossOriginLoading = false | "anonymous" | "use-credentials"; +type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration; +declare class DefinePlugin { + /** + * Create a new define plugin + */ + constructor(definitions: Record); + definitions: Record; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + static runtimeValue(fn?: any, fileDependencies?: any): RuntimeValue; +} +declare class DelegatedPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare abstract class DependenciesBlock { + dependencies: Array; + blocks: Array; + + /** + * Adds a DependencyBlock to DependencyBlock relationship. + * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting) + */ + addBlock(block: AsyncDependenciesBlock): void; + addDependency(dependency: Dependency): void; + removeDependency(dependency: Dependency): void; + + /** + * Removes all dependencies and blocks + */ + clearDependenciesAndBlocks(): void; + updateHash(hash: Hash, chunkGraph: ChunkGraph): void; + serialize(__0: { write: any }): void; + deserialize(__0: { read: any }): void; +} +declare interface DependenciesBlockLike { + dependencies: Array; + blocks: Array; +} +declare class Dependency { + constructor(); + weak: boolean; + optional: boolean; + loc: SyntheticDependencyLocation | RealDependencyLocation; + readonly type: string; + getResourceIdentifier(): string; + getReference(moduleGraph: ModuleGraph): never; + + /** + * Returns list of exports referenced by this dependency + */ + getReferencedExports(moduleGraph: ModuleGraph): Array>; + getCondition(moduleGraph: ModuleGraph): () => boolean; + + /** + * Returns the exported names + */ + getExports(moduleGraph: ModuleGraph): ExportsSpec; + + /** + * Returns warnings + */ + getWarnings(moduleGraph: ModuleGraph): Array; + + /** + * Returns errors + */ + getErrors(moduleGraph: ModuleGraph): Array; + updateHash(hash: Hash, chunkGraph: ChunkGraph): void; + + /** + * implement this method to allow the occurrence order plugin to count correctly + */ + getNumberOfIdOccurrences(): number; + serialize(__0: { write: any }): void; + deserialize(__0: { read: any }): void; + module: any; + readonly disconnect: any; + static NO_EXPORTS_REFERENCED: Array; + static NS_OBJECT_REFERENCED: Array>; + static DEFAULT_EXPORT_REFERENCED: Array>; +} +declare abstract class DependencyTemplate { + apply( + dependency: Dependency, + source: ReplaceSource, + templateContext: DependencyTemplateContext + ): void; +} +declare interface DependencyTemplateContext { + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the dependency templates + */ + dependencyTemplates: DependencyTemplates; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + + /** + * the requirements for runtime + */ + runtimeRequirements: Set; + + /** + * current module + */ + module: Module; + + /** + * mutable array of init fragments for the current module + */ + initFragments: Array; +} +declare abstract class DependencyTemplates { + get(dependency: { + new (...args: Array): Dependency; + }): DependencyTemplate; + set( + dependency: { new (...args: Array): Dependency }, + dependencyTemplate: DependencyTemplate + ): void; + updateHash(part: string): void; + getHash(): string; + clone(): DependencyTemplates; +} +declare class DeterministicModuleIdsPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * Options for the webpack-dev-server. + */ +declare interface DevServer { + [index: string]: any; +} +type DevTool = string | false; +type DevtoolFallbackModuleFilenameTemplate = string | Function; +declare class DllPlugin { + constructor(options: DllPluginOptions); + options: { + entryOnly: boolean; /** - * A configuration object that can be used to configure older loaders. + * Context of requests in the manifest file (defaults to the webpack context). */ - options?: { - [index: string]: any; + context?: string; + /** + * If true, manifest json file (output) will be formatted. + */ + format?: boolean; + /** + * Name of the exposed dll function (external name, use value of 'output.library'). + */ + name?: string; + /** + * Absolute path to the manifest json file (output). + */ + path: string; + /** + * Type of the dll bundle (external type, use value of 'output.libraryTarget'). + */ + type?: string; + }; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface DllPluginOptions { + /** + * Context of requests in the manifest file (defaults to the webpack context). + */ + context?: string; + + /** + * If true, only entry points will be exposed (default: true). + */ + entryOnly?: boolean; + + /** + * If true, manifest json file (output) will be formatted. + */ + format?: boolean; + + /** + * Name of the exposed dll function (external name, use value of 'output.library'). + */ + name?: string; + + /** + * Absolute path to the manifest json file (output). + */ + path: string; + + /** + * Type of the dll bundle (external type, use value of 'output.libraryTarget'). + */ + type?: string; +} +declare class DllReferencePlugin { + constructor(options: DllReferencePluginOptions); + options: DllReferencePluginOptions; + apply(compiler?: any): void; +} +type DllReferencePluginOptions = + | { /** - * The context that can be used to configure older loaders. + * Context of requests in the manifest (or content property) as absolute path. */ context?: string; + /** + * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). + */ + extensions?: Array; + /** + * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. + */ + manifest: string | DllReferencePluginOptionsManifest; + /** + * The name where the dll is exposed (external name, defaults to manifest.name). + */ + name?: string; + /** + * Prefix which is used for accessing the content of the dll. + */ + scope?: string; + /** + * How the dll is exposed (libraryTarget, defaults to manifest.type). + */ + sourceType?: DllReferencePluginOptionsSourceType; + /** + * The way how the export of the dll bundle is used. + */ + type?: "object" | "require"; + } + | { + /** + * The mappings from request to module info. + */ + content: DllReferencePluginOptionsContent; + /** + * Context of requests in the manifest (or content property) as absolute path. + */ + context?: string; + /** + * Extensions used to resolve modules in the dll bundle (only used when using 'scope'). + */ + extensions?: Array; + /** + * The name where the dll is exposed (external name). + */ + name: string; + /** + * Prefix which is used for accessing the content of the dll. + */ + scope?: string; + /** + * How the dll is exposed (libraryTarget). + */ + sourceType?: DllReferencePluginOptionsSourceType; + /** + * The way how the export of the dll bundle is used. + */ + type?: "object" | "require"; + }; + +/** + * The mappings from request to module info. + */ +declare interface DllReferencePluginOptionsContent { + [index: string]: { + /** + * Meta information about the module. + */ + buildMeta?: { [index: string]: any }; + /** + * Information about the provided exports of the module. + */ + exports?: true | Array; + /** + * Module ID. + */ + id: string | number; + }; +} + +/** + * An object containing content, name and type. + */ +declare interface DllReferencePluginOptionsManifest { + /** + * The mappings from request to module info. + */ + content: DllReferencePluginOptionsContent; + + /** + * The name where the dll is exposed (external name). + */ + name?: string; + + /** + * The type how the dll is exposed (external type). + */ + type?: DllReferencePluginOptionsSourceType; +} +type DllReferencePluginOptionsSourceType = + | "var" + | "assign" + | "this" + | "window" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; +declare interface Effect { + type: string; + value: any; +} +declare class EnableLibraryPlugin { + constructor(type: ExternalsType); + type: ExternalsType; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + static checkEnabled(compiler: Compiler, type: ExternalsType): void; +} +type Entry = + | string + | (() => string | EntryObject | [string, string] | Promise) + | EntryObject + | [string, string]; +declare interface EntryData { + /** + * dependencies of the entrypoint + */ + dependencies: Array; + + /** + * options of the entrypoint + */ + options: { name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >; +} +declare abstract class EntryDependency extends ModuleDependency {} + +/** + * An object with entry point description. + */ +declare interface EntryDescription { + /** + * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded. + */ + dependOn?: string | [string, string]; + + /** + * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. + */ + filename?: Filename; + + /** + * Module(s) that are loaded upon startup. + */ + import: EntryItem; + + /** + * Options for library. + */ + library?: LibraryOptions; +} + +/** + * An object with entry point description. + */ +declare interface EntryDescriptionNormalized { + /** + * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded. + */ + dependOn?: [string, string]; + + /** + * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. + */ + filename?: Filename; + + /** + * Module(s) that are loaded upon startup. The last one is exported. + */ + import: [string, string]; + + /** + * Options for library. + */ + library?: LibraryOptions; +} +type EntryItem = string | [string, string]; +type EntryNormalized = + | (() => Promise) + | EntryStaticNormalized; + +/** + * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object. + */ +declare interface EntryObject { + [index: string]: string | [string, string] | EntryDescription; +} +declare class EntryPlugin { + /** + * An entry plugin which will handle + * creation of the EntryDependency + */ + constructor( + context: string, + entry: string, + options: + | string + | ({ name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >) + ); + context: string; + entry: string; + options: + | string + | ({ name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >); + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + static createDependency( + entry: string, + options: + | string + | ({ name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >) + ): EntryDependency; +} +type EntryStatic = string | EntryObject | [string, string]; + +/** + * Multiple entry bundles are created. The key is the entry name. The value is an entry description object. + */ +declare interface EntryStaticNormalized { + [index: string]: EntryDescriptionNormalized; +} +declare abstract class Entrypoint extends ChunkGroup { + runtimeChunk: Chunk; + + /** + * Sets the runtimeChunk for an entrypoint. + */ + setRuntimeChunk(chunk: Chunk): void; + + /** + * Fetches the chunk reference containing the webpack bootstrap code + */ + getRuntimeChunk(): Chunk; +} +declare class EnvironmentPlugin { + constructor(...keys: Array); + keys: Array; + defaultValues: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface Etag { + toString: () => string; +} +declare class EvalDevToolModulePlugin { + constructor(options?: any); + namespace: any; + sourceUrlComment: any; + moduleFilenameTemplate: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class EvalSourceMapDevToolPlugin { + constructor(options?: any); + sourceMapComment: any; + moduleFilenameTemplate: any; + namespace: any; + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * Enables/Disables experiments (experimental features with relax SemVer compatibility). + */ +declare interface Experiments { + /** + * Allow module type 'asset' to generate assets. + */ + asset?: boolean; + + /** + * Support WebAssembly as asynchronous EcmaScript Module. + */ + asyncWebAssembly?: boolean; + + /** + * Allow 'import/export' syntax to import async modules. + */ + importAsync?: boolean; + + /** + * Allow 'import/export await' syntax to import async modules. + */ + importAwait?: boolean; + + /** + * Support .mjs files as way to define strict ESM file (node.js). + */ + mjs?: boolean; + + /** + * Allow output javascript files as module source type. + */ + outputModule?: boolean; + + /** + * Support WebAssembly as synchronous EcmaScript Module (outdated). + */ + syncWebAssembly?: boolean; + + /** + * Allow using top-level-await in EcmaScript Modules. + */ + topLevelAwait?: boolean; +} +declare class ExportInfo { + constructor(name: string, initFrom?: ExportInfo); + name: string; + usedName: string | typeof SKIP_OVER_NAME; + used: 0 | 1 | 2 | 3 | 4; + + /** + * true: it is provided + * false: it is not provided + * null: only the runtime knows if it is provided + * undefined: it was not determined if it is provided + */ + provided: boolean; + + /** + * true: it can be mangled + * false: is can not be mangled + * undefined: it was not determined if it can be mangled + */ + canMangleProvide: boolean; + + /** + * true: it can be mangled + * false: is can not be mangled + * undefined: it was not determined if it can be mangled + */ + canMangleUse: boolean; + exportsInfoOwned: boolean; + exportsInfo: ExportsInfo; + readonly canMangle: boolean; + getUsedName(fallbackName?: any): any; + createNestedExportsInfo(): ExportsInfo; + getNestedExportsInfo(): ExportsInfo; + getUsedInfo(): + | "used" + | "no usage info" + | "maybe used (runtime-defined)" + | "unused" + | "only properties used"; + getProvidedInfo(): + | "no provided info" + | "maybe provided (runtime-defined)" + | "provided" + | "not provided"; + getRenameInfo(): string; +} +declare interface ExportSpec { + /** + * the name of the export + */ + name: string; + + /** + * can the export be renamed (defaults to true) + */ + canMangle?: boolean; + + /** + * nested exports + */ + exports?: Array; + + /** + * when reexported: from which module + */ + from?: Module; + + /** + * when reexported: from which export + */ + export?: Array; +} +declare class ExportsInfo { + constructor(); + readonly ownedExports: Iterable; + readonly exports: Iterable; + readonly orderedExports: Iterable; + readonly otherExportsInfo: ExportInfo; + setRedirectNamedTo(exportsInfo?: any): void; + setHasProvideInfo(): void; + setHasUseInfo(): void; + getExportInfo(name: string): ExportInfo; + getReadOnlyExportInfo(name: string): ExportInfo; + getNestedExportsInfo(name?: Array): ExportsInfo; + setUnknownExportsProvided(canMangle?: boolean): boolean; + setUsedInUnknownWay(): boolean; + setAllKnownExportsUsed(): boolean; + setUsedForSideEffectsOnly(): boolean; + isUsed(): boolean; + getUsedExports(): any; + getProvidedExports(): true | Array; + isExportProvided(name: string | Array): boolean; + isExportUsed(name: string | Array): 0 | 1 | 2 | 3 | 4; + getUsedName(name: string | Array): string | false | Array; + getRestoreProvidedData(): any; + restoreProvided(__0: { + otherProvided: any; + otherCanMangleProvide: any; + exports: any; + }): void; +} +declare interface ExportsSpec { + /** + * exported names, true for unknown exports or null for no exports + */ + exports: true | Array; + + /** + * can the export be renamed (defaults to true) + */ + canMangle?: boolean; + + /** + * module on which the result depends on + */ + dependencies?: Array; +} +type Expression = + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression; +type ExternalItem = + | string + | RegExp + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void); +declare class ExternalModule extends Module { + constructor(request?: any, type?: any, userRequest?: any); + request: string | Array | Record>; + externalType: string; + userRequest: string; + getSourceString( + runtimeTemplate?: any, + moduleGraph?: any, + chunkGraph?: any + ): string; +} +type Externals = + | string + | RegExp + | Array + | { + [index: string]: + | string + | boolean + | Array + | { [index: string]: any }; + } + | (( + context: string, + request: string, + callback: (err: Error, result: string) => void + ) => void); +declare class ExternalsPlugin { + constructor(type?: any, externals?: any); + type: any; + externals: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +type ExternalsType = + | "var" + | "module" + | "assign" + | "this" + | "window" + | "self" + | "global" + | "commonjs" + | "commonjs2" + | "commonjs-module" + | "amd" + | "amd-require" + | "umd" + | "umd2" + | "jsonp" + | "system"; +declare interface FactorizeModuleOptions { + currentProfile: ModuleProfile; + factory: ModuleFactory; + dependencies: Array; + originModule: Module; + context?: string; +} +declare interface FallbackCacheGroup { + minSize: Record; + maxAsyncSize: Record; + maxInitialSize: Record; + automaticNameDelimiter: string; +} +declare class FetchCompileWasmPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * Options object for persistent file-based caching. + */ +declare interface FileCacheOptions { + /** + * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack'). + */ + buildDependencies?: { [index: string]: Array }; + + /** + * Base directory for the cache (defaults to node_modules/.cache/webpack). + */ + cacheDirectory?: string; + + /** + * Locations for the cache (defaults to cacheDirectory / name). + */ + cacheLocation?: string; + + /** + * Algorithm used for generation the hash (see node.js crypto package). + */ + hashAlgorithm?: string; + + /** + * Time in ms after which idle period the cache storing should happen (only for store: 'pack' or 'idle'). + */ + idleTimeout?: number; + + /** + * Time in ms after which idle period the initial cache storing should happen (only for store: 'pack' or 'idle'). + */ + idleTimeoutForInitialStore?: number; + + /** + * List of paths that are managed by a package manager and contain a version or hash in it's path so all files are immutable. + */ + immutablePaths?: Array; + + /** + * List of paths that are managed by a package manager and can be trusted to not be modified otherwise. + */ + managedPaths?: Array; + + /** + * Name for the cache. Different names will lead to different coexisting caches. + */ + name?: string; + + /** + * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file). + */ + store?: "pack"; + + /** + * Filesystem caching. + */ + type: "filesystem"; + + /** + * Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache. + */ + version?: string; +} +declare abstract class FileSystemInfo { + fs: InputFileSystem; + logger: WebpackLogger; + fileTimestampQueue: AsyncQueue; + fileHashQueue: AsyncQueue; + contextTimestampQueue: AsyncQueue; + contextHashQueue: AsyncQueue; + managedItemQueue: AsyncQueue; + managedItemDirectoryQueue: AsyncQueue>; + managedPaths: Array; + managedPathsWithSlash: Array; + immutablePaths: Array; + immutablePathsWithSlash: Array; + addFileTimestamps(map: Map): void; + addContextTimestamps(map: Map): void; + getFileTimestamp( + path: string, + callback: (arg0: WebpackError, arg1: FileSystemInfoEntry | "ignore") => void + ): void; + getContextTimestamp( + path: string, + callback: (arg0: WebpackError, arg1: FileSystemInfoEntry | "ignore") => void + ): void; + getFileHash( + path: string, + callback: (arg0: WebpackError, arg1: string) => void + ): void; + getContextHash( + path: string, + callback: (arg0: WebpackError, arg1: string) => void + ): void; + resolveBuildDependencies( + context: string, + deps: Iterable, + callback: (arg0: Error, arg1: ResolveBuildDependenciesResult) => void + ): void; + checkResolveResultsValid( + resolveResults: Map, + callback: (arg0: Error, arg1: boolean) => void + ): void; + createSnapshot( + startTime: number, + files: Iterable, + directories: Iterable, + missing: Iterable, + options: { + /** + * should use hash to snapshot + */ + hash?: boolean; + }, + callback: (arg0: WebpackError, arg1: Snapshot) => void + ): void; + mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot; + checkSnapshotValid( + snapshot: Snapshot, + callback: (arg0: WebpackError, arg1: boolean) => void + ): void; + getDeprecatedFileTimestamps(): Map; + getDeprecatedContextTimestamps(): Map; +} + +/** + * istanbul ignore next + */ +declare interface FileSystemInfoEntry { + safeTime: number; + timestamp?: number; + timestampHash?: string; +} +type Filename = string | ((pathData: PathData, assetInfo: AssetInfo) => string); +type FilterItemTypes = string | RegExp | ((value: string) => boolean); +type FilterTypes = + | string + | RegExp + | Array + | ((value: string) => boolean); +declare interface GenerateContext { + /** + * mapping from dependencies to templates + */ + dependencyTemplates: DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + + /** + * the requirements for runtime + */ + runtimeRequirements: Set; + + /** + * which kind of code should be generated + */ + type: string; +} +declare class Generator { + constructor(); + getTypes(module: NormalModule): Set; + getSize(module: NormalModule, type?: string): number; + generate(module: NormalModule, __1: GenerateContext): Source; + updateHash(hash: Hash, __1: UpdateHashContext): void; + static byType(map?: any): ByTypeGenerator; +} +declare interface HMRJavascriptParserHooks { + hotAcceptCallback: SyncBailHook<[any, Array], void>; + hotAcceptWithoutCallback: SyncBailHook<[any, Array], void>; +} +declare interface HandleModuleCreationOptions { + factory: ModuleFactory; + dependencies: Array; + originModule: Module; + context?: string; + + /** + * recurse into dependencies of the created module + */ + recursive?: boolean; +} +declare class Hash { + constructor(); + update(data: string | Buffer, inputEncoding?: string): Hash; + digest(encoding?: string): string | Buffer; +} +type HashFunction = string | typeof Hash; +declare class HashedModuleIdsPlugin { + constructor(options?: HashedModuleIdsPluginOptions); + options: HashedModuleIdsPluginOptions; + apply(compiler?: any): void; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface HashedModuleIdsPluginOptions { + /** + * The context directory for creating names. + */ + context?: string; + + /** + * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported. + */ + hashDigest?: "hex" | "latin1" | "base64"; + + /** + * The prefix length of the hash digest to use, defaults to 4. + */ + hashDigestLength?: number; + + /** + * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported. + */ + hashFunction?: string; +} +declare class HotModuleReplacementPlugin { + constructor(options?: any); + options: any; + multiStep: any; + fullBuildTimeout: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks; +} +declare class IgnorePlugin { + constructor(options: IgnorePluginOptions); + options: IgnorePluginOptions; + + /** + * Note that if "contextRegExp" is given, both the "resourceRegExp" + * and "contextRegExp" have to match. + */ + checkIgnore(resolveData: ResolveData): false; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +type IgnorePluginOptions = + | { + /** + * A RegExp to test the context (directory) against. + */ + contextRegExp?: RegExp; + /** + * A RegExp to test the request against. + */ + resourceRegExp?: RegExp; + } + | { + /** + * A filter function for resource and context. + */ + checkResource?: (resource: string, context: string) => boolean; + }; + +/** + * Options for infrastructure level logging. + */ +declare interface InfrastructureLogging { + /** + * Enable debug logging for specific loggers. + */ + debug?: + | string + | boolean + | RegExp + | Array + | ((value: string) => boolean); + + /** + * Log level. + */ + level?: "none" | "verbose" | "error" | "warn" | "info" | "log"; +} +declare abstract class InitFragment { + content: string | Source; + stage: number; + position: number; + key: string; + endContent: string | Source; + getContent(generateContext: GenerateContext): string | Source; + getEndContent(generateContext: GenerateContext): string | Source; + merge: any; +} +declare interface InputFileSystem { + readFile: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: Buffer) => void + ) => void; + readdir: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: Array) => void + ) => void; + stat: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: FsStats) => void + ) => void; + realpath?: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: string) => void + ) => void; + purge?: (arg0: string) => void; + join?: (arg0: string, arg1: string) => string; + relative?: (arg0: string, arg1: string) => string; + dirname?: (arg0: string) => string; +} +declare interface IntermediateFileSystemExtras { + mkdirSync: (arg0: string) => void; + createWriteStream: (arg0: string) => WriteStream; + rename: ( + arg0: string, + arg1: string, + arg2: (arg0: NodeJS.ErrnoException) => void + ) => void; +} +declare class JavascriptModulesPlugin { + constructor(options?: {}); + options: {}; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + renderModule( + module: Module, + renderContext: RenderContextJavascriptModulesPlugin, + hooks: CompilationHooksJavascriptModulesPlugin, + factory: boolean | "strict" + ): Source; + renderChunk( + renderContext: RenderContextJavascriptModulesPlugin, + hooks: CompilationHooksJavascriptModulesPlugin + ): Source; + renderMain( + renderContext: MainRenderContext, + hooks: CompilationHooksJavascriptModulesPlugin + ): Source; + renderBootstrap( + renderContext: RenderBootstrapContext, + hooks: CompilationHooksJavascriptModulesPlugin + ): { + header: Array; + startup: Array; + allowInlineStartup: boolean; + }; + renderRequire( + renderContext: RenderBootstrapContext, + hooks: CompilationHooksJavascriptModulesPlugin + ): string; + static getCompilationHooks( + compilation: Compilation + ): CompilationHooksJavascriptModulesPlugin; + static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any; + static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean; +} +declare abstract class JavascriptParser extends Parser { + hooks: Readonly<{ + evaluateTypeof: HookMap< + SyncBailHook<[UnaryExpression], BasicEvaluatedExpression> + >; + evaluate: HookMap>; + evaluateIdentifier: HookMap< + SyncBailHook< + [ThisExpression | MemberExpression | Identifier], + BasicEvaluatedExpression + > + >; + evaluateDefinedIdentifier: HookMap< + SyncBailHook< + [ThisExpression | MemberExpression | Identifier], + BasicEvaluatedExpression + > + >; + evaluateCallExpressionMember: HookMap< + SyncBailHook< + [CallExpression, BasicEvaluatedExpression], + BasicEvaluatedExpression + > + >; + preStatement: SyncBailHook< + [ + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + | ImportDeclaration + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration + ], + boolean | void + >; + blockPreStatement: SyncBailHook< + [ + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + | ImportDeclaration + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration + ], + boolean | void + >; + statement: SyncBailHook< + [ + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration + | ImportDeclaration + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration + ], + boolean | void + >; + statementIf: SyncBailHook<[IfStatement], boolean | void>; + classExtendsExpression: SyncBailHook< + [Expression, ClassExpression | ClassDeclaration], + boolean | void + >; + classBodyElement: SyncBailHook< + [MethodDefinition, ClassExpression | ClassDeclaration], + boolean | void + >; + label: HookMap>; + import: SyncBailHook< + [Statement, string | SimpleLiteral | RegExpLiteral], + boolean | void + >; + importSpecifier: SyncBailHook< + [Statement, string | SimpleLiteral | RegExpLiteral, string, string], + boolean | void + >; + export: SyncBailHook<[Statement], boolean | void>; + exportImport: SyncBailHook< + [Statement, string | SimpleLiteral | RegExpLiteral], + boolean | void + >; + exportDeclaration: SyncBailHook<[Statement, Declaration], boolean | void>; + exportExpression: SyncBailHook<[Statement, Declaration], boolean | void>; + exportSpecifier: SyncBailHook< + [Statement, string, string, number], + boolean | void + >; + exportImportSpecifier: SyncBailHook< + [ + Statement, + string | SimpleLiteral | RegExpLiteral, + string, + string, + number + ], + boolean | void + >; + preDeclarator: SyncBailHook< + [VariableDeclarator, Statement], + boolean | void + >; + declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>; + varDeclaration: HookMap>; + varDeclarationLet: HookMap>; + varDeclarationConst: HookMap>; + varDeclarationVar: HookMap>; + pattern: HookMap>; + canRename: HookMap>; + rename: HookMap>; + assign: HookMap>; + assignMemberChain: HookMap< + SyncBailHook<[AssignmentExpression, Array], boolean | void> + >; + typeof: HookMap>; + importCall: SyncBailHook<[Expression], boolean | void>; + topLevelAwait: SyncBailHook<[Expression], boolean | void>; + call: HookMap>; + callMemberChain: HookMap< + SyncBailHook<[Expression, Array], boolean | void> + >; + memberChainOfCallMemberChain: HookMap< + SyncBailHook< + [Expression, Array, CallExpression, Array], + boolean | void + > + >; + callMemberChainOfCallMemberChain: HookMap< + SyncBailHook< + [Expression, Array, CallExpression, Array], + boolean | void + > + >; + new: HookMap>; + expression: HookMap>; + expressionMemberChain: HookMap< + SyncBailHook<[Expression, Array], boolean | void> + >; + expressionConditionalOperator: SyncBailHook<[Expression], boolean | void>; + expressionLogicalOperator: SyncBailHook<[Expression], boolean | void>; + program: SyncBailHook<[Program, Array], boolean | void>; + finish: SyncBailHook<[Program, Array], boolean | void>; + }>; + options: any; + sourceType: "module" | "script" | "auto"; + scope: ScopeInfo; + state: Record & ParserStateBase; + comments: any; + semicolons: any; + statementEndPos: any; + lastStatementEndPos: any; + statementStartPos: any; + currentTagData: any; + initializeEvaluating(): void; + getRenameIdentifier(expr?: any): any; + walkClass(classy: ClassExpression | ClassDeclaration): void; + walkMethodDefinition(methodDefinition?: any): void; + preWalkStatements(statements?: any): void; + blockPreWalkStatements(statements?: any): void; + walkStatements(statements?: any): void; + preWalkStatement(statement?: any): void; + blockPreWalkStatement(statement?: any): void; + walkStatement(statement?: any): void; + preWalkBlockStatement(statement?: any): void; + walkBlockStatement(statement?: any): void; + walkExpressionStatement(statement?: any): void; + preWalkIfStatement(statement?: any): void; + walkIfStatement(statement?: any): void; + preWalkLabeledStatement(statement?: any): void; + walkLabeledStatement(statement?: any): void; + preWalkWithStatement(statement?: any): void; + walkWithStatement(statement?: any): void; + preWalkSwitchStatement(statement?: any): void; + walkSwitchStatement(statement?: any): void; + walkTerminatingStatement(statement?: any): void; + walkReturnStatement(statement?: any): void; + walkThrowStatement(statement?: any): void; + preWalkTryStatement(statement?: any): void; + walkTryStatement(statement?: any): void; + preWalkWhileStatement(statement?: any): void; + walkWhileStatement(statement?: any): void; + preWalkDoWhileStatement(statement?: any): void; + walkDoWhileStatement(statement?: any): void; + preWalkForStatement(statement?: any): void; + walkForStatement(statement?: any): void; + preWalkForInStatement(statement?: any): void; + walkForInStatement(statement?: any): void; + preWalkForOfStatement(statement?: any): void; + walkForOfStatement(statement?: any): void; + preWalkFunctionDeclaration(statement?: any): void; + walkFunctionDeclaration(statement?: any): void; + blockPreWalkImportDeclaration(statement?: any): void; + enterDeclaration(declaration?: any, onIdent?: any): void; + blockPreWalkExportNamedDeclaration(statement?: any): void; + walkExportNamedDeclaration(statement?: any): void; + blockPreWalkExportDefaultDeclaration(statement?: any): void; + walkExportDefaultDeclaration(statement?: any): void; + blockPreWalkExportAllDeclaration(statement?: any): void; + preWalkVariableDeclaration(statement?: any): void; + blockPreWalkVariableDeclaration(statement?: any): void; + walkVariableDeclaration(statement?: any): void; + blockPreWalkClassDeclaration(statement?: any): void; + walkClassDeclaration(statement?: any): void; + preWalkSwitchCases(switchCases?: any): void; + walkSwitchCases(switchCases?: any): void; + preWalkCatchClause(catchClause?: any): void; + walkCatchClause(catchClause?: any): void; + walkPattern(pattern?: any): void; + walkAssignmentPattern(pattern?: any): void; + walkObjectPattern(pattern?: any): void; + walkArrayPattern(pattern?: any): void; + walkRestElement(pattern?: any): void; + walkExpressions(expressions?: any): void; + walkExpression(expression?: any): void; + walkAwaitExpression(expression?: any): void; + walkArrayExpression(expression?: any): void; + walkSpreadElement(expression?: any): void; + walkObjectExpression(expression?: any): void; + walkFunctionExpression(expression?: any): void; + walkArrowFunctionExpression(expression?: any): void; + walkSequenceExpression(expression?: any): void; + walkUpdateExpression(expression?: any): void; + walkUnaryExpression(expression?: any): void; + walkLeftRightExpression(expression?: any): void; + walkBinaryExpression(expression?: any): void; + walkLogicalExpression(expression?: any): void; + walkAssignmentExpression(expression?: any): void; + walkConditionalExpression(expression?: any): void; + walkNewExpression(expression?: any, args?: any): void; + walkYieldExpression(expression?: any): void; + walkTemplateLiteral(expression?: any): void; + walkTaggedTemplateExpression(expression?: any): void; + walkClassExpression(expression?: any): void; + walkImportExpression(expression?: any): void; + walkCallExpression(expression?: any, args?: any): void; + walkMemberExpression(expression?: any): void; + walkMemberExpressionWithExpressionName( + expression?: any, + name?: any, + rootInfo?: any, + members?: any + ): void; + walkThisExpression(expression?: any): void; + walkIdentifier(expression?: any): void; + callHooksForExpression(hookMap: any, expr: any, ...args: Array): any; + callHooksForExpressionWithFallback( + hookMap: HookMap>, + expr: MemberExpression, + fallback: ( + arg0: string, + arg1: string | ScopeInfo | VariableInfo, + arg2: () => Array + ) => any, + defined: (arg0: string) => any, + ...args: AsArray + ): R; + callHooksForName( + hookMap: HookMap>, + name: string, + ...args: AsArray + ): R; + callHooksForInfo( + hookMap: HookMap>, + info: string | ScopeInfo | VariableInfo, + ...args: AsArray + ): R; + callHooksForInfoWithFallback( + hookMap: HookMap>, + info: string | ScopeInfo | VariableInfo, + fallback: (arg0: string) => any, + defined: () => any, + ...args: AsArray + ): R; + callHooksForNameWithFallback( + hookMap: HookMap>, + name: string, + fallback: (arg0: string) => any, + defined: () => any, + ...args: AsArray + ): R; + inScope(params: any, fn: () => void): void; + inFunctionScope(hasThis?: any, params?: any, fn?: any): void; + inBlockScope(fn?: any): void; + detectMode(statements?: any): void; + enterPatterns(patterns?: any, onIdent?: any): void; + enterPattern(pattern?: any, onIdent?: any): void; + enterIdentifier(pattern?: any, onIdent?: any): void; + enterObjectPattern(pattern?: any, onIdent?: any): void; + enterArrayPattern(pattern?: any, onIdent?: any): void; + enterRestElement(pattern?: any, onIdent?: any): void; + enterAssignmentPattern(pattern?: any, onIdent?: any): void; + evaluateExpression(expression: Expression): BasicEvaluatedExpression; + parseString(expression?: any): any; + parseCalculatedString(expression?: any): any; + evaluate(source?: any): BasicEvaluatedExpression; + getComments(range?: any): any; + isAsiPosition(pos?: any): any; + getTagData(name?: any, tag?: any): any; + tagVariable(name?: any, tag?: any, data?: any): void; + defineVariable(name?: any): void; + undefineVariable(name?: any): void; + isVariableDefined(name?: any): boolean; + getVariableInfo(name: string): string | ScopeInfo | VariableInfo; + setVariable( + name: string, + variableInfo: string | ScopeInfo | VariableInfo + ): void; + parseCommentOptions(range?: any): { options: any; errors: any }; + extractMemberExpressionChain( + expression: MemberExpression + ): { + members: Array; + object: + | UnaryExpression + | ThisExpression + | ArrayExpression + | ObjectExpression + | FunctionExpression + | ArrowFunctionExpression + | YieldExpression + | SimpleLiteral + | RegExpLiteral + | UpdateExpression + | BinaryExpression + | AssignmentExpression + | LogicalExpression + | MemberExpression + | ConditionalExpression + | SimpleCallExpression + | NewExpression + | SequenceExpression + | TemplateLiteral + | TaggedTemplateExpression + | ClassExpression + | MetaProperty + | Identifier + | AwaitExpression + | Super; + }; + getFreeInfoFromVariable( + varName: string + ): { name: string; info: string | VariableInfo }; + getMemberExpressionInfo( + expression: MemberExpression, + allowedTypes: Array<"expression" | "call"> + ): + | { + type: "call"; + call: CallExpression; + calleeName: string; + rootInfo: string | VariableInfo; + getCalleeMembers: () => Array; + name: string; + getMembers: () => Array; + } + | { + type: "expression"; + rootInfo: string | VariableInfo; + name: string; + getMembers: () => Array; + }; + getNameForExpression( + expression: MemberExpression + ): { + name: string; + rootInfo: string | ScopeInfo | VariableInfo; + getMembers: () => Array; + }; +} +declare interface JsonpCompilationPluginHooks { + jsonpScript: SyncWaterfallHook<[string, Chunk, string]>; + linkPreload: SyncWaterfallHook<[string, Chunk, string]>; + linkPrefetch: SyncWaterfallHook<[string, Chunk, string]>; +} +type JsonpScriptType = false | "module" | "text/javascript"; +declare class JsonpTemplatePlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + static getCompilationHooks( + compilation: Compilation + ): JsonpCompilationPluginHooks; +} +declare interface KnownBuildMeta { + moduleArgument?: string; + exportsArgument?: string; + strict?: boolean; + moduleConcatenationBailout?: string; + exportsType?: "default" | "namespace" | "flagged"; + defaultObject?: boolean | "redirect" | "redirect-warn"; + strictHarmonyModule?: boolean; + async?: boolean; +} +declare abstract class LazySet { + readonly size: number; + add(item: T): LazySet; + addAll(iterable: LazySet | Iterable): LazySet; + clear(): void; + delete(value: T): boolean; + entries(): IterableIterator<[T, T]>; + forEach( + callbackFn: (arg0: T, arg1: T, arg2: Set) => void, + thisArg?: any + ): void; + has(item: T): boolean; + keys(): IterableIterator; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator; + readonly [Symbol.toStringTag]: string; + serialize(__0: { write: any }): void; +} +declare interface LibIdentOptions { + /** + * absolute context path to which lib ident is relative to + */ + context: string; + + /** + * object for caching + */ + associatedObjectForCache?: any; +} +declare class LibManifestPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +type Library = string | Array | LibraryCustomUmdObject | LibraryOptions; +declare interface LibraryContext { + compilation: Compilation; + options: T; +} + +/** + * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`. + */ +declare interface LibraryCustomUmdCommentObject { + /** + * Set comment for `amd` section in UMD. + */ + amd?: string; + + /** + * Set comment for `commonjs` (exports) section in UMD. + */ + commonjs?: string; + + /** + * Set comment for `commonjs2` (module.exports) section in UMD. + */ + commonjs2?: string; + + /** + * Set comment for `root` (global variable) section in UMD. + */ + root?: string; +} + +/** + * Description object for all UMD variants of the library name. + */ +declare interface LibraryCustomUmdObject { + /** + * Name of the exposed AMD library in the UMD. + */ + amd?: string; + + /** + * Name of the exposed commonjs export in the UMD. + */ + commonjs?: string; + + /** + * Name of the property exposed globally by a UMD library. + */ + root?: string | Array; +} +type LibraryExport = string | Array; +type LibraryName = string | Array | LibraryCustomUmdObject; + +/** + * Options for library. + */ +declare interface LibraryOptions { + /** + * Add a comment in the UMD wrapper. + */ + auxiliaryComment?: AuxiliaryComment; + + /** + * Specify which export should be exposed as library. + */ + export?: LibraryExport; + + /** + * The name of the library (some types allow unnamed libraries too). + */ + name?: LibraryName; + + /** + * Type of library. + */ + type: ExternalsType; + + /** + * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module. + */ + umdNamedDefine?: boolean; +} +declare class LibraryTemplatePlugin { + constructor( + name: LibraryName, + target: ExternalsType, + umdNamedDefine: boolean, + auxiliaryComment: AuxiliaryComment, + exportProperty: LibraryExport + ); + library: { + type: ExternalsType; + name: LibraryName; + umdNamedDefine: boolean; + auxiliaryComment: AuxiliaryComment; + export: LibraryExport; + }; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class LimitChunkCountPlugin { + constructor(options?: LimitChunkCountPluginOptions); + options: LimitChunkCountPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface LimitChunkCountPluginOptions { + /** + * Constant overhead for a chunk. + */ + chunkOverhead?: number; + + /** + * Multiplicator for initial chunks. + */ + entryChunkMultiplicator?: number; + + /** + * Limit the maximum number of chunks using a value greater greater than or equal to 1. + */ + maxChunks: number; +} + +/** + * Custom values available in the loader context. + */ +declare interface Loader { + [index: string]: any; +} +declare interface LoaderItem { + loader: string; + options: any; + ident: string; +} +declare class LoaderOptionsPlugin { + constructor(options?: LoaderOptionsPluginOptions); + options: LoaderOptionsPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface LoaderOptionsPluginOptions { + [index: string]: any; + + /** + * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3. + */ + debug?: boolean; + + /** + * Where loaders can be switched to minimize mode. + */ + minimize?: boolean; + + /** + * A configuration object that can be used to configure older loaders. + */ + options?: { + [index: string]: any; + /** + * The context that can be used to configure older loaders. + */ + context?: string; + }; +} +declare class LoaderTargetPlugin { + constructor(target: string); + target: string; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface LogEntry { + type: string; + args: Array; + time: number; + trace?: Array; +} +declare const MEASURE_END_OPERATION: unique symbol; +declare const MEASURE_START_OPERATION: unique symbol; +declare interface MainRenderContext { + /** + * the chunk + */ + chunk: Chunk; + + /** + * the dependency templates + */ + dependencyTemplates: DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + + /** + * results of code generation + */ + codeGenerationResults: Map; + + /** + * hash to be used for render call + */ + hash: string; +} +declare abstract class MainTemplate { + hooks: Readonly<{ + renderManifest: { tap: (options?: any, fn?: any) => void }; + modules: { tap: () => never }; + moduleObj: { tap: () => never }; + require: { tap: (options?: any, fn?: any) => void }; + beforeStartup: { tap: () => never }; + startup: { tap: () => never }; + afterStartup: { tap: () => never }; + render: { tap: (options?: any, fn?: any) => void }; + renderWithEntry: { tap: (options?: any, fn?: any) => void }; + assetPath: { + tap: (options?: any, fn?: any) => void; + call: (filename?: any, options?: any) => string; }; - } - export class LoaderTargetPlugin { - constructor(target: string); - target: string; + hash: { tap: (options?: any, fn?: any) => void }; + hashForChunk: { tap: (options?: any, fn?: any) => void }; + globalHashPaths: { tap: () => void }; + globalHash: { tap: () => void }; + hotBootstrap: { tap: () => never }; + bootstrap: SyncWaterfallHook< + [string, Chunk, string, ModuleTemplate, DependencyTemplates] + >; + localVars: SyncWaterfallHook<[string, Chunk, string]>; + requireExtensions: SyncWaterfallHook<[string, Chunk, string]>; + requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>; + }>; + renderCurrentHashCode: (hash: string, length?: number) => string; + getPublicPath: (options?: any) => string; + getAssetPath: (path?: any, options?: any) => string; + getAssetPathWithInfo: ( + path?: any, + options?: any + ) => { path: string; info: AssetInfo }; + readonly requireFn: string; + readonly outputOptions: any; +} +declare interface MapOptions { + columns?: boolean; + module?: boolean; +} +/** + * Options object for in-memory caching. + */ +declare interface MemoryCacheOptions { + /** + * List of paths that are managed by a package manager and contain a version or hash in it's path so all files are immutable. + */ + immutablePaths?: Array; + + /** + * List of paths that are managed by a package manager and can be trusted to not be modified otherwise. + */ + managedPaths?: Array; + + /** + * In memory caching. + */ + type: "memory"; +} +declare class MemoryCachePlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class MinChunkSizePlugin { + constructor(options: MinChunkSizePluginOptions); + options: MinChunkSizePluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface MinChunkSizePluginOptions { + /** + * Constant overhead for a chunk. + */ + chunkOverhead?: number; + + /** + * Multiplicator for initial chunks. + */ + entryChunkMultiplicator?: number; + + /** + * Minimum number of characters. + */ + minChunkSize: number; +} +type Mode = "development" | "production" | "none"; +declare class Module extends DependenciesBlock { + constructor(type: string, context?: string); + type: string; + context: string; + needId: boolean; + debugId: number; + resolveOptions: any; + factoryMeta: any; + buildMeta: KnownBuildMeta & Record; + buildInfo: any; + presentationalDependencies: Array; + id: string | number; + readonly hash: string; + readonly renderedHash: string; + profile: ModuleProfile; + index: number; + index2: number; + depth: number; + issuer: Module; + readonly usedExports: boolean | SortableSet; + readonly optimizationBailout: Array< + string | ((requestShortener: RequestShortener) => string) + >; + readonly optional: boolean; + addChunk(chunk?: any): boolean; + removeChunk(chunk?: any): void; + isInChunk(chunk?: any): boolean; + isEntryModule(): boolean; + getChunks(): Array; + getNumberOfChunks(): number; + readonly chunksIterable: Iterable; + isProvided(exportName: string): boolean; + readonly exportsArgument: string; + readonly moduleArgument: string; + getExportsType( + strict: boolean + ): + | "dynamic" + | "dynamic-default" + | "namespace" + | "default-only" + | "default-with-named"; + addPresentationalDependency(presentationalDependency: Dependency): void; + addWarning(warning: WebpackError): void; + getWarnings(): Iterable; + addError(error: WebpackError): void; + getErrors(): Iterable; + + /** + * removes all warnings and errors + */ + clearWarningsAndErrors(): void; + isOptional(moduleGraph: ModuleGraph): boolean; + isAccessibleInChunk( + chunkGraph: ChunkGraph, + chunk: Chunk, + ignoreChunk?: Chunk + ): boolean; + isAccessibleInChunkGroup( + chunkGraph: ChunkGraph, + chunkGroup: ChunkGroup, + ignoreChunk?: Chunk + ): boolean; + hasReasonForChunk( + chunk: Chunk, + moduleGraph: ModuleGraph, + chunkGraph: ChunkGraph + ): boolean; + hasReasons(moduleGraph: ModuleGraph): boolean; + isModuleUsed(moduleGraph: ModuleGraph): boolean; + isExportUsed( + moduleGraph: ModuleGraph, + exportName: string | Array + ): 0 | 1 | 2 | 3 | 4; + getUsedName( + moduleGraph: ModuleGraph, + exportName: string | Array + ): string | false | Array; + needBuild( + context: NeedBuildContext, + callback: (arg0: WebpackError, arg1: boolean) => void + ): void; + needRebuild(fileTimestamps?: any, contextTimestamps?: any): boolean; + invalidateBuild(): void; + identifier(): string; + readableIdentifier(requestShortener: RequestShortener): string; + build( + options: WebpackOptionsNormalized, + compilation: Compilation, + resolver: Resolver & WithOptions, + fs: InputFileSystem, + callback: (arg0: WebpackError) => void + ): void; + getSourceTypes(): Set; + source(sourceContext: SourceContext): Source; + size(type?: string): number; + libIdent(options: LibIdentOptions): string; + nameForCondition(): string; + getRuntimeRequirements(context: SourceContext): ReadonlySet; + codeGeneration(context: CodeGenerationContext): CodeGenerationResult; + chunkCondition(chunk: Chunk, compilation: Compilation): boolean; + + /** + * Assuming this module is in the cache. Update the (cached) module with + * the fresh module from the factory. Usually updates internal references + * and properties. + */ + updateCacheModule(module: Module): void; + originalSource(): Source; + useSourceMap: any; + readonly hasEqualsChunks: any; + readonly isUsed: any; + readonly errors: any; + readonly warnings: any; + used: any; +} +declare class ModuleConcatenationPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare abstract class ModuleDependency extends Dependency { + request: string; + userRequest: string; + range: any; +} +declare abstract class ModuleFactory { + create( + data: ModuleFactoryCreateData, + callback: (arg0: Error, arg1: ModuleFactoryResult) => void + ): void; +} +declare interface ModuleFactoryCreateData { + contextInfo: ModuleFactoryCreateDataContextInfo; + resolveOptions?: any; + context: string; + dependencies: Array; +} +declare interface ModuleFactoryCreateDataContextInfo { + issuer: string; + compiler: string; +} +declare interface ModuleFactoryResult { + /** + * the created module or unset if no module was created + */ + module?: Module; + fileDependencies?: Set; + contextDependencies?: Set; + missingDependencies?: Set; +} +declare class ModuleGraph { + constructor(); + setParents( + dependency: Dependency, + block: DependenciesBlock, + module: Module + ): void; + getParentModule(dependency: Dependency): Module; + getParentBlock(dependency: Dependency): DependenciesBlock; + setResolvedModule( + originModule: Module, + dependency: Dependency, + module: Module + ): void; + updateModule(dependency: Dependency, module: Module): void; + removeConnection(dependency: Dependency): void; + addExplanation(dependency: Dependency, explanation: string): void; + cloneModuleAttributes(sourceModule: Module, targetModule: Module): void; + removeModuleAttributes(module: Module): void; + removeAllModuleAttributes(): void; + moveModuleConnections( + oldModule: Module, + newModule: Module, + filterConnection: (arg0: ModuleGraphConnection) => boolean + ): void; + addExtraReason(module: Module, explanation: string): void; + getResolvedModule(dependency: Dependency): Module; + finishModule(module: Module): void; + getConnection(dependency: Dependency): ModuleGraphConnection; + getModule(dependency: Dependency): Module; + getOrigin(dependency: Dependency): Module; + getResolvedOrigin(dependency: Dependency): Module; + getIncomingConnections(module: Module): Iterable; + getOutgoingConnections(module: Module): Iterable; + getProfile(module: Module): ModuleProfile; + setProfile(module: Module, profile: ModuleProfile): void; + getIssuer(module: Module): Module; + setIssuer(module: Module, issuer: Module): void; + setIssuerIfUnset(module: Module, issuer: Module): void; + getOptimizationBailout( + module: Module + ): Array string)>; + getProvidedExports(module: Module): true | Array; + isExportProvided(module: Module, exportName: string | Array): boolean; + getExportsInfo(module: Module): ExportsInfo; + getExportInfo(module: Module, exportName: string): ExportInfo; + getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo; + getUsedExports(module: Module): boolean | SortableSet; + getPreOrderIndex(module: Module): number; + getPostOrderIndex(module: Module): number; + setPreOrderIndex(module: Module, index: number): void; + setPreOrderIndexIfUnset(module: Module, index: number): boolean; + setPostOrderIndex(module: Module, index: number): void; + setPostOrderIndexIfUnset(module: Module, index: number): boolean; + getDepth(module: Module): number; + setDepth(module: Module, depth: number): void; + setDepthIfLower(module: Module, depth: number): boolean; + isAsync(module: Module): boolean; + setAsync(module: Module): void; + getMeta(thing?: any): any; + static getModuleGraphForModule( + module: Module, + deprecateMessage: string, + deprecationCode: string + ): ModuleGraph; + static setModuleGraphForModule( + module: Module, + moduleGraph: ModuleGraph + ): void; + static ModuleGraphConnection: typeof ModuleGraphConnection; + static ExportsInfo: typeof ExportsInfo; + static ExportInfo: typeof ExportInfo; + static SKIP_OVER_NAME: typeof SKIP_OVER_NAME; + static UsageState: Readonly<{ + NoInfo: 0; + Unused: 1; + Unknown: 2; + OnlyPropertiesUsed: 3; + Used: 4; + }>; +} +declare class ModuleGraphConnection { + constructor( + originModule: Module, + dependency: Dependency, + module: Module, + explanation?: string, + weak?: boolean, + condition?: (arg0: ModuleGraphConnection) => boolean + ); + originModule: Module; + resolvedOriginModule: Module; + dependency: Dependency; + resolvedModule: Module; + module: Module; + weak: boolean; + conditional: boolean; + condition: (arg0: ModuleGraphConnection) => boolean; + explanations: Set; + addCondition(condition: (arg0: ModuleGraphConnection) => boolean): void; + addExplanation(explanation: string): void; + readonly explanation: string; + active: any; +} + +/** + * Options affecting the normal modules (`NormalModuleFactory`). + */ +declare interface ModuleOptions { + /** + * An array of rules applied by default for modules. + */ + defaultRules?: Array; + + /** + * Enable warnings for full dynamic dependencies. + */ + exprContextCritical?: boolean; + + /** + * Enable recursive directory lookup for full dynamic dependencies. + */ + exprContextRecursive?: boolean; + + /** + * Sets the default regular expression for full dynamic dependencies. + */ + exprContextRegExp?: boolean | RegExp; + + /** + * Set the default request for full dynamic dependencies. + */ + exprContextRequest?: string; + + /** + * Don't parse files matching. It's matched against the full resolved request. + */ + noParse?: + | string + | Function + | RegExp + | [string | Function | RegExp, string | Function | RegExp]; + + /** + * An array of rules applied for modules. + */ + rules?: Array; + + /** + * Emit errors instead of warnings when imported names don't exist in imported module. + */ + strictExportPresence?: boolean; + + /** + * Handle the this context correctly according to the spec for namespace objects. + */ + strictThisContextOnImports?: boolean; + + /** + * Enable warnings when using the require function in a not statically analyse-able way. + */ + unknownContextCritical?: boolean; + + /** + * Enable recursive directory lookup when using the require function in a not statically analyse-able way. + */ + unknownContextRecursive?: boolean; + + /** + * Sets the regular expression when using the require function in a not statically analyse-able way. + */ + unknownContextRegExp?: boolean | RegExp; + + /** + * Sets the request when using the require function in a not statically analyse-able way. + */ + unknownContextRequest?: string; + + /** + * Cache the resolving of module requests. + */ + unsafeCache?: boolean | Function; + + /** + * Enable warnings for partial dynamic dependencies. + */ + wrappedContextCritical?: boolean; + + /** + * Enable recursive directory lookup for partial dynamic dependencies. + */ + wrappedContextRecursive?: boolean; + + /** + * Set the inner regular expression for partial dynamic dependencies. + */ + wrappedContextRegExp?: RegExp; +} +declare interface ModulePathData { + id: string | number; + hash: string; + hashWithLength?: (arg0: number) => string; +} +declare abstract class ModuleProfile { + startTime: number; + factory: number; + restoring: number; + integration: number; + building: number; + storing: number; + additionalFactories: number; + additionalIntegration: number; + markFactoryStart(): void; + factoryStartTime: number; + markFactoryEnd(): void; + factoryEndTime: number; + markRestoringStart(): void; + restoringStartTime: number; + markRestoringEnd(): void; + restoringEndTime: number; + markIntegrationStart(): void; + integrationStartTime: number; + markIntegrationEnd(): void; + integrationEndTime: number; + markBuildingStart(): void; + buildingStartTime: number; + markBuildingEnd(): void; + buildingEndTime: number; + markStoringStart(): void; + storingStartTime: number; + markStoringEnd(): void; + storingEndTime: number; + + /** + * Merge this profile into another one + */ + mergeInto(realProfile: ModuleProfile): void; +} +declare abstract class ModuleTemplate { + type: string; + hooks: Readonly<{ + content: { tap: (options?: any, fn?: any) => void }; + module: { tap: (options?: any, fn?: any) => void }; + render: { tap: (options?: any, fn?: any) => void }; + package: { tap: (options?: any, fn?: any) => void }; + hash: { tap: (options?: any, fn?: any) => void }; + }>; + readonly runtimeTemplate: any; +} +declare class MultiCompiler { + constructor(compilers: Array | Record); + hooks: Readonly<{ + done: SyncHook<[MultiStats], void>; + invalid: MultiHook>; + run: MultiHook>; + watchClose: SyncHook<[], void>; + watchRun: MultiHook>; + infrastructureLog: MultiHook< + SyncBailHook<[string, string, Array], true> + >; + }>; + compilers: Array; + dependencies: WeakMap>; + running: boolean; + readonly options: Array; + readonly outputPath: string; + inputFileSystem: InputFileSystem; + outputFileSystem: OutputFileSystem; + intermediateFileSystem: InputFileSystem & + OutputFileSystem & + IntermediateFileSystemExtras; + getInfrastructureLogger(name?: any): WebpackLogger; + setDependencies(compiler: Compiler, dependencies: Array): void; + validateDependencies(callback: CallbackFunction): boolean; + runWithDependencies( + compilers: Array, + fn: (compiler: Compiler, callback: CallbackFunction) => any, + callback: CallbackFunction + ): void; + watch( + watchOptions: WatchOptions | Array, + handler: CallbackFunction + ): MultiWatching; + run(callback: CallbackFunction): void; + purgeInputFileSystem(): void; + close(callback: CallbackFunction): void; +} +declare abstract class MultiStats { + stats: Array; + hash: string; + hasErrors(): boolean; + hasWarnings(): boolean; + toJson( + options?: any + ): { + children: Array; + version: any; + hash: string; + errors: Array; + warnings: Array; + }; + toString(options?: any): string; +} +declare abstract class MultiWatching { + watchings: Array; + compiler: MultiCompiler; + invalidate(): void; + suspend(): void; + resume(): void; + close(callback: CallbackFunction): void; +} +declare class NamedChunkIdsPlugin { + constructor(options?: any); + delimiter: any; + context: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class NamedModuleIdsPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class NaturalModuleIdsPlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface NeedBuildContext { + fileSystemInfo: FileSystemInfo; +} +declare class NoEmitOnErrorsPlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +type Node = false | NodeOptions; +declare class NodeEnvironmentPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * Options object for node compatibility features. + */ +declare interface NodeOptions { + /** + * Include a polyfill for the 'global' variable. + */ + global?: boolean; +} +declare class NodeTemplatePlugin { + constructor(options?: any); + asyncChunkLoading: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class NormalModule extends Module { + constructor(__0: { /** - * Apply the plugin + * module type */ - apply(compiler: webpack.Compiler): void; - } - export interface LogEntry { type: string; - args: Array; - time: number; - trace?: Array; - } - export const MEASURE_END_OPERATION: unique symbol; - export const MEASURE_START_OPERATION: unique symbol; - export interface MainRenderContext { /** - * the chunk + * request string */ - chunk: webpack.Chunk; - + request: string; /** - * the dependency templates + * request intended by user (without loaders from config) */ - dependencyTemplates: webpack.DependencyTemplates; - + userRequest: string; /** - * the runtime template + * request without resolving */ - runtimeTemplate: webpack.RuntimeTemplate; - + rawRequest: string; /** - * the module graph + * list of loaders */ - moduleGraph: webpack.ModuleGraph; + loaders: Array; + /** + * path + query of the real resource + */ + resource: string; + /** + * path + query of the matched resource (virtual) + */ + matchResource: string; + /** + * the parser used + */ + parser: Parser; + /** + * the generator used + */ + generator: Generator; + /** + * options used for resolving requests from this module + */ + resolveOptions: any; + }); + request: string; + userRequest: string; + rawRequest: string; + binary: boolean; + parser: Parser; + generator: Generator; + resource: string; + matchResource: string; + loaders: Array; + error: WebpackError; + createSourceForAsset( + context: string, + name: string, + content: string, + sourceMap?: any, + associatedObjectForCache?: any + ): Source; + createLoaderContext( + resolver: Resolver & WithOptions, + options: WebpackOptionsNormalized, + compilation: Compilation, + fs: InputFileSystem + ): any; + getCurrentLoader(loaderContext?: any, index?: any): LoaderItem; + createSource( + context: string, + content: string | Buffer, + sourceMap?: any, + associatedObjectForCache?: any + ): Source; + doBuild( + options: WebpackOptionsNormalized, + compilation: Compilation, + resolver: Resolver & WithOptions, + fs: InputFileSystem, + callback: (arg0: WebpackError) => void + ): void; + markModuleAsErrored(error: WebpackError): void; + applyNoParseRule(rule?: any, content?: any): any; + shouldPreventParsing(noParseRule?: any, request?: any): any; + static getCompilationHooks( + compilation: Compilation + ): NormalModuleCompilationHooks; + static deserialize(context?: any): NormalModule; +} +declare interface NormalModuleCompilationHooks { + loader: SyncHook<[any, NormalModule], void>; +} +declare abstract class NormalModuleFactory extends ModuleFactory { + hooks: Readonly<{ + resolve: AsyncSeriesBailHook<[ResolveData], any>; + factorize: AsyncSeriesBailHook<[ResolveData], any>; + beforeResolve: AsyncSeriesBailHook<[ResolveData], any>; + afterResolve: AsyncSeriesBailHook<[ResolveData], any>; + createModule: SyncBailHook<[ResolveData], any>; + module: SyncWaterfallHook<[Module, any, ResolveData]>; + createParser: HookMap>; + parser: HookMap>; + createGenerator: HookMap>; + generator: HookMap>; + }>; + resolverFactory: any; + ruleSet: RuleSet; + unsafeCache: boolean; + cachePredicate: any; + context: any; + fs: any; + parserCache: Map>; + generatorCache: Map>; + resolveRequestArray( + contextInfo?: any, + context?: any, + array?: any, + resolver?: any, + resolveContext?: any, + callback?: any + ): any; + getParser(type?: any, parserOptions?: {}): any; + createParser(type?: any, parserOptions?: {}): any; + getGenerator(type?: any, generatorOptions?: {}): Generator; + createGenerator(type?: any, generatorOptions?: {}): any; + getResolver(type?: any, resolveOptions?: any): any; +} +declare class NormalModuleReplacementPlugin { + /** + * Create an instance of the plugin + */ + constructor( + resourceRegExp: RegExp, + newResource: string | ((arg0?: any) => void) + ); + resourceRegExp: RegExp; + newResource: string | ((arg0?: any) => void); + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface ObjectDeserializerContext { + read: () => any; +} +declare interface ObjectSerializer { + serialize: (arg0: any, arg1: ObjectSerializerContext) => void; + deserialize: (arg0: ObjectDeserializerContext) => any; +} +declare interface ObjectSerializerContext { + write: (arg0?: any) => void; +} +declare class OccurrenceChunkIdsPlugin { + constructor(options?: OccurrenceChunkIdsPluginOptions); + options: OccurrenceChunkIdsPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface OccurrenceChunkIdsPluginOptions { + /** + * Prioritise initial size over total size. + */ + prioritiseInitial?: boolean; +} +declare class OccurrenceModuleIdsPlugin { + constructor(options?: OccurrenceModuleIdsPluginOptions); + options: OccurrenceModuleIdsPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface OccurrenceModuleIdsPluginOptions { + /** + * Prioritise initial size over total size. + */ + prioritiseInitial?: boolean; +} + +/** + * Enables/Disables integrated optimizations. + */ +declare interface Optimization { + /** + * Check for incompatible wasm types when importing/exporting from/to ESM. + */ + checkWasmTypes?: boolean; + + /** + * Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin). + */ + chunkIds?: + | false + | "natural" + | "named" + | "deterministic" + | "size" + | "total-size"; + + /** + * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer. + */ + concatenateModules?: boolean; + + /** + * Also flag chunks as loaded which contain a subset of the modules. + */ + flagIncludedChunks?: boolean; + + /** + * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection. + */ + innerGraph?: boolean; + + /** + * Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports). + */ + mangleExports?: boolean; + + /** + * Reduce size of WASM by changing imports to shorter strings. + */ + mangleWasmImports?: boolean; + + /** + * Merge chunks which contain the same modules. + */ + mergeDuplicateChunks?: boolean; + + /** + * Enable minimizing the output. Uses optimization.minimizer. + */ + minimize?: boolean; + + /** + * Minimizer(s) to use for minimizing the output. + */ + minimizer?: Array< + ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance + >; + + /** + * Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin). + */ + moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed"; + + /** + * Avoid emitting assets when errors occur. + */ + noEmitOnErrors?: boolean; + + /** + * Set process.env.NODE_ENV to a specific value. + */ + nodeEnv?: DevTool; + + /** + * Generate records with relative paths to be able to move the context folder. + */ + portableRecords?: boolean; + + /** + * Figure out which exports are provided by modules to generate more efficient code. + */ + providedExports?: boolean; + + /** + * Removes modules from chunks when these modules are already included in all parents. + */ + removeAvailableModules?: boolean; + + /** + * Remove chunks which are empty. + */ + removeEmptyChunks?: boolean; + + /** + * Create an additional chunk which contains only the webpack runtime and chunk hash maps. + */ + runtimeChunk?: OptimizationRuntimeChunk; + + /** + * Skip over modules which are flagged to contain no side effects when exports are not used. + */ + sideEffects?: boolean; + + /** + * Optimize duplication and caching by splitting chunks by shared modules and cache group. + */ + splitChunks?: false | OptimizationSplitChunksOptions; + + /** + * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code. + */ + usedExports?: boolean; +} +type OptimizationRuntimeChunk = + | boolean + | "single" + | "multiple" + | { + /** + * The name or name factory for the runtime chunks. + */ + name?: DevtoolFallbackModuleFilenameTemplate; + }; + +/** + * Options object for describing behavior of a cache group selecting modules that should be cached together. + */ +declare interface OptimizationSplitChunksCacheGroup { + /** + * Sets the name delimiter for created chunks. + */ + automaticNameDelimiter?: string; + + /** + * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML). + */ + chunks?: "initial" | "async" | "all" | ((chunk: Chunk) => boolean); + + /** + * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group. + */ + enforce?: boolean; + + /** + * Sets the template for the filename for created chunks. + */ + filename?: string | ((pathData: PathData, assetInfo: AssetInfo) => string); + + /** + * Sets the hint for chunk id. + */ + idHint?: string; + + /** + * Maximum number of requests which are accepted for on-demand loading. + */ + maxAsyncRequests?: number; + + /** + * Maximal size hint for the on-demand chunks. + */ + maxAsyncSize?: OptimizationSplitChunksSizes; + + /** + * Maximum number of initial chunks which are accepted for an entry point. + */ + maxInitialRequests?: number; + + /** + * Maximal size hint for the initial chunks. + */ + maxInitialSize?: OptimizationSplitChunksSizes; + + /** + * Maximal size hint for the created chunks. + */ + maxSize?: OptimizationSplitChunksSizes; + + /** + * Minimum number of times a module has to be duplicated until it's considered for splitting. + */ + minChunks?: number; + + /** + * Minimal size for the chunks the stay after moving the modules to a new chunk. + */ + minRemainingSize?: OptimizationSplitChunksSizes; + + /** + * Minimal size for the created chunk. + */ + minSize?: OptimizationSplitChunksSizes; + + /** + * Give chunks for this cache group a name (chunks with equal name are merged). + */ + name?: string | false | Function; + + /** + * Priority of this cache group. + */ + priority?: number; + + /** + * Try to reuse existing chunk (with name) when it has matching modules. + */ + reuseExistingChunk?: boolean; + + /** + * Assign modules to a cache group by module name. + */ + test?: string | Function | RegExp; + + /** + * Assign modules to a cache group by module type. + */ + type?: string | Function | RegExp; +} + +/** + * Options object for splitting chunks into smaller chunks. + */ +declare interface OptimizationSplitChunksOptions { + /** + * Sets the name delimiter for created chunks. + */ + automaticNameDelimiter?: string; + + /** + * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors'). + */ + cacheGroups?: { + [index: string]: + | string + | false + | Function + | RegExp + | OptimizationSplitChunksCacheGroup; + }; + + /** + * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML). + */ + chunks?: "initial" | "async" | "all" | ((chunk: Chunk) => boolean); + + /** + * Options for modules not selected by any other cache group. + */ + fallbackCacheGroup?: { + /** + * Sets the name delimiter for created chunks. + */ + automaticNameDelimiter?: string; + /** + * Maximal size hint for the on-demand chunks. + */ + maxAsyncSize?: OptimizationSplitChunksSizes; + /** + * Maximal size hint for the initial chunks. + */ + maxInitialSize?: OptimizationSplitChunksSizes; + /** + * Maximal size hint for the created chunks. + */ + maxSize?: OptimizationSplitChunksSizes; + /** + * Minimal size for the created chunk. + */ + minSize?: OptimizationSplitChunksSizes; + }; + + /** + * Sets the template for the filename for created chunks. + */ + filename?: string | ((pathData: PathData, assetInfo: AssetInfo) => string); + + /** + * Prevents exposing path info when creating names for parts splitted by maxSize. + */ + hidePathInfo?: boolean; + + /** + * Maximum number of requests which are accepted for on-demand loading. + */ + maxAsyncRequests?: number; + + /** + * Maximal size hint for the on-demand chunks. + */ + maxAsyncSize?: OptimizationSplitChunksSizes; + + /** + * Maximum number of initial chunks which are accepted for an entry point. + */ + maxInitialRequests?: number; + + /** + * Maximal size hint for the initial chunks. + */ + maxInitialSize?: OptimizationSplitChunksSizes; + + /** + * Maximal size hint for the created chunks. + */ + maxSize?: OptimizationSplitChunksSizes; + + /** + * Minimum number of times a module has to be duplicated until it's considered for splitting. + */ + minChunks?: number; + + /** + * Minimal size for the chunks the stay after moving the modules to a new chunk. + */ + minRemainingSize?: OptimizationSplitChunksSizes; + + /** + * Minimal size for the created chunks. + */ + minSize?: OptimizationSplitChunksSizes; + + /** + * Give chunks created a name (chunks with equal name are merged). + */ + name?: string | false | Function; +} +type OptimizationSplitChunksSizes = number | { [index: string]: number }; +declare abstract class OptionsApply { + process(options?: any, compiler?: any): void; +} + +/** + * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. + */ +declare interface Output { + /** + * The filename of asset modules as relative path inside the `output.path` directory. + */ + assetModuleFilename?: AssetModuleFilename; + + /** + * Add a comment in the UMD wrapper. + */ + auxiliaryComment?: AuxiliaryComment; + + /** + * The callback function name used by webpack for loading of chunks in WebWorkers. + */ + chunkCallbackName?: string; + + /** + * The filename of non-entry chunks as relative path inside the `output.path` directory. + */ + chunkFilename?: string; + + /** + * Number of milliseconds before chunk request expires. + */ + chunkLoadTimeout?: number; + + /** + * Check if to be emitted file already exists and have the same content before writing to output filesystem. + */ + compareBeforeEmit?: boolean; + + /** + * This option enables cross-origin loading of chunks. + */ + crossOriginLoading?: CrossOriginLoading; + + /** + * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers. + */ + devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate; + + /** + * Filename template string of function for the sources array in a generated SourceMap. + */ + devtoolModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate; + + /** + * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries. + */ + devtoolNamespace?: string; + + /** + * The maximum EcmaScript version of the webpack generated code (doesn't include input source code from modules). + */ + ecmaVersion?: number; + + /** + * List of library types enabled for use by entry points. + */ + enabledLibraryTypes?: Array; + + /** + * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. + */ + filename?: Filename; + + /** + * An expression which is used to address the global object/scope in runtime code. + */ + globalObject?: string; + + /** + * Digest type used for the hash. + */ + hashDigest?: string; + + /** + * Number of chars which are used for the hash. + */ + hashDigestLength?: number; + + /** + * Algorithm used for generation the hash (see node.js crypto package). + */ + hashFunction?: HashFunction; + + /** + * Any string which is added to the hash to salt it. + */ + hashSalt?: string; + + /** + * The filename of the Hot Update Chunks. They are inside the output.path directory. + */ + hotUpdateChunkFilename?: string; + + /** + * The JSONP function used by webpack for async loading of hot update chunks. + */ + hotUpdateFunction?: string; + + /** + * The filename of the Hot Update Main File. It is inside the `output.path` directory. + */ + hotUpdateMainFilename?: string; + + /** + * Wrap javascript code into IIFE's to avoid leaking into global scope. + */ + iife?: boolean; + + /** + * The JSONP function used by webpack for async loading of chunks. + */ + jsonpFunction?: string; + + /** + * This option enables loading async chunks via a custom script type, such as script type="module". + */ + jsonpScriptType?: JsonpScriptType; + + /** + * Make the output files a library, exporting the exports of the entry point. + */ + library?: Library; + + /** + * Specify which export should be exposed as library. + */ + libraryExport?: LibraryExport; + + /** + * Type of library. + */ + libraryTarget?: ExternalsType; + + /** + * Output javascript files as module source type. + */ + module?: boolean; + + /** + * The output directory as **absolute path** (required). + */ + path?: string; + + /** + * Include comments with information about the modules. + */ + pathinfo?: boolean; + + /** + * The `publicPath` specifies the public URL address of the output files when referenced in a browser. + */ + publicPath?: PublicPath; + + /** + * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. + */ + sourceMapFilename?: string; + + /** + * Prefixes every line of the source in the bundle with this string. + */ + sourcePrefix?: string; + + /** + * Handles exceptions in module loading correctly at a performance cost. + */ + strictModuleExceptionHandling?: boolean; + + /** + * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module. + */ + umdNamedDefine?: boolean; + + /** + * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. + */ + uniqueName?: string; + + /** + * The filename of WebAssembly modules as relative path inside the `output.path` directory. + */ + webassemblyModuleFilename?: string; +} +declare interface OutputFileSystem { + writeFile: ( + arg0: string, + arg1: string | Buffer, + arg2: (arg0: NodeJS.ErrnoException) => void + ) => void; + mkdir: (arg0: string, arg1: (arg0: NodeJS.ErrnoException) => void) => void; + stat: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: FsStats) => void + ) => void; + readFile: ( + arg0: string, + arg1: (arg0: NodeJS.ErrnoException, arg1: Buffer) => void + ) => void; + join?: (arg0: string, arg1: string) => string; + relative?: (arg0: string, arg1: string) => string; + dirname?: (arg0: string) => string; +} + +/** + * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. + */ +declare interface OutputNormalized { + /** + * The filename of asset modules as relative path inside the `output.path` directory. + */ + assetModuleFilename?: AssetModuleFilename; + + /** + * The callback function name used by webpack for loading of chunks in WebWorkers. + */ + chunkCallbackName?: string; + + /** + * The filename of non-entry chunks as relative path inside the `output.path` directory. + */ + chunkFilename?: string; + + /** + * Number of milliseconds before chunk request expires. + */ + chunkLoadTimeout?: number; + + /** + * Check if to be emitted file already exists and have the same content before writing to output filesystem. + */ + compareBeforeEmit?: boolean; + + /** + * This option enables cross-origin loading of chunks. + */ + crossOriginLoading?: CrossOriginLoading; + + /** + * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers. + */ + devtoolFallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate; + + /** + * Filename template string of function for the sources array in a generated SourceMap. + */ + devtoolModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate; + + /** + * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries. + */ + devtoolNamespace?: string; + + /** + * The maximum EcmaScript version of the webpack generated code (doesn't include input source code from modules). + */ + ecmaVersion?: number; + + /** + * List of library types enabled for use by entry points. + */ + enabledLibraryTypes?: Array; + + /** + * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. + */ + filename?: Filename; + + /** + * An expression which is used to address the global object/scope in runtime code. + */ + globalObject?: string; + + /** + * Digest type used for the hash. + */ + hashDigest?: string; + + /** + * Number of chars which are used for the hash. + */ + hashDigestLength?: number; + + /** + * Algorithm used for generation the hash (see node.js crypto package). + */ + hashFunction?: HashFunction; + + /** + * Any string which is added to the hash to salt it. + */ + hashSalt?: string; + + /** + * The filename of the Hot Update Chunks. They are inside the output.path directory. + */ + hotUpdateChunkFilename?: string; + + /** + * The JSONP function used by webpack for async loading of hot update chunks. + */ + hotUpdateFunction?: string; + + /** + * The filename of the Hot Update Main File. It is inside the `output.path` directory. + */ + hotUpdateMainFilename?: string; + + /** + * Wrap javascript code into IIFE's to avoid leaking into global scope. + */ + iife?: boolean; + + /** + * The JSONP function used by webpack for async loading of chunks. + */ + jsonpFunction?: string; + + /** + * This option enables loading async chunks via a custom script type, such as script type="module". + */ + jsonpScriptType?: JsonpScriptType; + + /** + * Options for library. + */ + library?: LibraryOptions; + + /** + * Output javascript files as module source type. + */ + module?: boolean; + + /** + * The output directory as **absolute path** (required). + */ + path?: string; + + /** + * Include comments with information about the modules. + */ + pathinfo?: boolean; + + /** + * The `publicPath` specifies the public URL address of the output files when referenced in a browser. + */ + publicPath?: PublicPath; + + /** + * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. + */ + sourceMapFilename?: string; + + /** + * Prefixes every line of the source in the bundle with this string. + */ + sourcePrefix?: string; + + /** + * Handles exceptions in module loading correctly at a performance cost. + */ + strictModuleExceptionHandling?: boolean; + + /** + * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. + */ + uniqueName?: string; + + /** + * The filename of WebAssembly modules as relative path inside the `output.path` directory. + */ + webassemblyModuleFilename?: string; +} +declare class Parser { + constructor(); + parse( + source: string | Record | Buffer, + state: Record & ParserStateBase + ): Record & ParserStateBase; +} +declare interface ParserStateBase { + current: NormalModule; + module: NormalModule; + compilation: Compilation; + options: any; +} +declare interface PathData { + chunkGraph?: ChunkGraph; + hash?: string; + hashWithLength?: (arg0: number) => string; + chunk?: Chunk | ChunkPathData; + module?: Module | ModulePathData; + filename?: string; + basename?: string; + query?: string; + contentHashType?: string; + contentHash?: string; + contentHashWithLength?: (arg0: number) => string; + noChunkHash?: boolean; + url?: string; +} +type Performance = false | PerformanceOptions; + +/** + * Configuration object for web performance recommendations. + */ +declare interface PerformanceOptions { + /** + * Filter function to select assets that are checked. + */ + assetFilter?: Function; + + /** + * Sets the format of the hints: warnings, errors or nothing at all. + */ + hints?: false | "error" | "warning"; + + /** + * File size limit (in bytes) when exceeded, that webpack will provide performance hints. + */ + maxAssetSize?: number; + + /** + * Total size of an entry point (in bytes). + */ + maxEntrypointSize?: number; +} +declare interface Plugin { + apply: () => void; +} +declare class PrefetchPlugin { + constructor(context?: any, request?: any); + context: any; + request: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface PrintedElement { + element: string; + content: string; +} +declare interface Problem { + type: + | "unknown-argument" + | "unexpected-non-array-in-path" + | "unexpected-non-object-in-path" + | "multiple-values-unexpected" + | "invalid-value"; + path: string; + argument: string; + value?: any; + index?: number; + expected?: string; +} +declare class Profiler { + constructor(inspector?: any); + session: any; + inspector: any; + hasSession(): boolean; + startProfiling(): Promise | Promise<[any, any, any]>; + sendCommand(method?: any, params?: any): Promise; + destroy(): Promise; + stopProfiling(): Promise; +} +declare class ProfilingPlugin { + constructor(options?: ProfilingPluginOptions); + outputPath: string; + apply(compiler?: any): void; + static Profiler: typeof Profiler; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface ProfilingPluginOptions { + /** + * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`. + */ + outputPath?: string; +} +declare class ProgressPlugin { + constructor(options: ProgressPluginArgument); + profile: boolean; + handler: (percentage: number, msg: string, ...args: Array) => void; + modulesCount: number; + dependenciesCount: number; + showEntries: boolean; + showModules: boolean; + showDependencies: boolean; + showActiveModules: boolean; + percentBy: "modules" | "dependencies" | "entries"; + apply(compiler: Compiler | MultiCompiler): void; + static getReporter( + compiler: Compiler + ): (p: number, ...args: Array) => void; + static defaultOptions: { + profile: boolean; + modulesCount: number; + dependenciesCount: number; + modules: boolean; + dependencies: boolean; + activeModules: boolean; + entries: boolean; + }; +} +type ProgressPluginArgument = + | ProgressPluginOptions + | ((percentage: number, msg: string, ...args: Array) => void); + +/** + * Options object for the ProgressPlugin. + */ +declare interface ProgressPluginOptions { + /** + * Show active modules count and one active module in progress message. + */ + activeModules?: boolean; + + /** + * Show dependencies count in progress message. + */ + dependencies?: boolean; + + /** + * Minimum dependencies count to start with. For better progress calculation. Default: 10000. + */ + dependenciesCount?: number; + + /** + * Show entries count in progress message. + */ + entries?: boolean; + + /** + * Function that executes for every progress step. + */ + handler?: (percentage: number, msg: string, ...args: Array) => void; + + /** + * Show modules count in progress message. + */ + modules?: boolean; + + /** + * Minimum modules count to start with. For better progress calculation. Default: 5000. + */ + modulesCount?: number; + + /** + * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent. + */ + percentBy?: "modules" | "dependencies" | "entries"; + + /** + * Collect profile data for progress steps. Default: false. + */ + profile?: boolean; +} +declare class ProvidePlugin { + constructor(definitions: Record>); + definitions: Record>; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +type PublicPath = + | string + | ((pathData: PathData, assetInfo: AssetInfo) => string); +declare class ReadFileCompileWasmPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface RealDependencyLocation { + start: SourcePosition; + end?: SourcePosition; + index?: number; +} +type RecursiveArrayOrRecord = + | string + | number + | bigint + | boolean + | Function + | RegExp + | RuntimeValue + | { [index: string]: RecursiveArrayOrRecord } + | Array; +declare interface RenderBootstrapContext { + /** + * the chunk + */ + chunk: Chunk; + + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + + /** + * hash to be used for render call + */ + hash: string; +} +declare interface RenderContextAsyncWebAssemblyModulesPlugin { + /** + * the chunk + */ + chunk: any; + + /** + * the dependency templates + */ + dependencyTemplates: any; + + /** + * the runtime template + */ + runtimeTemplate: any; + + /** + * the module graph + */ + moduleGraph: any; + + /** + * the chunk graph + */ + chunkGraph: any; + + /** + * results of code generation + */ + codeGenerationResults: Map; +} +declare interface RenderContextJavascriptModulesPlugin { + /** + * the chunk + */ + chunk: Chunk; + + /** + * the dependency templates + */ + dependencyTemplates: DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + + /** + * results of code generation + */ + codeGenerationResults: Map; +} +declare interface RenderContextModuleTemplate { + /** + * the chunk + */ + chunk: Chunk; + + /** + * the dependency templates + */ + dependencyTemplates: DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; +} +declare interface RenderManifestEntry { + render: () => Source; + filenameTemplate: string | ((arg0: PathData, arg1: AssetInfo) => string); + pathOptions?: PathData; + identifier: string; + hash?: string; + auxiliary?: boolean; +} +declare interface RenderManifestOptions { + /** + * the chunk used to render + */ + chunk: Chunk; + hash: string; + fullHash: string; + outputOptions: any; + codeGenerationResults: Map; + moduleTemplates: { javascript: ModuleTemplate }; + dependencyTemplates: DependencyTemplates; + runtimeTemplate: RuntimeTemplate; + moduleGraph: ModuleGraph; + chunkGraph: ChunkGraph; +} +declare abstract class ReplaceSource extends Source { + replace(start: number, end: number, newValue: string, name: string): void; + insert(pos: number, newValue: string, name: string): void; + getName(): string; + original(): string; + getReplacements(): Array<{ + start: number; + end: number; + content: string; + insertIndex: number; + name: string; + }>; +} +declare abstract class RequestShortener { + contextify: (arg0: string) => string; + shorten(request: string): string; +} + +/** + * istanbul ignore next + */ +declare interface ResolveBuildDependenciesResult { + /** + * list of files + */ + files: Set; + + /** + * list of directories + */ + directories: Set; + + /** + * list of missing entries + */ + missing: Set; + + /** + * stored resolve results + */ + resolveResults: Map; + + /** + * dependencies of the resolving + */ + resolveDependencies: { + /** + * list of files + */ + files: Set; + /** + * list of directories + */ + directories: Set; + /** + * list of missing entries + */ + missing: Set; + }; +} +declare interface ResolveContext { + log?: (message: string) => void; + fileDependencies?: WriteOnlySet; + contextDependencies?: WriteOnlySet; + missingDependencies?: WriteOnlySet; + stack?: Set; +} +declare interface ResolveData { + contextInfo: ModuleFactoryCreateDataContextInfo; + resolveOptions: any; + context: string; + request: string; + dependencies: Array; + createData: any; + fileDependencies: LazySet; + missingDependencies: LazySet; + contextDependencies: LazySet; +} + +/** + * Options object for resolving requests. + */ +declare interface ResolveOptions { + /** + * Redirect module requests. + */ + alias?: + | Array<{ + /** + * New request. + */ + alias: string | false | Array; + /** + * Request to be redirected. + */ + name: string; + /** + * Redirect only exact matching request. + */ + onlyModule?: boolean; + }> + | { [index: string]: string | false | Array }; + + /** + * Fields in the description file (usually package.json) which are used to redirect requests inside the module. + */ + aliasFields?: Array>; + + /** + * Enable caching of successfully resolved requests (cache entries are revalidated). + */ + cache?: boolean; + + /** + * Predicate function to decide which requests should be cached. + */ + cachePredicate?: Function; + + /** + * Include the context information in the cache identifier when caching. + */ + cacheWithContext?: boolean; + + /** + * Filenames used to find a description file (like a package.json). + */ + descriptionFiles?: Array; + + /** + * Enforce using one of the extensions from the extensions option. + */ + enforceExtension?: boolean; + + /** + * Extensions added to the request when trying to find the file. + */ + extensions?: Array; + + /** + * Filesystem for the resolver. + */ + fileSystem?: { [index: string]: any }; + + /** + * Field names from the description file (package.json) which are used to find the default entry point. + */ + mainFields?: Array>; + + /** + * Filenames used to find the default entry point if there is no description file or main field. + */ + mainFiles?: Array; + + /** + * Folder names or directory paths where to find modules. + */ + modules?: Array; + + /** + * Plugins for the resolver. + */ + plugins?: Array; + + /** + * Custom resolver. + */ + resolver?: { [index: string]: any }; + + /** + * Enable resolving symlinks to the original location. + */ + symlinks?: boolean; + + /** + * Enable caching of successfully resolved requests (cache entries are not revalidated). + */ + unsafeCache?: boolean | { [index: string]: any }; + + /** + * Use synchronous filesystem calls for the resolver. + */ + useSyncFileSystemCalls?: boolean; +} + +/** + * Plugin instance. + */ +declare interface ResolvePluginInstance { + [index: string]: any; + + /** + * The run point of the plugin, required method. + */ + apply: (resolver?: any) => void; +} +declare abstract class Resolver { + resolve( + context: Object, + path: string, + request: string, + resolveContext: ResolveContext, + callback: ( + err: NodeJS.ErrnoException, + result: string, + additionalInfo: Object + ) => void + ): void; +} +declare interface ResolverCache { + direct: WeakMap; + stringified: Map; +} +declare abstract class ResolverFactory { + hooks: Readonly<{ + resolveOptions: HookMap>; + resolver: HookMap>; + }>; + cache: Map; + get(type: string, resolveOptions?: any): Resolver & WithOptions; +} +declare interface RuleSet { + /** + * map of references in the rule set (may grow over time) + */ + references: Map; + + /** + * execute the rule set + */ + exec: (arg0?: any) => Array; +} +type RuleSetCondition = + | string + | RegExp + | { + /** + * Logical AND. + */ + and?: Array; + /** + * Logical NOT. + */ + not?: Array; + /** + * Logical OR. + */ + or?: Array; + } + | ((value: string) => boolean) + | Array; +type RuleSetConditionAbsolute = + | string + | RegExp + | { + /** + * Logical AND. + */ + and?: Array; + /** + * Logical NOT. + */ + not?: Array; + /** + * Logical OR. + */ + or?: Array; + } + | ((value: string) => boolean) + | Array; +type RuleSetLoaderOptions = string | { [index: string]: any }; + +/** + * A rule description with conditions and effects for modules. + */ +declare interface RuleSetRule { + /** + * Match the child compiler name. + */ + compiler?: RuleSetCondition; + + /** + * Enforce this rule as pre or post step. + */ + enforce?: "pre" | "post"; + + /** + * Shortcut for resource.exclude. + */ + exclude?: RuleSetConditionAbsolute; + + /** + * The options for the module generator. + */ + generator?: { [index: string]: any }; + + /** + * Shortcut for resource.include. + */ + include?: RuleSetConditionAbsolute; + + /** + * Match the issuer of the module (The module pointing to this module). + */ + issuer?: RuleSetConditionAbsolute; + + /** + * Shortcut for use.loader. + */ + loader?: string; + + /** + * Only execute the first matching rule in this array. + */ + oneOf?: Array; + + /** + * Shortcut for use.options. + */ + options?: RuleSetLoaderOptions; + + /** + * Options for parsing. + */ + parser?: { [index: string]: any }; + + /** + * Match the real resource path of the module. + */ + realResource?: RuleSetConditionAbsolute; + + /** + * Options for the resolver. + */ + resolve?: ResolveOptions; + + /** + * Match the resource path of the module. + */ + resource?: RuleSetConditionAbsolute; + + /** + * Match the resource query of the module. + */ + resourceQuery?: RuleSetCondition; + + /** + * Match and execute these rules when this rule is matched. + */ + rules?: Array; + + /** + * Flags a module as with or without side effects. + */ + sideEffects?: boolean; + + /** + * Shortcut for resource.test. + */ + test?: RuleSetConditionAbsolute; + + /** + * Module type to use for the module. + */ + type?: string; + + /** + * Modifiers applied to the module when rule is matched. + */ + use?: RuleSetUse; +} +type RuleSetUse = + | string + | Array + | ((data: { + resource: string; + realResource: string; + resourceQuery: string; + issuer: string; + compiler: string; + }) => Array) + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: RuleSetLoaderOptions; + } + | ((data: {}) => + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: RuleSetLoaderOptions; + } + | __TypeWebpackOptions + | Array); +type RuleSetUseItem = + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: RuleSetLoaderOptions; + } + | __TypeWebpackOptions; +type RulesBannerPlugin = string | RegExp | Array; +type RulesSourceMapDevToolPlugin = string | RegExp | Array; +declare class RuntimeChunkPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class RuntimeModule extends Module { + constructor(name: string, stage?: number); + name: string; + stage: number; + compilation: Compilation; + chunk: Chunk; + attach(compilation: Compilation, chunk: Chunk): void; + generate(): string; + getGeneratedCode(): string; +} +declare abstract class RuntimeTemplate { + outputOptions: Output; + requestShortener: RequestShortener; + isIIFE(): boolean; + supportsConst(): boolean; + supportsArrowFunction(): boolean; + supportsForOf(): boolean; + returningFunction(returnValue?: any, args?: string): string; + basicFunction(args?: any, body?: any): string; + iife(args?: any, body?: any): string; + forEach(variable?: any, array?: any, body?: any): string; + + /** + * Add a comment + */ + comment(__0: { + /** + * request string used originally + */ + request?: string; + /** + * name of the chunk referenced + */ + chunkName?: string; + /** + * reason information of the chunk + */ + chunkReason?: string; + /** + * additional message + */ + message?: string; + /** + * name of the export + */ + exportName?: string; + }): string; + throwMissingModuleErrorBlock(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + throwMissingModuleErrorFunction(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + missingModule(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + missingModuleStatement(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + missingModulePromise(__0: { + /** + * request string used originally + */ + request?: string; + }): string; + weakError(__0: { /** * the chunk graph */ - chunkGraph: webpack.ChunkGraph; - + chunkGraph: ChunkGraph; /** - * results of code generation + * the module */ - codeGenerationResults: Map; - + module: Module; /** - * hash to be used for render call + * the request that should be printed as comment */ - hash: string; - } - export abstract class MainTemplate { - hooks: Readonly<{ - renderManifest: { tap: (options?: any, fn?: any) => void }; - modules: { tap: () => never }; - moduleObj: { tap: () => never }; - require: { tap: (options?: any, fn?: any) => void }; - beforeStartup: { tap: () => never }; - startup: { tap: () => never }; - afterStartup: { tap: () => never }; - render: { tap: (options?: any, fn?: any) => void }; - renderWithEntry: { tap: (options?: any, fn?: any) => void }; - assetPath: { - tap: (options?: any, fn?: any) => void; - call: (filename?: any, options?: any) => string; - }; - hash: { tap: (options?: any, fn?: any) => void }; - hashForChunk: { tap: (options?: any, fn?: any) => void }; - globalHashPaths: { tap: () => void }; - globalHash: { tap: () => void }; - hotBootstrap: { tap: () => never }; - bootstrap: SyncWaterfallHook< - [ - string, - webpack.Chunk, - string, - webpack.ModuleTemplate, - webpack.DependencyTemplates - ] - >; - localVars: SyncWaterfallHook<[string, webpack.Chunk, string]>; - requireExtensions: SyncWaterfallHook<[string, webpack.Chunk, string]>; - requireEnsure: SyncWaterfallHook<[string, webpack.Chunk, string, string]>; - }>; - renderCurrentHashCode: (hash: string, length?: number) => string; - getPublicPath: (options?: any) => string; - getAssetPath: (path?: any, options?: any) => string; - getAssetPathWithInfo: ( - path?: any, - options?: any - ) => { path: string; info: webpack.AssetInfo }; - readonly requireFn: string; - readonly outputOptions: any; - } - export interface MapOptions { - columns?: boolean; - module?: boolean; - } - - /** - * Options object for in-memory caching. - */ - export interface MemoryCacheOptions { - /** - * List of paths that are managed by a package manager and contain a version or hash in it's path so all files are immutable. - */ - immutablePaths?: Array; - - /** - * List of paths that are managed by a package manager and can be trusted to not be modified otherwise. - */ - managedPaths?: Array; - - /** - * In memory caching. - */ - type: "memory"; - } - export class MemoryCachePlugin { - constructor(); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export class MinChunkSizePlugin { - constructor(options: webpack.MinChunkSizePluginOptions); - options: webpack.MinChunkSizePluginOptions; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - - /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - export interface MinChunkSizePluginOptions { - /** - * Constant overhead for a chunk. - */ - chunkOverhead?: number; - - /** - * Multiplicator for initial chunks. - */ - entryChunkMultiplicator?: number; - - /** - * Minimum number of characters. - */ - minChunkSize: number; - } - export type Mode = "development" | "production" | "none"; - export class Module extends webpack.DependenciesBlock { - constructor(type: string, context?: string); - type: string; - context: string; - needId: boolean; - debugId: number; - resolveOptions: any; - factoryMeta: any; - buildMeta: webpack.KnownBuildMeta & Record; - buildInfo: any; - presentationalDependencies: Array; - id: string | number; - readonly hash: string; - readonly renderedHash: string; - profile: webpack.ModuleProfile; - index: number; - index2: number; - depth: number; - issuer: webpack.Module; - readonly usedExports: boolean | webpack.SortableSet; - readonly optimizationBailout: Array< - string | ((requestShortener: webpack.RequestShortener) => string) - >; - readonly optional: boolean; - addChunk(chunk?: any): boolean; - removeChunk(chunk?: any): void; - isInChunk(chunk?: any): boolean; - isEntryModule(): boolean; - getChunks(): Array; - getNumberOfChunks(): number; - readonly chunksIterable: Iterable; - isProvided(exportName: string): boolean; - readonly exportsArgument: string; - readonly moduleArgument: string; - getExportsType( - strict: boolean - ): - | "dynamic" - | "dynamic-default" - | "namespace" - | "default-only" - | "default-with-named"; - addPresentationalDependency( - presentationalDependency: webpack.Dependency - ): void; - addWarning(warning: webpack.WebpackError): void; - getWarnings(): Iterable; - addError(error: webpack.WebpackError): void; - getErrors(): Iterable; - - /** - * removes all warnings and errors - */ - clearWarningsAndErrors(): void; - isOptional(moduleGraph: webpack.ModuleGraph): boolean; - isAccessibleInChunk( - chunkGraph: webpack.ChunkGraph, - chunk: webpack.Chunk, - ignoreChunk?: webpack.Chunk - ): boolean; - isAccessibleInChunkGroup( - chunkGraph: webpack.ChunkGraph, - chunkGroup: webpack.ChunkGroup, - ignoreChunk?: webpack.Chunk - ): boolean; - hasReasonForChunk( - chunk: webpack.Chunk, - moduleGraph: webpack.ModuleGraph, - chunkGraph: webpack.ChunkGraph - ): boolean; - hasReasons(moduleGraph: webpack.ModuleGraph): boolean; - isModuleUsed(moduleGraph: webpack.ModuleGraph): boolean; - isExportUsed( - moduleGraph: webpack.ModuleGraph, - exportName: string | Array - ): 0 | 1 | 2 | 3 | 4; - getUsedName( - moduleGraph: webpack.ModuleGraph, - exportName: string | Array - ): string | false | Array; - needBuild( - context: webpack.NeedBuildContext, - callback: (arg0: webpack.WebpackError, arg1: boolean) => void - ): void; - needRebuild(fileTimestamps?: any, contextTimestamps?: any): boolean; - invalidateBuild(): void; - identifier(): string; - readableIdentifier(requestShortener: webpack.RequestShortener): string; - build( - options: webpack.WebpackOptionsNormalized, - compilation: webpack.Compilation, - resolver: webpack.Resolver & webpack.WithOptions, - fs: webpack.InputFileSystem, - callback: (arg0: webpack.WebpackError) => void - ): void; - getSourceTypes(): Set; - source(sourceContext: webpack.SourceContext): webpack.Source; - size(type?: string): number; - libIdent(options: webpack.LibIdentOptions): string; - nameForCondition(): string; - getRuntimeRequirements(context: webpack.SourceContext): ReadonlySet; - codeGeneration( - context: webpack.CodeGenerationContext - ): webpack.CodeGenerationResult; - chunkCondition( - chunk: webpack.Chunk, - compilation: webpack.Compilation - ): boolean; - - /** - * Assuming this module is in the cache. Update the (cached) module with - * the fresh module from the factory. Usually updates internal references - * and properties. - */ - updateCacheModule(module: webpack.Module): void; - originalSource(): webpack.Source; - useSourceMap: any; - readonly hasEqualsChunks: any; - readonly isUsed: any; - readonly errors: any; - readonly warnings: any; - used: any; - } - export class ModuleConcatenationPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export abstract class ModuleDependency extends webpack.Dependency { request: string; - userRequest: string; - range: any; - } - export abstract class ModuleFactory { - create( - data: webpack.ModuleFactoryCreateData, - callback: (arg0: Error, arg1: webpack.ModuleFactoryResult) => void - ): void; - } - export interface ModuleFactoryCreateData { - contextInfo: webpack.ModuleFactoryCreateDataContextInfo; - resolveOptions?: any; - context: string; - dependencies: Array; - } - export interface ModuleFactoryCreateDataContextInfo { - issuer: string; - compiler: string; - } - export interface ModuleFactoryResult { /** - * the created module or unset if no module was created + * expression to use as id expression */ - module?: webpack.Module; - fileDependencies?: Set; - contextDependencies?: Set; - missingDependencies?: Set; + idExpr?: string; + /** + * which kind of code should be returned + */ + type: "expression" | "promise" | "statements"; + }): string; + moduleId(__0: { + /** + * the module + */ + module: Module; + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + }): string; + moduleRaw(__0: { + /** + * the module + */ + module: Module; + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + moduleExports(__0: { + /** + * the module + */ + module: Module; + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + moduleNamespace(__0: { + /** + * the module + */ + module: Module; + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * if the current module is in strict esm mode + */ + strict?: boolean; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + moduleNamespacePromise(__0: { + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + /** + * the current dependencies block + */ + block?: AsyncDependenciesBlock; + /** + * the module + */ + module: Module; + /** + * the request that should be printed as comment + */ + request: string; + /** + * a message for the comment + */ + message: string; + /** + * if the current module is in strict esm mode + */ + strict?: boolean; + /** + * if the dependency is weak (will create a nice error message) + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + importStatement(__0: { + /** + * whether a new variable should be created or the existing one updated + */ + update?: boolean; + /** + * the module + */ + module: Module; + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + /** + * the request that should be printed as comment + */ + request: string; + /** + * name of the import variable + */ + importVar: string; + /** + * module in which the statement is emitted + */ + originModule: Module; + /** + * true, if this is a weak dependency + */ + weak?: boolean; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + exportFromImport(__0: { + /** + * the module graph + */ + moduleGraph: ModuleGraph; + /** + * the module + */ + module: Module; + /** + * the request + */ + request: string; + /** + * the export name + */ + exportName: string | Array; + /** + * the origin module + */ + originModule: Module; + /** + * true, if location is safe for ASI, a bracket can be emitted + */ + asiSafe: boolean; + /** + * true, if expression will be called + */ + isCall: boolean; + /** + * when false, call context will not be preserved + */ + callContext: boolean; + /** + * when true and accessing the default exports, interop code will be generated + */ + defaultInterop: boolean; + /** + * the identifier name of the import variable + */ + importVar: string; + /** + * init fragments will be added here + */ + initFragments: Array; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + blockPromise(__0: { + /** + * the async block + */ + block: AsyncDependenciesBlock; + /** + * the message + */ + message: string; + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; + defineEsModuleFlagStatement(__0: { + /** + * the name of the exports object + */ + exportsArgument: string; + /** + * if set, will be filled with runtime requirements + */ + runtimeRequirements: Set; + }): string; +} +declare abstract class RuntimeValue { + fn: any; + fileDependencies: any; + exec(parser?: any): any; +} +declare const SKIP_OVER_NAME: unique symbol; +declare interface ScopeInfo { + definitions: StackedMap; + topLevelScope: boolean | "arrow"; + inShorthand: boolean; + isStrict: boolean; + isAsmJs: boolean; + inTry: boolean; +} +declare abstract class Serializer { + serializeMiddlewares: any; + deserializeMiddlewares: any; + context: any; + serialize(obj?: any, context?: any): any; + deserialize(value?: any, context?: any): any; +} +declare class SideEffectsFlagPlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + static moduleHasSideEffects( + moduleName?: any, + flagValue?: any, + cache?: any + ): any; +} + +/** + * istanbul ignore next + */ +declare interface Snapshot { + startTime?: number; + fileTimestamps?: Map; + fileHashes?: Map; + contextTimestamps?: Map; + contextHashes?: Map; + missingExistence?: Map; + managedItemInfo?: Map; + children?: Set; +} +declare abstract class SortableSet extends Set { + /** + * Sort with a comparer function + */ + sortWith(sortFn: (arg0: T, arg1: T) => number): void; + sort(): void; + + /** + * Get data from cache + */ + getFromCache(fn: (arg0: SortableSet) => R): R; + + /** + * Get data from cache (ignoring sorting) + */ + getFromUnorderedCache(fn: (arg0: SortableSet) => R): R; + toJSON(): Array; + + /** + * Iterates over values in the set. + */ + [Symbol.iterator](): IterableIterator; + readonly [Symbol.toStringTag]: string; +} +declare abstract class Source { + size(): number; + map(options: MapOptions): Object; + sourceAndMap(options: MapOptions): { source: string | Buffer; map: Object }; + updateHash(hash: Hash): void; + source(): string | Buffer; + buffer(): Buffer; +} +declare interface SourceContext { + /** + * the dependency templates + */ + dependencyTemplates: DependencyTemplates; + + /** + * the runtime template + */ + runtimeTemplate: RuntimeTemplate; + + /** + * the module graph + */ + moduleGraph: ModuleGraph; + + /** + * the chunk graph + */ + chunkGraph: ChunkGraph; + + /** + * the type of source that should be generated + */ + type?: string; +} +declare class SourceMapDevToolPlugin { + constructor(options?: SourceMapDevToolPluginOptions); + sourceMapFilename: DevTool; + sourceMappingURLComment: DevTool; + moduleFilenameTemplate: DevtoolFallbackModuleFilenameTemplate; + fallbackModuleFilenameTemplate: DevtoolFallbackModuleFilenameTemplate; + namespace: string; + options: SourceMapDevToolPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface SourceMapDevToolPluginOptions { + /** + * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending. + */ + append?: DevTool; + + /** + * Indicates whether column mappings should be used (defaults to true). + */ + columns?: boolean; + + /** + * Exclude modules that match the given value from source map generation. + */ + exclude?: RulesSourceMapDevToolPlugin; + + /** + * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict. + */ + fallbackModuleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate; + + /** + * Path prefix to which the [file] placeholder is relative to. + */ + fileContext?: string; + + /** + * Defines the output filename of the SourceMap (will be inlined if no value is provided). + */ + filename?: DevTool; + + /** + * Include source maps for module paths that match the given value. + */ + include?: RulesSourceMapDevToolPlugin; + + /** + * Indicates whether SourceMaps from loaders should be used (defaults to true). + */ + module?: boolean; + + /** + * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap. + */ + moduleFilenameTemplate?: DevtoolFallbackModuleFilenameTemplate; + + /** + * Namespace prefix to allow multiple webpack roots in the devtools. + */ + namespace?: string; + + /** + * Omit the 'sourceContents' array from the SourceMap. + */ + noSources?: boolean; + + /** + * Provide a custom public path for the SourceMapping comment. + */ + publicPath?: string; + + /** + * Provide a custom value for the 'sourceRoot' property in the SourceMap. + */ + sourceRoot?: string; + + /** + * Include source maps for modules based on their extension (defaults to .js and .css). + */ + test?: RulesSourceMapDevToolPlugin; +} +declare interface SourcePosition { + line: number; + column?: number; +} +declare interface SplitChunksOptions { + chunksFilter: (chunk: Chunk) => boolean; + minSize: Record; + minRemainingSize: Record; + maxInitialSize: Record; + maxAsyncSize: Record; + minChunks: number; + maxAsyncRequests: number; + maxInitialRequests: number; + hidePathInfo: boolean; + filename: string | ((arg0: PathData, arg1: AssetInfo) => string); + automaticNameDelimiter: string; + getCacheGroups: ( + module: Module, + context: CacheGroupsContext + ) => Array; + getName: (module?: Module, chunks?: Array, key?: string) => string; + fallbackCacheGroup: FallbackCacheGroup; +} +declare class SplitChunksPlugin { + constructor(options?: OptimizationSplitChunksOptions); + options: SplitChunksOptions; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare abstract class StackedMap { + map: Map; + stack: Array>; + set(item: K, value: V): void; + delete(item: K): void; + has(item: K): boolean; + get(item: K): V; + asArray(): Array; + asSet(): Set; + asPairArray(): Array<[K, V]>; + asMap(): Map; + readonly size: number; + createChild(): StackedMap; +} +type Statement = + | ExpressionStatement + | BlockStatement + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | FunctionDeclaration + | VariableDeclaration + | ClassDeclaration; +declare class Stats { + constructor(compilation: Compilation); + compilation: Compilation; + hash: string; + startTime: any; + endTime: any; + hasWarnings(): boolean; + hasErrors(): boolean; + toJson(options?: any): any; + toString(options?: any): any; +} +declare abstract class StatsFactory { + hooks: Readonly<{ + extract: HookMap>; + filter: HookMap>; + sort: HookMap< + SyncBailHook<[Array<(arg0?: any, arg1?: any) => number>, any], any> + >; + filterSorted: HookMap>; + sortResults: HookMap< + SyncBailHook<[Array<(arg0?: any, arg1?: any) => number>, any], any> + >; + filterResults: HookMap>; + merge: HookMap, any], any>>; + result: HookMap, any], any>>; + getItemName: HookMap>; + getItemFactory: HookMap>; + }>; + create(type?: any, data?: any, baseContext?: any): any; +} + +/** + * Stats options object. + */ +declare interface StatsOptions { + /** + * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults). + */ + all?: boolean; + + /** + * Add assets information. + */ + assets?: boolean; + + /** + * Sort the assets by that field. + */ + assetsSort?: string; + + /** + * Add built at time information. + */ + builtAt?: boolean; + + /** + * Add information about cached (not built) modules. + */ + cached?: boolean; + + /** + * Show cached assets (setting this to `false` only shows emitted files). + */ + cachedAssets?: boolean; + + /** + * Add children information. + */ + children?: boolean; + + /** + * Display all chunk groups with the corresponding bundles. + */ + chunkGroups?: boolean; + + /** + * Add built modules information to chunk information. + */ + chunkModules?: boolean; + + /** + * Add the origins of chunks and chunk merging info. + */ + chunkOrigins?: boolean; + + /** + * Add information about parent, children and sibling chunks to chunk information. + */ + chunkRelations?: boolean; + + /** + * Add root modules information to chunk information. + */ + chunkRootModules?: boolean; + + /** + * Add chunk information. + */ + chunks?: boolean; + + /** + * Sort the chunks by that field. + */ + chunksSort?: string; + + /** + * Enables/Disables colorful output. + */ + colors?: + | boolean + | { + /** + * Custom color for bold text. + */ + bold?: string; + /** + * Custom color for cyan text. + */ + cyan?: string; + /** + * Custom color for green text. + */ + green?: string; + /** + * Custom color for magenta text. + */ + magenta?: string; + /** + * Custom color for red text. + */ + red?: string; + /** + * Custom color for yellow text. + */ + yellow?: string; + }; + + /** + * Context directory for request shortening. + */ + context?: string; + + /** + * Add module depth in module graph. + */ + depth?: boolean; + + /** + * Display the entry points with the corresponding bundles. + */ + entrypoints?: boolean; + + /** + * Add --env information. + */ + env?: boolean; + + /** + * Add details to errors (like resolving log). + */ + errorDetails?: boolean; + + /** + * Add internal stack trace to errors. + */ + errorStack?: boolean; + + /** + * Add errors. + */ + errors?: boolean; + + /** + * Please use excludeModules instead. + */ + exclude?: + | string + | boolean + | RegExp + | Array + | ((value: string) => boolean); + + /** + * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions. + */ + excludeAssets?: FilterTypes; + + /** + * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions. + */ + excludeModules?: + | string + | boolean + | RegExp + | Array + | ((value: string) => boolean); + + /** + * Add the hash of the compilation. + */ + hash?: boolean; + + /** + * Add ids. + */ + ids?: boolean; + + /** + * Add logging output. + */ + logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log"; + + /** + * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions. + */ + loggingDebug?: + | string + | boolean + | RegExp + | Array + | ((value: string) => boolean); + + /** + * Add stack traces to logging output. + */ + loggingTrace?: boolean; + + /** + * Set the maximum number of modules to be shown. + */ + maxModules?: number; + + /** + * Add information about assets inside modules. + */ + moduleAssets?: boolean; + + /** + * Add dependencies and origin of warnings/errors. + */ + moduleTrace?: boolean; + + /** + * Add built modules information. + */ + modules?: boolean; + + /** + * Sort the modules by that field. + */ + modulesSort?: string; + + /** + * Add information about modules nested in other modules (like with module concatenation). + */ + nestedModules?: boolean; + + /** + * Show reasons why optimization bailed out for modules. + */ + optimizationBailout?: boolean; + + /** + * Add information about orphan modules. + */ + orphanModules?: boolean; + + /** + * Add output path information. + */ + outputPath?: boolean; + + /** + * Add performance hint flags. + */ + performance?: boolean; + + /** + * Preset for the default values. + */ + preset?: string | boolean; + + /** + * Show exports provided by modules. + */ + providedExports?: boolean; + + /** + * Add public path information. + */ + publicPath?: boolean; + + /** + * Add information about the reasons why modules are included. + */ + reasons?: boolean; + + /** + * Add information about runtime modules. + */ + runtime?: boolean; + + /** + * Add the source code of modules. + */ + source?: boolean; + + /** + * Add timing information. + */ + timings?: boolean; + + /** + * Show exports used by modules. + */ + usedExports?: boolean; + + /** + * Add webpack version information. + */ + version?: boolean; + + /** + * Add warnings. + */ + warnings?: boolean; + + /** + * Suppress warnings that match the specified filters. Filters can be Strings, RegExps or Functions. + */ + warningsFilter?: FilterTypes; +} +declare abstract class StatsPrinter { + hooks: Readonly<{ + sortElements: HookMap, any], any>>; + printElements: HookMap, any], any>>; + sortItems: HookMap, any], any>>; + getItemName: HookMap>; + printItems: HookMap, any], any>>; + print: HookMap>; + result: HookMap>; + }>; + print(type?: any, object?: any, baseContext?: any): any; +} +type StatsValue = + | boolean + | "none" + | "errors-only" + | "minimal" + | "normal" + | "detailed" + | "verbose" + | "errors-warnings" + | StatsOptions; +declare interface SyntheticDependencyLocation { + name: string; + index?: number; +} +declare const TOMBSTONE: unique symbol; +declare interface TagInfo { + tag: any; + data: any; + next: TagInfo; +} +type Target = + | "web" + | "webworker" + | "node" + | "async-node" + | "node-webkit" + | "electron-main" + | "electron-renderer" + | "electron-preload" + | ((compiler: Compiler) => void); +declare class Template { + constructor(); + static getFunctionContent(fn: Function): string; + static toIdentifier(str: string): string; + static toComment(str: string): string; + static toNormalComment(str: string): string; + static toPath(str: string): string; + static numberToIdentifier(n: number): string; + static numberToIdentifierContinuation(n: number): string; + static indent(s: string | Array): string; + static prefix(s: string | Array, prefix: string): string; + static asString(str: string | Array): string; + static getModulesArrayBounds( + modules: Array + ): false | [number, number]; + static renderChunkModules( + renderContext: RenderContextModuleTemplate, + modules: Array, + renderModule: (arg0: Module) => Source, + prefix?: string + ): Source; + static renderRuntimeModules( + runtimeModules: Array, + renderContext: RenderContextModuleTemplate + ): Source; + static renderChunkRuntimeModules( + runtimeModules: Array, + renderContext: RenderContextModuleTemplate + ): Source; + static NUMBER_OF_IDENTIFIER_START_CHARS: number; + static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number; +} +declare const UNDEFINED_MARKER: unique symbol; +declare interface UpdateHashContext { + /** + * the module + */ + module: NormalModule; + + /** + * the compilation + */ + compilation: Compilation; +} +declare abstract class VariableInfo { + declaredScope: ScopeInfo; + freeName: string | true; + tagInfo: TagInfo; +} +declare class WatchIgnorePlugin { + constructor(options: WatchIgnorePluginOptions); + paths: [string | RegExp, string | RegExp]; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} + +/** + * This file was automatically generated. + * DO NOT MODIFY BY HAND. + * Run `yarn special-lint-fix` to update + */ +declare interface WatchIgnorePluginOptions { + /** + * A list of RegExps or absolute paths to directories or files that should be ignored. + */ + paths: [string | RegExp, string | RegExp]; +} + +/** + * Options for the watcher. + */ +declare interface WatchOptions { + /** + * Delay the rebuilt after the first change. Value is a time in ms. + */ + aggregateTimeout?: number; + + /** + * Ignore some files from watching (glob pattern). + */ + ignored?: string | Array; + + /** + * Enable polling mode for watching. + */ + poll?: number | boolean; + + /** + * Stop watching when stdin stream has ended. + */ + stdin?: boolean; +} +declare abstract class Watching { + startTime: number; + invalid: boolean; + handler: CallbackFunction; + callbacks: Array>; + closed: boolean; + suspended: boolean; + watchOptions: { + /** + * Delay the rebuilt after the first change. Value is a time in ms. + */ + aggregateTimeout?: number; + /** + * Ignore some files from watching (glob pattern). + */ + ignored?: string | Array; + /** + * Enable polling mode for watching. + */ + poll?: number | boolean; + /** + * Stop watching when stdin stream has ended. + */ + stdin?: boolean; + }; + compiler: Compiler; + running: boolean; + watcher: any; + pausedWatcher: any; + watch( + files: Iterable, + dirs: Iterable, + missing: Iterable + ): void; + invalidate(callback?: CallbackFunction): void; + suspend(): void; + resume(): void; + close(callback: CallbackFunction): void; +} +declare class WebWorkerTemplatePlugin { + constructor(); + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare interface WebpackError extends Error { + details: any; + module: Module; + loc: SyntheticDependencyLocation | RealDependencyLocation; + hideStack: boolean; + chunk: Chunk; + file: string; + serialize(__0: { write: any }): void; + deserialize(__0: { read: any }): void; +} +declare abstract class WebpackLogger { + getChildLogger: (arg0: string | (() => string)) => WebpackLogger; + error(...args: Array): void; + warn(...args: Array): void; + info(...args: Array): void; + log(...args: Array): void; + debug(...args: Array): void; + assert(assertion: any, ...args: Array): void; + trace(): void; + clear(): void; + status(...args: Array): void; + group(...args: Array): void; + groupCollapsed(...args: Array): void; + groupEnd(...args: Array): void; + profile(label?: any): void; + profileEnd(label?: any): void; + time(label?: any): void; + timeLog(label?: any): void; + timeEnd(label?: any): void; + timeAggregate(label?: any): void; + timeAggregateEnd(label?: any): void; +} +declare class WebpackOptionsApply extends OptionsApply { + constructor(); +} +declare class WebpackOptionsDefaulter { + constructor(); + process(options?: any): any; +} + +/** + * Normalized webpack options object. + */ +declare interface WebpackOptionsNormalized { + /** + * Set the value of `require.amd` and `define.amd`. Or disable AMD support. + */ + amd?: Amd; + + /** + * Report the first error as a hard error instead of tolerating it. + */ + bail?: boolean; + + /** + * Cache generated modules and chunks to improve performance for multiple incremental builds. + */ + cache: CacheOptionsNormalized; + + /** + * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. + */ + context?: string; + + /** + * References to other configurations to depend on. + */ + dependencies?: Array; + + /** + * Options for the webpack-dev-server. + */ + devServer?: DevServer; + + /** + * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). + */ + devtool?: DevTool; + + /** + * The entry point(s) of the compilation. + */ + entry: EntryNormalized; + + /** + * Enables/Disables experiments (experimental features with relax SemVer compatibility). + */ + experiments: Experiments; + + /** + * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. + */ + externals: Externals; + + /** + * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value). + */ + externalsType?: ExternalsType; + + /** + * Options for infrastructure level logging. + */ + infrastructureLogging: InfrastructureLogging; + + /** + * Custom values available in the loader context. + */ + loader?: Loader; + + /** + * Enable production optimizations or development hints. + */ + mode?: Mode; + + /** + * Options affecting the normal modules (`NormalModuleFactory`). + */ + module: ModuleOptions; + + /** + * Name of the configuration. Used when loading multiple configurations. + */ + name?: string; + + /** + * Include polyfills or mocks for various node stuff. + */ + node: Node; + + /** + * Enables/Disables integrated optimizations. + */ + optimization: Optimization; + + /** + * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. + */ + output: OutputNormalized; + + /** + * The number of parallel processed modules in the compilation. + */ + parallelism?: number; + + /** + * Configuration for web performance recommendations. + */ + performance?: Performance; + + /** + * Add additional plugins to the compiler. + */ + plugins: Array< + ((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance + >; + + /** + * Capture timing information for each module. + */ + profile?: boolean; + + /** + * Store compiler state to a json file. + */ + recordsInputPath?: DevTool; + + /** + * Load compiler state from a json file. + */ + recordsOutputPath?: DevTool; + + /** + * Options for the resolver. + */ + resolve: ResolveOptions; + + /** + * Options for the resolver when resolving loaders. + */ + resolveLoader: ResolveOptions; + + /** + * Stats options object or preset name. + */ + stats: StatsValue; + + /** + * Environment to build for. + */ + target?: Target; + + /** + * Enter watch mode, which rebuilds on file change. + */ + watch?: boolean; + + /** + * Options for the watcher. + */ + watchOptions: WatchOptions; +} + +/** + * Plugin instance. + */ +declare interface WebpackPluginInstance { + [index: string]: any; + + /** + * The run point of the plugin, required method. + */ + apply: (compiler: Compiler) => void; +} +declare interface WithId { + id: string | number; +} +declare interface WithOptions { + /** + * create a resolver with additional/different options + */ + withOptions: (arg0?: any) => Resolver & WithOptions; +} +declare interface WriteOnlySet { + add(item: T): void; +} +type __TypeWebpackOptions = (data: {}) => + | string + | { + /** + * Unique loader options identifier. + */ + ident?: string; + /** + * Loader name. + */ + loader?: string; + /** + * Loader options. + */ + options?: RuleSetLoaderOptions; + } + | __TypeWebpackOptions + | Array; +declare function exports( + options: Configuration | Array, + callback?: CallbackWebpack +): Compiler | MultiCompiler; +declare namespace exports { + export const webpack: ( + options: Configuration | Array, + callback?: CallbackWebpack + ) => Compiler | MultiCompiler; + export const validate: any; + export const validateSchema: (schema?: any, options?: any) => void; + export const version: any; + export namespace cli { + export let getArguments: (schema?: any) => Record; + export let processArguments: ( + args: Record, + config: any, + values: Record< + string, + | string + | number + | boolean + | RegExp + | Array + > + ) => Array; } export namespace ModuleFilenameHelpers { export let ALL_LOADERS_RESOURCE: string; @@ -5067,2424 +7187,6 @@ declare namespace webpack { export let matchPart: (str?: any, test?: any) => any; export let matchObject: (obj?: any, str?: any) => boolean; } - export class ModuleGraph { - constructor(); - setParents( - dependency: webpack.Dependency, - block: webpack.DependenciesBlock, - module: webpack.Module - ): void; - getParentModule(dependency: webpack.Dependency): webpack.Module; - getParentBlock(dependency: webpack.Dependency): webpack.DependenciesBlock; - setResolvedModule( - originModule: webpack.Module, - dependency: webpack.Dependency, - module: webpack.Module - ): void; - updateModule(dependency: webpack.Dependency, module: webpack.Module): void; - removeConnection(dependency: webpack.Dependency): void; - addExplanation(dependency: webpack.Dependency, explanation: string): void; - cloneModuleAttributes( - sourceModule: webpack.Module, - targetModule: webpack.Module - ): void; - removeModuleAttributes(module: webpack.Module): void; - removeAllModuleAttributes(): void; - moveModuleConnections( - oldModule: webpack.Module, - newModule: webpack.Module, - filterConnection: (arg0: webpack.ModuleGraphConnection) => boolean - ): void; - addExtraReason(module: webpack.Module, explanation: string): void; - getResolvedModule(dependency: webpack.Dependency): webpack.Module; - finishModule(module: webpack.Module): void; - getConnection( - dependency: webpack.Dependency - ): webpack.ModuleGraphConnection; - getModule(dependency: webpack.Dependency): webpack.Module; - getOrigin(dependency: webpack.Dependency): webpack.Module; - getResolvedOrigin(dependency: webpack.Dependency): webpack.Module; - getIncomingConnections( - module: webpack.Module - ): Iterable; - getOutgoingConnections( - module: webpack.Module - ): Iterable; - getProfile(module: webpack.Module): webpack.ModuleProfile; - setProfile(module: webpack.Module, profile: webpack.ModuleProfile): void; - getIssuer(module: webpack.Module): webpack.Module; - setIssuer(module: webpack.Module, issuer: webpack.Module): void; - setIssuerIfUnset(module: webpack.Module, issuer: webpack.Module): void; - getOptimizationBailout( - module: webpack.Module - ): Array string)>; - getProvidedExports(module: webpack.Module): true | Array; - isExportProvided( - module: webpack.Module, - exportName: string | Array - ): boolean; - getExportsInfo(module: webpack.Module): webpack.ExportsInfo; - getExportInfo( - module: webpack.Module, - exportName: string - ): webpack.ExportInfo; - getReadOnlyExportInfo( - module: webpack.Module, - exportName: string - ): webpack.ExportInfo; - getUsedExports( - module: webpack.Module - ): boolean | webpack.SortableSet; - getPreOrderIndex(module: webpack.Module): number; - getPostOrderIndex(module: webpack.Module): number; - setPreOrderIndex(module: webpack.Module, index: number): void; - setPreOrderIndexIfUnset(module: webpack.Module, index: number): boolean; - setPostOrderIndex(module: webpack.Module, index: number): void; - setPostOrderIndexIfUnset(module: webpack.Module, index: number): boolean; - getDepth(module: webpack.Module): number; - setDepth(module: webpack.Module, depth: number): void; - setDepthIfLower(module: webpack.Module, depth: number): boolean; - isAsync(module: webpack.Module): boolean; - setAsync(module: webpack.Module): void; - getMeta(thing?: any): any; - static getModuleGraphForModule( - module: webpack.Module, - deprecateMessage: string, - deprecationCode: string - ): webpack.ModuleGraph; - static setModuleGraphForModule( - module: webpack.Module, - moduleGraph: webpack.ModuleGraph - ): void; - static ModuleGraphConnection: typeof webpack.ModuleGraphConnection; - static ExportsInfo: typeof webpack.ExportsInfo; - static ExportInfo: typeof webpack.ExportInfo; - static SKIP_OVER_NAME: typeof webpack.SKIP_OVER_NAME; - static UsageState: Readonly<{ - NoInfo: 0; - Unused: 1; - Unknown: 2; - OnlyPropertiesUsed: 3; - Used: 4; - }>; - } - export class ModuleGraphConnection { - constructor( - originModule: webpack.Module, - dependency: webpack.Dependency, - module: webpack.Module, - explanation?: string, - weak?: boolean, - condition?: (arg0: webpack.ModuleGraphConnection) => boolean - ); - originModule: webpack.Module; - resolvedOriginModule: webpack.Module; - dependency: webpack.Dependency; - resolvedModule: webpack.Module; - module: webpack.Module; - weak: boolean; - conditional: boolean; - condition: (arg0: webpack.ModuleGraphConnection) => boolean; - explanations: Set; - addCondition( - condition: (arg0: webpack.ModuleGraphConnection) => boolean - ): void; - addExplanation(explanation: string): void; - readonly explanation: string; - active: any; - } - - /** - * Options affecting the normal modules (`NormalModuleFactory`). - */ - export interface ModuleOptions { - /** - * An array of rules applied by default for modules. - */ - defaultRules?: Array; - - /** - * Enable warnings for full dynamic dependencies. - */ - exprContextCritical?: boolean; - - /** - * Enable recursive directory lookup for full dynamic dependencies. - */ - exprContextRecursive?: boolean; - - /** - * Sets the default regular expression for full dynamic dependencies. - */ - exprContextRegExp?: boolean | RegExp; - - /** - * Set the default request for full dynamic dependencies. - */ - exprContextRequest?: string; - - /** - * Don't parse files matching. It's matched against the full resolved request. - */ - noParse?: - | string - | Function - | RegExp - | [string | Function | RegExp, string | Function | RegExp]; - - /** - * An array of rules applied for modules. - */ - rules?: Array; - - /** - * Emit errors instead of warnings when imported names don't exist in imported module. - */ - strictExportPresence?: boolean; - - /** - * Handle the this context correctly according to the spec for namespace objects. - */ - strictThisContextOnImports?: boolean; - - /** - * Enable warnings when using the require function in a not statically analyse-able way. - */ - unknownContextCritical?: boolean; - - /** - * Enable recursive directory lookup when using the require function in a not statically analyse-able way. - */ - unknownContextRecursive?: boolean; - - /** - * Sets the regular expression when using the require function in a not statically analyse-able way. - */ - unknownContextRegExp?: boolean | RegExp; - - /** - * Sets the request when using the require function in a not statically analyse-able way. - */ - unknownContextRequest?: string; - - /** - * Cache the resolving of module requests. - */ - unsafeCache?: boolean | Function; - - /** - * Enable warnings for partial dynamic dependencies. - */ - wrappedContextCritical?: boolean; - - /** - * Enable recursive directory lookup for partial dynamic dependencies. - */ - wrappedContextRecursive?: boolean; - - /** - * Set the inner regular expression for partial dynamic dependencies. - */ - wrappedContextRegExp?: RegExp; - } - export interface ModulePathData { - id: string | number; - hash: string; - hashWithLength?: (arg0: number) => string; - } - export abstract class ModuleProfile { - startTime: number; - factory: number; - restoring: number; - integration: number; - building: number; - storing: number; - additionalFactories: number; - additionalIntegration: number; - markFactoryStart(): void; - factoryStartTime: number; - markFactoryEnd(): void; - factoryEndTime: number; - markRestoringStart(): void; - restoringStartTime: number; - markRestoringEnd(): void; - restoringEndTime: number; - markIntegrationStart(): void; - integrationStartTime: number; - markIntegrationEnd(): void; - integrationEndTime: number; - markBuildingStart(): void; - buildingStartTime: number; - markBuildingEnd(): void; - buildingEndTime: number; - markStoringStart(): void; - storingStartTime: number; - markStoringEnd(): void; - storingEndTime: number; - - /** - * Merge this profile into another one - */ - mergeInto(realProfile: webpack.ModuleProfile): void; - } - export abstract class ModuleTemplate { - type: string; - hooks: Readonly<{ - content: { tap: (options?: any, fn?: any) => void }; - module: { tap: (options?: any, fn?: any) => void }; - render: { tap: (options?: any, fn?: any) => void }; - package: { tap: (options?: any, fn?: any) => void }; - hash: { tap: (options?: any, fn?: any) => void }; - }>; - readonly runtimeTemplate: any; - } - export class MultiCompiler { - constructor( - compilers: Array | Record - ); - hooks: Readonly<{ - done: SyncHook<[webpack.MultiStats], void>; - invalid: MultiHook>; - run: MultiHook>; - watchClose: SyncHook<[], void>; - watchRun: MultiHook>; - infrastructureLog: MultiHook< - SyncBailHook<[string, string, Array], true> - >; - }>; - compilers: Array; - dependencies: WeakMap>; - running: boolean; - readonly options: Array; - readonly outputPath: string; - inputFileSystem: webpack.InputFileSystem; - outputFileSystem: webpack.OutputFileSystem; - intermediateFileSystem: webpack.InputFileSystem & - webpack.OutputFileSystem & - webpack.IntermediateFileSystemExtras; - getInfrastructureLogger(name?: any): webpack.WebpackLogger; - setDependencies( - compiler: webpack.Compiler, - dependencies: Array - ): void; - validateDependencies( - callback: webpack.CallbackCompiler - ): boolean; - runWithDependencies( - compilers: Array, - fn: ( - compiler: webpack.Compiler, - callback: webpack.CallbackCompiler - ) => any, - callback: webpack.CallbackCompiler - ): void; - watch( - watchOptions: webpack.WatchOptions | Array, - handler: webpack.CallbackCompiler - ): webpack.MultiWatching; - run(callback: webpack.CallbackCompiler): void; - purgeInputFileSystem(): void; - close(callback: webpack.CallbackCompiler): void; - } - export abstract class MultiStats { - stats: Array; - hash: string; - hasErrors(): boolean; - hasWarnings(): boolean; - toJson( - options?: any - ): { - children: Array; - version: any; - hash: string; - errors: Array; - warnings: Array; - }; - toString(options?: any): string; - } - export abstract class MultiWatching { - watchings: Array; - compiler: webpack.MultiCompiler; - invalidate(): void; - suspend(): void; - resume(): void; - close(callback: webpack.CallbackCompiler): void; - } - export class NamedChunkIdsPlugin { - constructor(options?: any); - delimiter: any; - context: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export class NamedModuleIdsPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export class NaturalModuleIdsPlugin { - constructor(); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export interface NeedBuildContext { - fileSystemInfo: webpack.FileSystemInfo; - } - export class NoEmitOnErrorsPlugin { - constructor(); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export type Node = false | webpack.NodeOptions; - export class NodeEnvironmentPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - - /** - * Options object for node compatibility features. - */ - export interface NodeOptions { - /** - * Include a polyfill for the 'global' variable. - */ - global?: boolean; - } - export class NodeTemplatePlugin { - constructor(options?: any); - asyncChunkLoading: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export class NormalModule extends webpack.Module { - constructor(__0: { - /** - * module type - */ - type: string; - /** - * request string - */ - request: string; - /** - * request intended by user (without loaders from config) - */ - userRequest: string; - /** - * request without resolving - */ - rawRequest: string; - /** - * list of loaders - */ - loaders: Array; - /** - * path + query of the real resource - */ - resource: string; - /** - * path + query of the matched resource (virtual) - */ - matchResource: string; - /** - * the parser used - */ - parser: webpack.Parser; - /** - * the generator used - */ - generator: webpack.Generator; - /** - * options used for resolving requests from this module - */ - resolveOptions: any; - }); - request: string; - userRequest: string; - rawRequest: string; - binary: boolean; - parser: webpack.Parser; - generator: webpack.Generator; - resource: string; - matchResource: string; - loaders: Array; - error: webpack.WebpackError; - createSourceForAsset( - context: string, - name: string, - content: string, - sourceMap?: any, - associatedObjectForCache?: any - ): webpack.Source; - createLoaderContext( - resolver: webpack.Resolver & webpack.WithOptions, - options: webpack.WebpackOptionsNormalized, - compilation: webpack.Compilation, - fs: webpack.InputFileSystem - ): any; - getCurrentLoader(loaderContext?: any, index?: any): webpack.LoaderItem; - createSource( - context: string, - content: string | Buffer, - sourceMap?: any, - associatedObjectForCache?: any - ): webpack.Source; - doBuild( - options: webpack.WebpackOptionsNormalized, - compilation: webpack.Compilation, - resolver: webpack.Resolver & webpack.WithOptions, - fs: webpack.InputFileSystem, - callback: (arg0: webpack.WebpackError) => void - ): void; - markModuleAsErrored(error: webpack.WebpackError): void; - applyNoParseRule(rule?: any, content?: any): any; - shouldPreventParsing(noParseRule?: any, request?: any): any; - static getCompilationHooks( - compilation: webpack.Compilation - ): webpack.NormalModuleCompilationHooks; - static deserialize(context?: any): webpack.NormalModule; - } - export interface NormalModuleCompilationHooks { - loader: SyncHook<[any, webpack.NormalModule], void>; - } - export abstract class NormalModuleFactory extends webpack.ModuleFactory { - hooks: Readonly<{ - resolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; - factorize: AsyncSeriesBailHook<[webpack.ResolveData], any>; - beforeResolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; - afterResolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; - createModule: SyncBailHook<[webpack.ResolveData], any>; - module: SyncWaterfallHook<[webpack.Module, any, webpack.ResolveData]>; - createParser: HookMap>; - parser: HookMap>; - createGenerator: HookMap>; - generator: HookMap>; - }>; - resolverFactory: any; - ruleSet: webpack.RuleSet; - unsafeCache: boolean; - cachePredicate: any; - context: any; - fs: any; - parserCache: Map>; - generatorCache: Map>; - resolveRequestArray( - contextInfo?: any, - context?: any, - array?: any, - resolver?: any, - resolveContext?: any, - callback?: any - ): any; - getParser(type?: any, parserOptions?: {}): any; - createParser(type?: any, parserOptions?: {}): any; - getGenerator(type?: any, generatorOptions?: {}): webpack.Generator; - createGenerator(type?: any, generatorOptions?: {}): any; - getResolver(type?: any, resolveOptions?: any): any; - } - export class NormalModuleReplacementPlugin { - /** - * Create an instance of the plugin - */ - constructor( - resourceRegExp: RegExp, - newResource: string | ((arg0?: any) => void) - ); - resourceRegExp: RegExp; - newResource: string | ((arg0?: any) => void); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export interface ObjectDeserializerContext { - read: () => any; - } - export interface ObjectSerializer { - serialize: (arg0: any, arg1: webpack.ObjectSerializerContext) => void; - deserialize: (arg0: webpack.ObjectDeserializerContext) => any; - } - export interface ObjectSerializerContext { - write: (arg0?: any) => void; - } - export class OccurrenceChunkIdsPlugin { - constructor(options?: webpack.OccurrenceChunkIdsPluginOptions); - options: webpack.OccurrenceChunkIdsPluginOptions; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - - /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - export interface OccurrenceChunkIdsPluginOptions { - /** - * Prioritise initial size over total size. - */ - prioritiseInitial?: boolean; - } - export class OccurrenceModuleIdsPlugin { - constructor(options?: webpack.OccurrenceModuleIdsPluginOptions); - options: webpack.OccurrenceModuleIdsPluginOptions; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - - /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - export interface OccurrenceModuleIdsPluginOptions { - /** - * Prioritise initial size over total size. - */ - prioritiseInitial?: boolean; - } - - /** - * Enables/Disables integrated optimizations. - */ - export interface Optimization { - /** - * Check for incompatible wasm types when importing/exporting from/to ESM. - */ - checkWasmTypes?: boolean; - - /** - * Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin). - */ - chunkIds?: - | false - | "natural" - | "named" - | "deterministic" - | "size" - | "total-size"; - - /** - * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer. - */ - concatenateModules?: boolean; - - /** - * Also flag chunks as loaded which contain a subset of the modules. - */ - flagIncludedChunks?: boolean; - - /** - * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection. - */ - innerGraph?: boolean; - - /** - * Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports). - */ - mangleExports?: boolean; - - /** - * Reduce size of WASM by changing imports to shorter strings. - */ - mangleWasmImports?: boolean; - - /** - * Merge chunks which contain the same modules. - */ - mergeDuplicateChunks?: boolean; - - /** - * Enable minimizing the output. Uses optimization.minimizer. - */ - minimize?: boolean; - - /** - * Minimizer(s) to use for minimizing the output. - */ - minimizer?: Array< - | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) - | webpack.WebpackPluginInstance - >; - - /** - * Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin). - */ - moduleIds?: - | false - | "natural" - | "named" - | "deterministic" - | "size" - | "hashed"; - - /** - * Avoid emitting assets when errors occur. - */ - noEmitOnErrors?: boolean; - - /** - * Set process.env.NODE_ENV to a specific value. - */ - nodeEnv?: string | false; - - /** - * Generate records with relative paths to be able to move the context folder. - */ - portableRecords?: boolean; - - /** - * Figure out which exports are provided by modules to generate more efficient code. - */ - providedExports?: boolean; - - /** - * Removes modules from chunks when these modules are already included in all parents. - */ - removeAvailableModules?: boolean; - - /** - * Remove chunks which are empty. - */ - removeEmptyChunks?: boolean; - - /** - * Create an additional chunk which contains only the webpack runtime and chunk hash maps. - */ - runtimeChunk?: - | boolean - | "single" - | "multiple" - | { - /** - * The name or name factory for the runtime chunks. - */ - name?: string | Function; - }; - - /** - * Skip over modules which are flagged to contain no side effects when exports are not used. - */ - sideEffects?: boolean; - - /** - * Optimize duplication and caching by splitting chunks by shared modules and cache group. - */ - splitChunks?: false | webpack.OptimizationSplitChunksOptions; - - /** - * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code. - */ - usedExports?: boolean; - } - export type OptimizationRuntimeChunk = - | boolean - | "single" - | "multiple" - | { - /** - * The name or name factory for the runtime chunks. - */ - name?: string | Function; - }; - - /** - * Options object for describing behavior of a cache group selecting modules that should be cached together. - */ - export interface OptimizationSplitChunksCacheGroup { - /** - * Sets the name delimiter for created chunks. - */ - automaticNameDelimiter?: string; - - /** - * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML). - */ - chunks?: "initial" | "async" | "all" | ((chunk: webpack.Chunk) => boolean); - - /** - * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group. - */ - enforce?: boolean; - - /** - * Sets the template for the filename for created chunks. - */ - filename?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * Sets the hint for chunk id. - */ - idHint?: string; - - /** - * Maximum number of requests which are accepted for on-demand loading. - */ - maxAsyncRequests?: number; - - /** - * Maximal size hint for the on-demand chunks. - */ - maxAsyncSize?: number | { [index: string]: number }; - - /** - * Maximum number of initial chunks which are accepted for an entry point. - */ - maxInitialRequests?: number; - - /** - * Maximal size hint for the initial chunks. - */ - maxInitialSize?: number | { [index: string]: number }; - - /** - * Maximal size hint for the created chunks. - */ - maxSize?: number | { [index: string]: number }; - - /** - * Minimum number of times a module has to be duplicated until it's considered for splitting. - */ - minChunks?: number; - - /** - * Minimal size for the chunks the stay after moving the modules to a new chunk. - */ - minRemainingSize?: number | { [index: string]: number }; - - /** - * Minimal size for the created chunk. - */ - minSize?: number | { [index: string]: number }; - - /** - * Give chunks for this cache group a name (chunks with equal name are merged). - */ - name?: string | false | Function; - - /** - * Priority of this cache group. - */ - priority?: number; - - /** - * Try to reuse existing chunk (with name) when it has matching modules. - */ - reuseExistingChunk?: boolean; - - /** - * Assign modules to a cache group by module name. - */ - test?: string | Function | RegExp; - - /** - * Assign modules to a cache group by module type. - */ - type?: string | Function | RegExp; - } - - /** - * Options object for splitting chunks into smaller chunks. - */ - export interface OptimizationSplitChunksOptions { - /** - * Sets the name delimiter for created chunks. - */ - automaticNameDelimiter?: string; - - /** - * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors'). - */ - cacheGroups?: { - [index: string]: - | string - | false - | Function - | RegExp - | webpack.OptimizationSplitChunksCacheGroup; - }; - - /** - * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML). - */ - chunks?: "initial" | "async" | "all" | ((chunk: webpack.Chunk) => boolean); - - /** - * Options for modules not selected by any other cache group. - */ - fallbackCacheGroup?: { - /** - * Sets the name delimiter for created chunks. - */ - automaticNameDelimiter?: string; - /** - * Maximal size hint for the on-demand chunks. - */ - maxAsyncSize?: number | { [index: string]: number }; - /** - * Maximal size hint for the initial chunks. - */ - maxInitialSize?: number | { [index: string]: number }; - /** - * Maximal size hint for the created chunks. - */ - maxSize?: number | { [index: string]: number }; - /** - * Minimal size for the created chunk. - */ - minSize?: number | { [index: string]: number }; - }; - - /** - * Sets the template for the filename for created chunks. - */ - filename?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * Prevents exposing path info when creating names for parts splitted by maxSize. - */ - hidePathInfo?: boolean; - - /** - * Maximum number of requests which are accepted for on-demand loading. - */ - maxAsyncRequests?: number; - - /** - * Maximal size hint for the on-demand chunks. - */ - maxAsyncSize?: number | { [index: string]: number }; - - /** - * Maximum number of initial chunks which are accepted for an entry point. - */ - maxInitialRequests?: number; - - /** - * Maximal size hint for the initial chunks. - */ - maxInitialSize?: number | { [index: string]: number }; - - /** - * Maximal size hint for the created chunks. - */ - maxSize?: number | { [index: string]: number }; - - /** - * Minimum number of times a module has to be duplicated until it's considered for splitting. - */ - minChunks?: number; - - /** - * Minimal size for the chunks the stay after moving the modules to a new chunk. - */ - minRemainingSize?: number | { [index: string]: number }; - - /** - * Minimal size for the created chunks. - */ - minSize?: number | { [index: string]: number }; - - /** - * Give chunks created a name (chunks with equal name are merged). - */ - name?: string | false | Function; - } - export type OptimizationSplitChunksSizes = - | number - | { [index: string]: number }; - export abstract class OptionsApply { - process(options?: any, compiler?: any): void; - } - - /** - * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. - */ - export interface Output { - /** - * The filename of asset modules as relative path inside the `output.path` directory. - */ - assetModuleFilename?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * Add a comment in the UMD wrapper. - */ - auxiliaryComment?: string | webpack.LibraryCustomUmdCommentObject; - - /** - * The callback function name used by webpack for loading of chunks in WebWorkers. - */ - chunkCallbackName?: string; - - /** - * The filename of non-entry chunks as relative path inside the `output.path` directory. - */ - chunkFilename?: string; - - /** - * Number of milliseconds before chunk request expires. - */ - chunkLoadTimeout?: number; - - /** - * Check if to be emitted file already exists and have the same content before writing to output filesystem. - */ - compareBeforeEmit?: boolean; - - /** - * This option enables cross-origin loading of chunks. - */ - crossOriginLoading?: false | "anonymous" | "use-credentials"; - - /** - * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers. - */ - devtoolFallbackModuleFilenameTemplate?: string | Function; - - /** - * Filename template string of function for the sources array in a generated SourceMap. - */ - devtoolModuleFilenameTemplate?: string | Function; - - /** - * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries. - */ - devtoolNamespace?: string; - - /** - * The maximum EcmaScript version of the webpack generated code (doesn't include input source code from modules). - */ - ecmaVersion?: number; - - /** - * List of library types enabled for use by entry points. - */ - enabledLibraryTypes?: Array< - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system" - >; - - /** - * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. - */ - filename?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * An expression which is used to address the global object/scope in runtime code. - */ - globalObject?: string; - - /** - * Digest type used for the hash. - */ - hashDigest?: string; - - /** - * Number of chars which are used for the hash. - */ - hashDigestLength?: number; - - /** - * Algorithm used for generation the hash (see node.js crypto package). - */ - hashFunction?: string | typeof webpack.Hash; - - /** - * Any string which is added to the hash to salt it. - */ - hashSalt?: string; - - /** - * The filename of the Hot Update Chunks. They are inside the output.path directory. - */ - hotUpdateChunkFilename?: string; - - /** - * The JSONP function used by webpack for async loading of hot update chunks. - */ - hotUpdateFunction?: string; - - /** - * The filename of the Hot Update Main File. It is inside the `output.path` directory. - */ - hotUpdateMainFilename?: string; - - /** - * Wrap javascript code into IIFE's to avoid leaking into global scope. - */ - iife?: boolean; - - /** - * The JSONP function used by webpack for async loading of chunks. - */ - jsonpFunction?: string; - - /** - * This option enables loading async chunks via a custom script type, such as script type="module". - */ - jsonpScriptType?: false | "module" | "text/javascript"; - - /** - * Make the output files a library, exporting the exports of the entry point. - */ - library?: - | string - | Array - | webpack.LibraryCustomUmdObject - | webpack.LibraryOptions; - - /** - * Specify which export should be exposed as library. - */ - libraryExport?: string | Array; - - /** - * Type of library. - */ - libraryTarget?: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - - /** - * Output javascript files as module source type. - */ - module?: boolean; - - /** - * The output directory as **absolute path** (required). - */ - path?: string; - - /** - * Include comments with information about the modules. - */ - pathinfo?: boolean; - - /** - * The `publicPath` specifies the public URL address of the output files when referenced in a browser. - */ - publicPath?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. - */ - sourceMapFilename?: string; - - /** - * Prefixes every line of the source in the bundle with this string. - */ - sourcePrefix?: string; - - /** - * Handles exceptions in module loading correctly at a performance cost. - */ - strictModuleExceptionHandling?: boolean; - - /** - * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module. - */ - umdNamedDefine?: boolean; - - /** - * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. - */ - uniqueName?: string; - - /** - * The filename of WebAssembly modules as relative path inside the `output.path` directory. - */ - webassemblyModuleFilename?: string; - } - export interface OutputFileSystem { - writeFile: ( - arg0: string, - arg1: string | Buffer, - arg2: (arg0: NodeJS.ErrnoException) => void - ) => void; - mkdir: (arg0: string, arg1: (arg0: NodeJS.ErrnoException) => void) => void; - stat: ( - arg0: string, - arg1: (arg0: NodeJS.ErrnoException, arg1: FsStats) => void - ) => void; - readFile: ( - arg0: string, - arg1: (arg0: NodeJS.ErrnoException, arg1: Buffer) => void - ) => void; - join?: (arg0: string, arg1: string) => string; - relative?: (arg0: string, arg1: string) => string; - dirname?: (arg0: string) => string; - } - - /** - * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. - */ - export interface OutputNormalized { - /** - * The filename of asset modules as relative path inside the `output.path` directory. - */ - assetModuleFilename?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * The callback function name used by webpack for loading of chunks in WebWorkers. - */ - chunkCallbackName?: string; - - /** - * The filename of non-entry chunks as relative path inside the `output.path` directory. - */ - chunkFilename?: string; - - /** - * Number of milliseconds before chunk request expires. - */ - chunkLoadTimeout?: number; - - /** - * Check if to be emitted file already exists and have the same content before writing to output filesystem. - */ - compareBeforeEmit?: boolean; - - /** - * This option enables cross-origin loading of chunks. - */ - crossOriginLoading?: false | "anonymous" | "use-credentials"; - - /** - * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers. - */ - devtoolFallbackModuleFilenameTemplate?: string | Function; - - /** - * Filename template string of function for the sources array in a generated SourceMap. - */ - devtoolModuleFilenameTemplate?: string | Function; - - /** - * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries. - */ - devtoolNamespace?: string; - - /** - * The maximum EcmaScript version of the webpack generated code (doesn't include input source code from modules). - */ - ecmaVersion?: number; - - /** - * List of library types enabled for use by entry points. - */ - enabledLibraryTypes?: Array< - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system" - >; - - /** - * Specifies the name of each output file on disk. You must **not** specify an absolute path here! The `output.path` option determines the location on disk the files are written to, filename is used solely for naming the individual files. - */ - filename?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * An expression which is used to address the global object/scope in runtime code. - */ - globalObject?: string; - - /** - * Digest type used for the hash. - */ - hashDigest?: string; - - /** - * Number of chars which are used for the hash. - */ - hashDigestLength?: number; - - /** - * Algorithm used for generation the hash (see node.js crypto package). - */ - hashFunction?: string | typeof webpack.Hash; - - /** - * Any string which is added to the hash to salt it. - */ - hashSalt?: string; - - /** - * The filename of the Hot Update Chunks. They are inside the output.path directory. - */ - hotUpdateChunkFilename?: string; - - /** - * The JSONP function used by webpack for async loading of hot update chunks. - */ - hotUpdateFunction?: string; - - /** - * The filename of the Hot Update Main File. It is inside the `output.path` directory. - */ - hotUpdateMainFilename?: string; - - /** - * Wrap javascript code into IIFE's to avoid leaking into global scope. - */ - iife?: boolean; - - /** - * The JSONP function used by webpack for async loading of chunks. - */ - jsonpFunction?: string; - - /** - * This option enables loading async chunks via a custom script type, such as script type="module". - */ - jsonpScriptType?: false | "module" | "text/javascript"; - - /** - * Options for library. - */ - library?: webpack.LibraryOptions; - - /** - * Output javascript files as module source type. - */ - module?: boolean; - - /** - * The output directory as **absolute path** (required). - */ - path?: string; - - /** - * Include comments with information about the modules. - */ - pathinfo?: boolean; - - /** - * The `publicPath` specifies the public URL address of the output files when referenced in a browser. - */ - publicPath?: - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - - /** - * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. - */ - sourceMapFilename?: string; - - /** - * Prefixes every line of the source in the bundle with this string. - */ - sourcePrefix?: string; - - /** - * Handles exceptions in module loading correctly at a performance cost. - */ - strictModuleExceptionHandling?: boolean; - - /** - * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals. - */ - uniqueName?: string; - - /** - * The filename of WebAssembly modules as relative path inside the `output.path` directory. - */ - webassemblyModuleFilename?: string; - } - export class Parser { - constructor(); - parse( - source: string | Record | Buffer, - state: Record & webpack.ParserStateBase - ): Record & webpack.ParserStateBase; - } - export interface ParserStateBase { - current: webpack.NormalModule; - module: webpack.NormalModule; - compilation: webpack.Compilation; - options: any; - } - export interface PathData { - chunkGraph?: webpack.ChunkGraph; - hash?: string; - hashWithLength?: (arg0: number) => string; - chunk?: webpack.Chunk | webpack.ChunkPathData; - module?: webpack.Module | webpack.ModulePathData; - filename?: string; - basename?: string; - query?: string; - contentHashType?: string; - contentHash?: string; - contentHashWithLength?: (arg0: number) => string; - noChunkHash?: boolean; - url?: string; - } - export type Performance = false | webpack.PerformanceOptions; - - /** - * Configuration object for web performance recommendations. - */ - export interface PerformanceOptions { - /** - * Filter function to select assets that are checked. - */ - assetFilter?: Function; - - /** - * Sets the format of the hints: warnings, errors or nothing at all. - */ - hints?: false | "error" | "warning"; - - /** - * File size limit (in bytes) when exceeded, that webpack will provide performance hints. - */ - maxAssetSize?: number; - - /** - * Total size of an entry point (in bytes). - */ - maxEntrypointSize?: number; - } - export interface Plugin { - apply: () => void; - } - export class PrefetchPlugin { - constructor(context?: any, request?: any); - context: any; - request: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export interface PrintedElement { - element: string; - content: string; - } - export interface Problem { - type: - | "unknown-argument" - | "unexpected-non-array-in-path" - | "unexpected-non-object-in-path" - | "multiple-values-unexpected" - | "invalid-value"; - path: string; - argument: string; - value?: any; - index?: number; - expected?: string; - } - export class Profiler { - constructor(inspector?: any); - session: any; - inspector: any; - hasSession(): boolean; - startProfiling(): Promise | Promise<[any, any, any]>; - sendCommand(method?: any, params?: any): Promise; - destroy(): Promise; - stopProfiling(): Promise; - } - export class ProfilingPlugin { - constructor(options?: webpack.ProfilingPluginOptions); - outputPath: string; - apply(compiler?: any): void; - static Profiler: typeof webpack.Profiler; - } - - /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - export interface ProfilingPluginOptions { - /** - * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`. - */ - outputPath?: string; - } - export class ProgressPlugin { - constructor( - options: - | webpack.ProgressPluginOptions - | ((percentage: number, msg: string, ...args: Array) => void) - ); - profile: boolean; - handler: (percentage: number, msg: string, ...args: Array) => void; - modulesCount: number; - dependenciesCount: number; - showEntries: boolean; - showModules: boolean; - showDependencies: boolean; - showActiveModules: boolean; - percentBy: "modules" | "dependencies" | "entries"; - apply(compiler: webpack.Compiler | webpack.MultiCompiler): void; - static getReporter( - compiler: webpack.Compiler - ): (p: number, ...args: Array) => void; - static defaultOptions: { - profile: boolean; - modulesCount: number; - dependenciesCount: number; - modules: boolean; - dependencies: boolean; - activeModules: boolean; - entries: boolean; - }; - } - export type ProgressPluginArgument = - | webpack.ProgressPluginOptions - | ((percentage: number, msg: string, ...args: Array) => void); - - /** - * Options object for the ProgressPlugin. - */ - export interface ProgressPluginOptions { - /** - * Show active modules count and one active module in progress message. - */ - activeModules?: boolean; - - /** - * Show dependencies count in progress message. - */ - dependencies?: boolean; - - /** - * Minimum dependencies count to start with. For better progress calculation. Default: 10000. - */ - dependenciesCount?: number; - - /** - * Show entries count in progress message. - */ - entries?: boolean; - - /** - * Function that executes for every progress step. - */ - handler?: (percentage: number, msg: string, ...args: Array) => void; - - /** - * Show modules count in progress message. - */ - modules?: boolean; - - /** - * Minimum modules count to start with. For better progress calculation. Default: 5000. - */ - modulesCount?: number; - - /** - * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent. - */ - percentBy?: "modules" | "dependencies" | "entries"; - - /** - * Collect profile data for progress steps. Default: false. - */ - profile?: boolean; - } - export class ProvidePlugin { - constructor(definitions: Record>); - definitions: Record>; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export type PublicPath = - | string - | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); - export interface RawChunkGroupOptions { - preloadOrder?: number; - prefetchOrder?: number; - } - export class ReadFileCompileWasmPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export interface RealDependencyLocation { - start: webpack.SourcePosition; - end?: webpack.SourcePosition; - index?: number; - } - export type RecursiveArrayOrRecord = - | string - | number - | bigint - | boolean - | Function - | RegExp - | webpack.RuntimeValue - | { [index: string]: RecursiveArrayOrRecordDeclarations } - | Array; - type RecursiveArrayOrRecordDeclarations = - | string - | number - | bigint - | boolean - | Function - | RegExp - | webpack.RuntimeValue - | { [index: string]: RecursiveArrayOrRecordDeclarations } - | Array; - export interface RenderBootstrapContext { - /** - * the chunk - */ - chunk: webpack.Chunk; - - /** - * the runtime template - */ - runtimeTemplate: webpack.RuntimeTemplate; - - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - - /** - * hash to be used for render call - */ - hash: string; - } - export interface RenderContextAsyncWebAssemblyModulesPlugin { - /** - * the chunk - */ - chunk: any; - - /** - * the dependency templates - */ - dependencyTemplates: any; - - /** - * the runtime template - */ - runtimeTemplate: any; - - /** - * the module graph - */ - moduleGraph: any; - - /** - * the chunk graph - */ - chunkGraph: any; - - /** - * results of code generation - */ - codeGenerationResults: Map; - } - export interface RenderContextJavascriptModulesPlugin { - /** - * the chunk - */ - chunk: webpack.Chunk; - - /** - * the dependency templates - */ - dependencyTemplates: webpack.DependencyTemplates; - - /** - * the runtime template - */ - runtimeTemplate: webpack.RuntimeTemplate; - - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - - /** - * results of code generation - */ - codeGenerationResults: Map; - } - export interface RenderContextModuleTemplate { - /** - * the chunk - */ - chunk: webpack.Chunk; - - /** - * the dependency templates - */ - dependencyTemplates: webpack.DependencyTemplates; - - /** - * the runtime template - */ - runtimeTemplate: webpack.RuntimeTemplate; - - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - } - export interface RenderManifestEntry { - render: () => webpack.Source; - filenameTemplate: - | string - | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); - pathOptions?: webpack.PathData; - identifier: string; - hash?: string; - auxiliary?: boolean; - } - export interface RenderManifestOptions { - /** - * the chunk used to render - */ - chunk: webpack.Chunk; - hash: string; - fullHash: string; - outputOptions: any; - codeGenerationResults: Map; - moduleTemplates: { javascript: webpack.ModuleTemplate }; - dependencyTemplates: webpack.DependencyTemplates; - runtimeTemplate: webpack.RuntimeTemplate; - moduleGraph: webpack.ModuleGraph; - chunkGraph: webpack.ChunkGraph; - } - export abstract class ReplaceSource extends webpack.Source { - replace(start: number, end: number, newValue: string, name: string): void; - insert(pos: number, newValue: string, name: string): void; - getName(): string; - original(): string; - getReplacements(): Array<{ - start: number; - end: number; - content: string; - insertIndex: number; - name: string; - }>; - } - export abstract class RequestShortener { - contextify: (arg0: string) => string; - shorten(request: string): string; - } - - /** - * istanbul ignore next - */ - export interface ResolveBuildDependenciesResult { - /** - * list of files - */ - files: Set; - - /** - * list of directories - */ - directories: Set; - - /** - * list of missing entries - */ - missing: Set; - - /** - * stored resolve results - */ - resolveResults: Map; - - /** - * dependencies of the resolving - */ - resolveDependencies: { - /** - * list of files - */ - files: Set; - /** - * list of directories - */ - directories: Set; - /** - * list of missing entries - */ - missing: Set; - }; - } - export interface ResolveContext { - log?: (message: string) => void; - fileDependencies?: webpack.WriteOnlySet; - contextDependencies?: webpack.WriteOnlySet; - missingDependencies?: webpack.WriteOnlySet; - stack?: Set; - } - export interface ResolveData { - contextInfo: webpack.ModuleFactoryCreateDataContextInfo; - resolveOptions: any; - context: string; - request: string; - dependencies: Array; - createData: any; - fileDependencies: webpack.LazySet; - missingDependencies: webpack.LazySet; - contextDependencies: webpack.LazySet; - } - - /** - * Options object for resolving requests. - */ - export interface ResolveOptions { - /** - * Redirect module requests. - */ - alias?: - | Array<{ - /** - * New request. - */ - alias: string | false | Array; - /** - * Request to be redirected. - */ - name: string; - /** - * Redirect only exact matching request. - */ - onlyModule?: boolean; - }> - | { [index: string]: string | false | Array }; - - /** - * Fields in the description file (usually package.json) which are used to redirect requests inside the module. - */ - aliasFields?: Array>; - - /** - * Enable caching of successfully resolved requests (cache entries are revalidated). - */ - cache?: boolean; - - /** - * Predicate function to decide which requests should be cached. - */ - cachePredicate?: Function; - - /** - * Include the context information in the cache identifier when caching. - */ - cacheWithContext?: boolean; - - /** - * Filenames used to find a description file (like a package.json). - */ - descriptionFiles?: Array; - - /** - * Enforce using one of the extensions from the extensions option. - */ - enforceExtension?: boolean; - - /** - * Extensions added to the request when trying to find the file. - */ - extensions?: Array; - - /** - * Filesystem for the resolver. - */ - fileSystem?: { [index: string]: any }; - - /** - * Field names from the description file (package.json) which are used to find the default entry point. - */ - mainFields?: Array>; - - /** - * Filenames used to find the default entry point if there is no description file or main field. - */ - mainFiles?: Array; - - /** - * Folder names or directory paths where to find modules. - */ - modules?: Array; - - /** - * Plugins for the resolver. - */ - plugins?: Array; - - /** - * Custom resolver. - */ - resolver?: { [index: string]: any }; - - /** - * Enable resolving symlinks to the original location. - */ - symlinks?: boolean; - - /** - * Enable caching of successfully resolved requests (cache entries are not revalidated). - */ - unsafeCache?: boolean | { [index: string]: any }; - - /** - * Use synchronous filesystem calls for the resolver. - */ - useSyncFileSystemCalls?: boolean; - } - - /** - * Plugin instance. - */ - export interface ResolvePluginInstance { - [index: string]: any; - - /** - * The run point of the plugin, required method. - */ - apply: (resolver?: any) => void; - } - export abstract class Resolver { - resolve( - context: Object, - path: string, - request: string, - resolveContext: webpack.ResolveContext, - callback: ( - err: NodeJS.ErrnoException, - result: string, - additionalInfo: Object - ) => void - ): void; - } - export interface ResolverCache { - direct: WeakMap; - stringified: Map; - } - export abstract class ResolverFactory { - hooks: Readonly<{ - resolveOptions: HookMap>; - resolver: HookMap>; - }>; - cache: Map; - get( - type: string, - resolveOptions?: any - ): webpack.Resolver & webpack.WithOptions; - } - export interface RuleSet { - /** - * map of references in the rule set (may grow over time) - */ - references: Map; - - /** - * execute the rule set - */ - exec: (arg0?: any) => Array; - } - export type RuleSetCondition = - | string - | RegExp - | { - /** - * Logical AND. - */ - and?: Array; - /** - * Logical NOT. - */ - not?: Array; - /** - * Logical OR. - */ - or?: Array; - } - | ((value: string) => boolean) - | Array; - export type RuleSetConditionAbsolute = - | string - | RegExp - | { - /** - * Logical AND. - */ - and?: Array; - /** - * Logical NOT. - */ - not?: Array; - /** - * Logical OR. - */ - or?: Array; - } - | ((value: string) => boolean) - | Array; - type RuleSetConditionAbsoluteWebpackOptions = - | string - | RegExp - | { - /** - * Logical AND. - */ - and?: Array; - /** - * Logical NOT. - */ - not?: Array; - /** - * Logical OR. - */ - or?: Array; - } - | ((value: string) => boolean) - | Array; - type RuleSetConditionWebpackOptions = - | string - | RegExp - | { - /** - * Logical AND. - */ - and?: Array; - /** - * Logical NOT. - */ - not?: Array; - /** - * Logical OR. - */ - or?: Array; - } - | ((value: string) => boolean) - | Array; - export type RuleSetLoaderOptions = string | { [index: string]: any }; - - /** - * A rule description with conditions and effects for modules. - */ - export interface RuleSetRule { - /** - * Match the child compiler name. - */ - compiler?: - | string - | RegExp - | { - /** - * Logical AND. - */ - and?: Array; - /** - * Logical NOT. - */ - not?: Array; - /** - * Logical OR. - */ - or?: Array; - } - | ((value: string) => boolean) - | Array; - - /** - * Enforce this rule as pre or post step. - */ - enforce?: "pre" | "post"; - - /** - * Shortcut for resource.exclude. - */ - exclude?: - | string - | RegExp - | { - /** - * Logical AND. - */ - and?: Array; - /** - * Logical NOT. - */ - not?: Array; - /** - * Logical OR. - */ - or?: Array; - } - | ((value: string) => boolean) - | Array; - - /** - * The options for the module generator. - */ - generator?: { [index: string]: any }; - - /** - * Shortcut for resource.include. - */ - include?: RuleSetConditionAbsoluteWebpackOptions; - - /** - * Match the issuer of the module (The module pointing to this module). - */ - issuer?: RuleSetConditionAbsoluteWebpackOptions; - - /** - * Shortcut for use.loader. - */ - loader?: string; - - /** - * Only execute the first matching rule in this array. - */ - oneOf?: Array; - - /** - * Shortcut for use.options. - */ - options?: string | { [index: string]: any }; - - /** - * Options for parsing. - */ - parser?: { [index: string]: any }; - - /** - * Match the real resource path of the module. - */ - realResource?: RuleSetConditionAbsoluteWebpackOptions; - - /** - * Options for the resolver. - */ - resolve?: webpack.ResolveOptions; - - /** - * Match the resource path of the module. - */ - resource?: RuleSetConditionAbsoluteWebpackOptions; - - /** - * Match the resource query of the module. - */ - resourceQuery?: RuleSetConditionWebpackOptions; - - /** - * Match and execute these rules when this rule is matched. - */ - rules?: Array; - - /** - * Flags a module as with or without side effects. - */ - sideEffects?: boolean; - - /** - * Shortcut for resource.test. - */ - test?: RuleSetConditionAbsoluteWebpackOptions; - - /** - * Module type to use for the module. - */ - type?: string; - - /** - * Modifiers applied to the module when rule is matched. - */ - use?: - | string - | Array< - | string - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | ((data: {}) => - | string - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | __TypeWebpackOptions - | Array) - > - | ((data: { - resource: string; - realResource: string; - resourceQuery: string; - issuer: string; - compiler: string; - }) => Array) - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | __TypeWebpackOptions; - } - export type RuleSetUse = - | string - | Array< - | string - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | ((data: {}) => - | string - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | __TypeWebpackOptions - | Array) - > - | ((data: { - resource: string; - realResource: string; - resourceQuery: string; - issuer: string; - compiler: string; - }) => Array) - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | __TypeWebpackOptions; - export type RuleSetUseItem = - | string - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | __TypeWebpackOptions; - type RuleSetUseItemWebpackOptions = - | string - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | ((data: {}) => - | string - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | __TypeWebpackOptions - | Array); - export type RulesBannerPlugin = string | RegExp | Array; - export type RulesSourceMapDevToolPlugin = - | string - | RegExp - | Array; - export class RuntimeChunkPlugin { - constructor(options?: any); - options: any; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } export namespace RuntimeGlobals { export let require: string; export let requireScope: string; @@ -7535,1765 +7237,20 @@ declare namespace webpack { export let hasOwnProperty: string; export let systemContext: string; } - export class RuntimeModule extends webpack.Module { - constructor(name: string, stage?: number); - name: string; - stage: number; - compilation: webpack.Compilation; - chunk: webpack.Chunk; - attach(compilation: webpack.Compilation, chunk: webpack.Chunk): void; - generate(): string; - getGeneratedCode(): string; - } - export abstract class RuntimeTemplate { - outputOptions: webpack.Output; - requestShortener: webpack.RequestShortener; - isIIFE(): boolean; - supportsConst(): boolean; - supportsArrowFunction(): boolean; - supportsForOf(): boolean; - returningFunction(returnValue?: any, args?: string): string; - basicFunction(args?: any, body?: any): string; - iife(args?: any, body?: any): string; - forEach(variable?: any, array?: any, body?: any): string; - - /** - * Add a comment - */ - comment(__0: { - /** - * request string used originally - */ - request?: string; - /** - * name of the chunk referenced - */ - chunkName?: string; - /** - * reason information of the chunk - */ - chunkReason?: string; - /** - * additional message - */ - message?: string; - /** - * name of the export - */ - exportName?: string; - }): string; - throwMissingModuleErrorBlock(__0: { - /** - * request string used originally - */ - request?: string; - }): string; - throwMissingModuleErrorFunction(__0: { - /** - * request string used originally - */ - request?: string; - }): string; - missingModule(__0: { - /** - * request string used originally - */ - request?: string; - }): string; - missingModuleStatement(__0: { - /** - * request string used originally - */ - request?: string; - }): string; - missingModulePromise(__0: { - /** - * request string used originally - */ - request?: string; - }): string; - weakError(__0: { - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - /** - * the module - */ - module: webpack.Module; - /** - * the request that should be printed as comment - */ - request: string; - /** - * expression to use as id expression - */ - idExpr?: string; - /** - * which kind of code should be returned - */ - type: "expression" | "promise" | "statements"; - }): string; - moduleId(__0: { - /** - * the module - */ - module: webpack.Module; - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - /** - * the request that should be printed as comment - */ - request: string; - /** - * if the dependency is weak (will create a nice error message) - */ - weak?: boolean; - }): string; - moduleRaw(__0: { - /** - * the module - */ - module: webpack.Module; - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - /** - * the request that should be printed as comment - */ - request: string; - /** - * if the dependency is weak (will create a nice error message) - */ - weak?: boolean; - /** - * if set, will be filled with runtime requirements - */ - runtimeRequirements: Set; - }): string; - moduleExports(__0: { - /** - * the module - */ - module: webpack.Module; - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - /** - * the request that should be printed as comment - */ - request: string; - /** - * if the dependency is weak (will create a nice error message) - */ - weak?: boolean; - /** - * if set, will be filled with runtime requirements - */ - runtimeRequirements: Set; - }): string; - moduleNamespace(__0: { - /** - * the module - */ - module: webpack.Module; - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - /** - * the request that should be printed as comment - */ - request: string; - /** - * if the current module is in strict esm mode - */ - strict?: boolean; - /** - * if the dependency is weak (will create a nice error message) - */ - weak?: boolean; - /** - * if set, will be filled with runtime requirements - */ - runtimeRequirements: Set; - }): string; - moduleNamespacePromise(__0: { - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - /** - * the current dependencies block - */ - block?: webpack.AsyncDependenciesBlock; - /** - * the module - */ - module: webpack.Module; - /** - * the request that should be printed as comment - */ - request: string; - /** - * a message for the comment - */ - message: string; - /** - * if the current module is in strict esm mode - */ - strict?: boolean; - /** - * if the dependency is weak (will create a nice error message) - */ - weak?: boolean; - /** - * if set, will be filled with runtime requirements - */ - runtimeRequirements: Set; - }): string; - importStatement(__0: { - /** - * whether a new variable should be created or the existing one updated - */ - update?: boolean; - /** - * the module - */ - module: webpack.Module; - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - /** - * the request that should be printed as comment - */ - request: string; - /** - * name of the import variable - */ - importVar: string; - /** - * module in which the statement is emitted - */ - originModule: webpack.Module; - /** - * true, if this is a weak dependency - */ - weak?: boolean; - /** - * if set, will be filled with runtime requirements - */ - runtimeRequirements: Set; - }): string; - exportFromImport(__0: { - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - /** - * the module - */ - module: webpack.Module; - /** - * the request - */ - request: string; - /** - * the export name - */ - exportName: string | Array; - /** - * the origin module - */ - originModule: webpack.Module; - /** - * true, if location is safe for ASI, a bracket can be emitted - */ - asiSafe: boolean; - /** - * true, if expression will be called - */ - isCall: boolean; - /** - * when false, call context will not be preserved - */ - callContext: boolean; - /** - * when true and accessing the default exports, interop code will be generated - */ - defaultInterop: boolean; - /** - * the identifier name of the import variable - */ - importVar: string; - /** - * init fragments will be added here - */ - initFragments: Array; - /** - * if set, will be filled with runtime requirements - */ - runtimeRequirements: Set; - }): string; - blockPromise(__0: { - /** - * the async block - */ - block: webpack.AsyncDependenciesBlock; - /** - * the message - */ - message: string; - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - /** - * if set, will be filled with runtime requirements - */ - runtimeRequirements: Set; - }): string; - defineEsModuleFlagStatement(__0: { - /** - * the name of the exports object - */ - exportsArgument: string; - /** - * if set, will be filled with runtime requirements - */ - runtimeRequirements: Set; - }): string; - } - export abstract class RuntimeValue { - fn: any; - fileDependencies: any; - exec(parser?: any): any; - } - export const SKIP_OVER_NAME: unique symbol; - export interface ScopeInfo { - definitions: webpack.StackedMap< - string, - webpack.ScopeInfo | webpack.VariableInfo - >; - topLevelScope: boolean | "arrow"; - inShorthand: boolean; - isStrict: boolean; - isAsmJs: boolean; - inTry: boolean; - } - export abstract class Serializer { - serializeMiddlewares: any; - deserializeMiddlewares: any; - context: any; - serialize(obj?: any, context?: any): any; - deserialize(value?: any, context?: any): any; - } - export class SideEffectsFlagPlugin { - constructor(); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - static moduleHasSideEffects( - moduleName?: any, - flagValue?: any, - cache?: any - ): any; - } - - /** - * istanbul ignore next - */ - export interface Snapshot { - startTime?: number; - fileTimestamps?: Map; - fileHashes?: Map; - contextTimestamps?: Map; - contextHashes?: Map; - missingExistence?: Map; - managedItemInfo?: Map; - children?: Set; - } - export abstract class SortableSet extends Set { - /** - * Sort with a comparer function - */ - sortWith(sortFn: (arg0: T, arg1: T) => number): void; - sort(): void; - - /** - * Get data from cache - */ - getFromCache(fn: (arg0: webpack.SortableSet) => R): R; - - /** - * Get data from cache (ignoring sorting) - */ - getFromUnorderedCache(fn: (arg0: webpack.SortableSet) => R): R; - toJSON(): Array; - - /** - * Iterates over values in the set. - */ - [Symbol.iterator](): IterableIterator; - readonly [Symbol.toStringTag]: string; - } - export abstract class Source { - size(): number; - map(options: webpack.MapOptions): Object; - sourceAndMap( - options: webpack.MapOptions - ): { source: string | Buffer; map: Object }; - updateHash(hash: webpack.Hash): void; - source(): string | Buffer; - buffer(): Buffer; - } - export interface SourceContext { - /** - * the dependency templates - */ - dependencyTemplates: webpack.DependencyTemplates; - - /** - * the runtime template - */ - runtimeTemplate: webpack.RuntimeTemplate; - - /** - * the module graph - */ - moduleGraph: webpack.ModuleGraph; - - /** - * the chunk graph - */ - chunkGraph: webpack.ChunkGraph; - - /** - * the type of source that should be generated - */ - type?: string; - } - export class SourceMapDevToolPlugin { - constructor(options?: webpack.SourceMapDevToolPluginOptions); - sourceMapFilename: string | false; - sourceMappingURLComment: string | false; - moduleFilenameTemplate: string | Function; - fallbackModuleFilenameTemplate: string | Function; - namespace: string; - options: webpack.SourceMapDevToolPluginOptions; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export interface SourceMapDevToolPluginOptions { - /** - * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending. - */ - append?: string | false; - - /** - * Indicates whether column mappings should be used (defaults to true). - */ - columns?: boolean; - - /** - * Exclude modules that match the given value from source map generation. - */ - exclude?: string | RegExp | Array; - - /** - * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict. - */ - fallbackModuleFilenameTemplate?: string | Function; - - /** - * Path prefix to which the [file] placeholder is relative to. - */ - fileContext?: string; - - /** - * Defines the output filename of the SourceMap (will be inlined if no value is provided). - */ - filename?: string | false; - - /** - * Include source maps for module paths that match the given value. - */ - include?: string | RegExp | Array; - - /** - * Indicates whether SourceMaps from loaders should be used (defaults to true). - */ - module?: boolean; - - /** - * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap. - */ - moduleFilenameTemplate?: string | Function; - - /** - * Namespace prefix to allow multiple webpack roots in the devtools. - */ - namespace?: string; - - /** - * Omit the 'sourceContents' array from the SourceMap. - */ - noSources?: boolean; - - /** - * Provide a custom public path for the SourceMapping comment. - */ - publicPath?: string; - - /** - * Provide a custom value for the 'sourceRoot' property in the SourceMap. - */ - sourceRoot?: string; - - /** - * Include source maps for modules based on their extension (defaults to .js and .css). - */ - test?: string | RegExp | Array; - } - export interface SourcePosition { - line: number; - column?: number; - } - export interface SplitChunksOptions { - chunksFilter: (chunk: webpack.Chunk) => boolean; - minSize: Record; - minRemainingSize: Record; - maxInitialSize: Record; - maxAsyncSize: Record; - minChunks: number; - maxAsyncRequests: number; - maxInitialRequests: number; - hidePathInfo: boolean; - filename: - | string - | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); - automaticNameDelimiter: string; - getCacheGroups: ( - module: webpack.Module, - context: webpack.CacheGroupsContext - ) => Array; - getName: ( - module?: webpack.Module, - chunks?: Array, - key?: string - ) => string; - fallbackCacheGroup: webpack.FallbackCacheGroup; - } - export class SplitChunksPlugin { - constructor(options?: webpack.OptimizationSplitChunksOptions); - options: webpack.SplitChunksOptions; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export abstract class StackedMap { - map: Map; - stack: Array< - Map - >; - set(item: K, value: V): void; - delete(item: K): void; - has(item: K): boolean; - get(item: K): V; - asArray(): Array; - asSet(): Set; - asPairArray(): Array<[K, V]>; - asMap(): Map; - readonly size: number; - createChild(): webpack.StackedMap; - } - export type Statement = - | ExpressionStatement - | BlockStatement - | EmptyStatement - | DebuggerStatement - | WithStatement - | ReturnStatement - | LabeledStatement - | BreakStatement - | ContinueStatement - | IfStatement - | SwitchStatement - | ThrowStatement - | TryStatement - | WhileStatement - | DoWhileStatement - | ForStatement - | ForInStatement - | ForOfStatement - | FunctionDeclaration - | VariableDeclaration - | ClassDeclaration; - export class Stats { - constructor(compilation: webpack.Compilation); - compilation: webpack.Compilation; - hash: string; - startTime: any; - endTime: any; - hasWarnings(): boolean; - hasErrors(): boolean; - toJson(options?: any): any; - toString(options?: any): any; - } - export abstract class StatsFactory { - hooks: Readonly<{ - extract: HookMap>; - filter: HookMap>; - sort: HookMap< - SyncBailHook<[Array<(arg0?: any, arg1?: any) => number>, any], any> - >; - filterSorted: HookMap>; - sortResults: HookMap< - SyncBailHook<[Array<(arg0?: any, arg1?: any) => number>, any], any> - >; - filterResults: HookMap>; - merge: HookMap, any], any>>; - result: HookMap, any], any>>; - getItemName: HookMap>; - getItemFactory: HookMap>; - }>; - create(type?: any, data?: any, baseContext?: any): any; - } - - /** - * Stats options object. - */ - export interface StatsOptions { - /** - * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults). - */ - all?: boolean; - - /** - * Add assets information. - */ - assets?: boolean; - - /** - * Sort the assets by that field. - */ - assetsSort?: string; - - /** - * Add built at time information. - */ - builtAt?: boolean; - - /** - * Add information about cached (not built) modules. - */ - cached?: boolean; - - /** - * Show cached assets (setting this to `false` only shows emitted files). - */ - cachedAssets?: boolean; - - /** - * Add children information. - */ - children?: boolean; - - /** - * Display all chunk groups with the corresponding bundles. - */ - chunkGroups?: boolean; - - /** - * Add built modules information to chunk information. - */ - chunkModules?: boolean; - - /** - * Add the origins of chunks and chunk merging info. - */ - chunkOrigins?: boolean; - - /** - * Add information about parent, children and sibling chunks to chunk information. - */ - chunkRelations?: boolean; - - /** - * Add root modules information to chunk information. - */ - chunkRootModules?: boolean; - - /** - * Add chunk information. - */ - chunks?: boolean; - - /** - * Sort the chunks by that field. - */ - chunksSort?: string; - - /** - * Enables/Disables colorful output. - */ - colors?: - | boolean - | { - /** - * Custom color for bold text. - */ - bold?: string; - /** - * Custom color for cyan text. - */ - cyan?: string; - /** - * Custom color for green text. - */ - green?: string; - /** - * Custom color for magenta text. - */ - magenta?: string; - /** - * Custom color for red text. - */ - red?: string; - /** - * Custom color for yellow text. - */ - yellow?: string; - }; - - /** - * Context directory for request shortening. - */ - context?: string; - - /** - * Add module depth in module graph. - */ - depth?: boolean; - - /** - * Display the entry points with the corresponding bundles. - */ - entrypoints?: boolean; - - /** - * Add --env information. - */ - env?: boolean; - - /** - * Add details to errors (like resolving log). - */ - errorDetails?: boolean; - - /** - * Add internal stack trace to errors. - */ - errorStack?: boolean; - - /** - * Add errors. - */ - errors?: boolean; - - /** - * Please use excludeModules instead. - */ - exclude?: - | string - | boolean - | RegExp - | Array boolean)> - | ((value: string) => boolean); - - /** - * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions. - */ - excludeAssets?: - | string - | RegExp - | Array boolean)> - | ((value: string) => boolean); - - /** - * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions. - */ - excludeModules?: - | string - | boolean - | RegExp - | Array boolean)> - | ((value: string) => boolean); - - /** - * Add the hash of the compilation. - */ - hash?: boolean; - - /** - * Add ids. - */ - ids?: boolean; - - /** - * Add logging output. - */ - logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log"; - - /** - * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions. - */ - loggingDebug?: - | string - | boolean - | RegExp - | Array boolean)> - | ((value: string) => boolean); - - /** - * Add stack traces to logging output. - */ - loggingTrace?: boolean; - - /** - * Set the maximum number of modules to be shown. - */ - maxModules?: number; - - /** - * Add information about assets inside modules. - */ - moduleAssets?: boolean; - - /** - * Add dependencies and origin of warnings/errors. - */ - moduleTrace?: boolean; - - /** - * Add built modules information. - */ - modules?: boolean; - - /** - * Sort the modules by that field. - */ - modulesSort?: string; - - /** - * Add information about modules nested in other modules (like with module concatenation). - */ - nestedModules?: boolean; - - /** - * Show reasons why optimization bailed out for modules. - */ - optimizationBailout?: boolean; - - /** - * Add information about orphan modules. - */ - orphanModules?: boolean; - - /** - * Add output path information. - */ - outputPath?: boolean; - - /** - * Add performance hint flags. - */ - performance?: boolean; - - /** - * Preset for the default values. - */ - preset?: string | boolean; - - /** - * Show exports provided by modules. - */ - providedExports?: boolean; - - /** - * Add public path information. - */ - publicPath?: boolean; - - /** - * Add information about the reasons why modules are included. - */ - reasons?: boolean; - - /** - * Add information about runtime modules. - */ - runtime?: boolean; - - /** - * Add the source code of modules. - */ - source?: boolean; - - /** - * Add timing information. - */ - timings?: boolean; - - /** - * Show exports used by modules. - */ - usedExports?: boolean; - - /** - * Add webpack version information. - */ - version?: boolean; - - /** - * Add warnings. - */ - warnings?: boolean; - - /** - * Suppress warnings that match the specified filters. Filters can be Strings, RegExps or Functions. - */ - warningsFilter?: - | string - | RegExp - | Array boolean)> - | ((value: string) => boolean); - } - export abstract class StatsPrinter { - hooks: Readonly<{ - sortElements: HookMap, any], any>>; - printElements: HookMap< - SyncBailHook<[Array, any], any> - >; - sortItems: HookMap, any], any>>; - getItemName: HookMap>; - printItems: HookMap, any], any>>; - print: HookMap>; - result: HookMap>; - }>; - print(type?: any, object?: any, baseContext?: any): any; - } - export type StatsValue = - | boolean - | "none" - | "errors-only" - | "minimal" - | "normal" - | "detailed" - | "verbose" - | "errors-warnings" - | webpack.StatsOptions; - export interface SyntheticDependencyLocation { - name: string; - index?: number; - } - export const TOMBSTONE: unique symbol; - export interface TagInfo { - tag: any; - data: any; - next: webpack.TagInfo; - } - export type Target = - | "web" - | "webworker" - | "node" - | "async-node" - | "node-webkit" - | "electron-main" - | "electron-renderer" - | "electron-preload" - | ((compiler: webpack.Compiler) => void); - export class Template { - constructor(); - static getFunctionContent(fn: Function): string; - static toIdentifier(str: string): string; - static toComment(str: string): string; - static toNormalComment(str: string): string; - static toPath(str: string): string; - static numberToIdentifier(n: number): string; - static numberToIdentifierContinuation(n: number): string; - static indent(s: string | Array): string; - static prefix(s: string | Array, prefix: string): string; - static asString(str: string | Array): string; - static getModulesArrayBounds( - modules: Array - ): false | [number, number]; - static renderChunkModules( - renderContext: webpack.RenderContextModuleTemplate, - modules: Array, - renderModule: (arg0: webpack.Module) => webpack.Source, - prefix?: string - ): webpack.Source; - static renderRuntimeModules( - runtimeModules: Array, - renderContext: webpack.RenderContextModuleTemplate - ): webpack.Source; - static renderChunkRuntimeModules( - runtimeModules: Array, - renderContext: webpack.RenderContextModuleTemplate - ): webpack.Source; - static NUMBER_OF_IDENTIFIER_START_CHARS: number; - static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number; - } - export const UNDEFINED_MARKER: unique symbol; - export interface UpdateHashContext { - /** - * the module - */ - module: webpack.NormalModule; - - /** - * the compilation - */ - compilation: webpack.Compilation; - } - export abstract class VariableInfo { - declaredScope: webpack.ScopeInfo; - freeName: string | true; - tagInfo: webpack.TagInfo; - } - export class WatchIgnorePlugin { - constructor(options: webpack.WatchIgnorePluginOptions); - paths: [string | RegExp, string | RegExp]; - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - - /** - * This file was automatically generated. - * DO NOT MODIFY BY HAND. - * Run `yarn special-lint-fix` to update - */ - export interface WatchIgnorePluginOptions { - /** - * A list of RegExps or absolute paths to directories or files that should be ignored. - */ - paths: [string | RegExp, string | RegExp]; - } - - /** - * Options for the watcher. - */ - export interface WatchOptions { - /** - * Delay the rebuilt after the first change. Value is a time in ms. - */ - aggregateTimeout?: number; - - /** - * Ignore some files from watching (glob pattern). - */ - ignored?: string | Array; - - /** - * Enable polling mode for watching. - */ - poll?: number | boolean; - - /** - * Stop watching when stdin stream has ended. - */ - stdin?: boolean; - } - export abstract class Watching { - startTime: number; - invalid: boolean; - handler: webpack.CallbackCompiler; - callbacks: Array>; - closed: boolean; - suspended: boolean; - watchOptions: { - /** - * Delay the rebuilt after the first change. Value is a time in ms. - */ - aggregateTimeout?: number; - /** - * Ignore some files from watching (glob pattern). - */ - ignored?: string | Array; - /** - * Enable polling mode for watching. - */ - poll?: number | boolean; - /** - * Stop watching when stdin stream has ended. - */ - stdin?: boolean; - }; - compiler: webpack.Compiler; - running: boolean; - watcher: any; - pausedWatcher: any; - watch( - files: Iterable, - dirs: Iterable, - missing: Iterable - ): void; - invalidate(callback?: webpack.CallbackCompiler): void; - suspend(): void; - resume(): void; - close(callback: webpack.CallbackCompiler): void; - } - export class WebWorkerTemplatePlugin { - constructor(); - - /** - * Apply the plugin - */ - apply(compiler: webpack.Compiler): void; - } - export interface WebpackError extends Error { - details: any; - module: webpack.Module; - loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; - hideStack: boolean; - chunk: webpack.Chunk; - file: string; - serialize(__0: { write: any }): void; - deserialize(__0: { read: any }): void; - } - export abstract class WebpackLogger { - getChildLogger: (arg0: string | (() => string)) => webpack.WebpackLogger; - error(...args: Array): void; - warn(...args: Array): void; - info(...args: Array): void; - log(...args: Array): void; - debug(...args: Array): void; - assert(assertion: any, ...args: Array): void; - trace(): void; - clear(): void; - status(...args: Array): void; - group(...args: Array): void; - groupCollapsed(...args: Array): void; - groupEnd(...args: Array): void; - profile(label?: any): void; - profileEnd(label?: any): void; - time(label?: any): void; - timeLog(label?: any): void; - timeEnd(label?: any): void; - timeAggregate(label?: any): void; - timeAggregateEnd(label?: any): void; - } - - /** - * Options object as provided by the user. - */ - export interface WebpackOptions { - /** - * Set the value of `require.amd` and `define.amd`. Or disable AMD support. - */ - amd?: false | { [index: string]: any }; - - /** - * Report the first error as a hard error instead of tolerating it. - */ - bail?: boolean; - - /** - * Cache generated modules and chunks to improve performance for multiple incremental builds. - */ - cache?: boolean | webpack.MemoryCacheOptions | webpack.FileCacheOptions; - - /** - * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. - */ - context?: string; - - /** - * References to other configurations to depend on. - */ - dependencies?: Array; - - /** - * Options for the webpack-dev-server. - */ - devServer?: webpack.DevServer; - - /** - * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). - */ - devtool?: string | false; - - /** - * The entry point(s) of the compilation. - */ - entry?: - | string - | (() => - | string - | webpack.EntryObject - | [string, string] - | Promise) - | webpack.EntryObject - | [string, string]; - - /** - * Enables/Disables experiments (experimental features with relax SemVer compatibility). - */ - experiments?: webpack.Experiments; - - /** - * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. - */ - externals?: - | string - | RegExp - | Array< - | string - | RegExp - | { - [index: string]: - | string - | boolean - | Array - | { [index: string]: any }; - } - | (( - context: string, - request: string, - callback: (err: Error, result: string) => void - ) => void) - > - | { - [index: string]: - | string - | boolean - | Array - | { [index: string]: any }; - } - | (( - context: string, - request: string, - callback: (err: Error, result: string) => void - ) => void); - - /** - * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value). - */ - externalsType?: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - - /** - * Options for infrastructure level logging. - */ - infrastructureLogging?: webpack.InfrastructureLogging; - - /** - * Custom values available in the loader context. - */ - loader?: webpack.Loader; - - /** - * Enable production optimizations or development hints. - */ - mode?: "development" | "production" | "none"; - - /** - * Options affecting the normal modules (`NormalModuleFactory`). - */ - module?: webpack.ModuleOptions; - - /** - * Name of the configuration. Used when loading multiple configurations. - */ - name?: string; - - /** - * Include polyfills or mocks for various node stuff. - */ - node?: false | webpack.NodeOptions; - - /** - * Enables/Disables integrated optimizations. - */ - optimization?: webpack.Optimization; - - /** - * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. - */ - output?: webpack.Output; - - /** - * The number of parallel processed modules in the compilation. - */ - parallelism?: number; - - /** - * Configuration for web performance recommendations. - */ - performance?: false | webpack.PerformanceOptions; - - /** - * Add additional plugins to the compiler. - */ - plugins?: Array< - | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) - | webpack.WebpackPluginInstance - >; - - /** - * Capture timing information for each module. - */ - profile?: boolean; - - /** - * Store compiler state to a json file. - */ - recordsInputPath?: string | false; - - /** - * Load compiler state from a json file. - */ - recordsOutputPath?: string | false; - - /** - * Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined. - */ - recordsPath?: string | false; - - /** - * Options for the resolver. - */ - resolve?: webpack.ResolveOptions; - - /** - * Options for the resolver when resolving loaders. - */ - resolveLoader?: webpack.ResolveOptions; - - /** - * Stats options object or preset name. - */ - stats?: - | boolean - | "none" - | "errors-only" - | "minimal" - | "normal" - | "detailed" - | "verbose" - | "errors-warnings" - | webpack.StatsOptions; - - /** - * Environment to build for. - */ - target?: - | "web" - | "webworker" - | "node" - | "async-node" - | "node-webkit" - | "electron-main" - | "electron-renderer" - | "electron-preload" - | ((compiler: webpack.Compiler) => void); - - /** - * Enter watch mode, which rebuilds on file change. - */ - watch?: boolean; - - /** - * Options for the watcher. - */ - watchOptions?: webpack.WatchOptions; - } - export class WebpackOptionsApply extends webpack.OptionsApply { - constructor(); - } - export class WebpackOptionsDefaulter { - constructor(); - process(options?: any): any; - } - - /** - * Normalized webpack options object. - */ - export interface WebpackOptionsNormalized { - /** - * Set the value of `require.amd` and `define.amd`. Or disable AMD support. - */ - amd?: false | { [index: string]: any }; - - /** - * Report the first error as a hard error instead of tolerating it. - */ - bail?: boolean; - - /** - * Cache generated modules and chunks to improve performance for multiple incremental builds. - */ - cache: false | webpack.MemoryCacheOptions | webpack.FileCacheOptions; - - /** - * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. - */ - context?: string; - - /** - * References to other configurations to depend on. - */ - dependencies?: Array; - - /** - * Options for the webpack-dev-server. - */ - devServer?: webpack.DevServer; - - /** - * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). - */ - devtool?: string | false; - - /** - * The entry point(s) of the compilation. - */ - entry: - | (() => Promise) - | webpack.EntryStaticNormalized; - - /** - * Enables/Disables experiments (experimental features with relax SemVer compatibility). - */ - experiments: webpack.Experiments; - - /** - * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. - */ - externals: - | string - | RegExp - | Array< - | string - | RegExp - | { - [index: string]: - | string - | boolean - | Array - | { [index: string]: any }; - } - | (( - context: string, - request: string, - callback: (err: Error, result: string) => void - ) => void) - > - | { - [index: string]: - | string - | boolean - | Array - | { [index: string]: any }; - } - | (( - context: string, - request: string, - callback: (err: Error, result: string) => void - ) => void); - - /** - * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value). - */ - externalsType?: - | "var" - | "module" - | "assign" - | "this" - | "window" - | "self" - | "global" - | "commonjs" - | "commonjs2" - | "commonjs-module" - | "amd" - | "amd-require" - | "umd" - | "umd2" - | "jsonp" - | "system"; - - /** - * Options for infrastructure level logging. - */ - infrastructureLogging: webpack.InfrastructureLogging; - - /** - * Custom values available in the loader context. - */ - loader?: webpack.Loader; - - /** - * Enable production optimizations or development hints. - */ - mode?: "development" | "production" | "none"; - - /** - * Options affecting the normal modules (`NormalModuleFactory`). - */ - module: webpack.ModuleOptions; - - /** - * Name of the configuration. Used when loading multiple configurations. - */ - name?: string; - - /** - * Include polyfills or mocks for various node stuff. - */ - node: false | webpack.NodeOptions; - - /** - * Enables/Disables integrated optimizations. - */ - optimization: webpack.Optimization; - - /** - * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. - */ - output: webpack.OutputNormalized; - - /** - * The number of parallel processed modules in the compilation. - */ - parallelism?: number; - - /** - * Configuration for web performance recommendations. - */ - performance?: false | webpack.PerformanceOptions; - - /** - * Add additional plugins to the compiler. - */ - plugins: Array< - | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) - | webpack.WebpackPluginInstance - >; - - /** - * Capture timing information for each module. - */ - profile?: boolean; - - /** - * Store compiler state to a json file. - */ - recordsInputPath?: string | false; - - /** - * Load compiler state from a json file. - */ - recordsOutputPath?: string | false; - - /** - * Options for the resolver. - */ - resolve: webpack.ResolveOptions; - - /** - * Options for the resolver when resolving loaders. - */ - resolveLoader: webpack.ResolveOptions; - - /** - * Stats options object or preset name. - */ - stats: - | boolean - | "none" - | "errors-only" - | "minimal" - | "normal" - | "detailed" - | "verbose" - | "errors-warnings" - | webpack.StatsOptions; - - /** - * Environment to build for. - */ - target?: - | "web" - | "webworker" - | "node" - | "async-node" - | "node-webkit" - | "electron-main" - | "electron-renderer" - | "electron-preload" - | ((compiler: webpack.Compiler) => void); - - /** - * Enter watch mode, which rebuilds on file change. - */ - watch?: boolean; - - /** - * Options for the watcher. - */ - watchOptions: webpack.WatchOptions; - } - - /** - * Plugin instance. - */ - export interface WebpackPluginInstance { - [index: string]: any; - - /** - * The run point of the plugin, required method. - */ - apply: (compiler: webpack.Compiler) => void; - } - export interface WithId { - id: string | number; - } - export interface WithOptions { - /** - * create a resolver with additional/different options - */ - withOptions: (arg0?: any) => webpack.Resolver & webpack.WithOptions; - } - export interface WriteOnlySet { - add(item: T): void; - } - export namespace __TypeLibIndex { - export const webpack: ( - options: webpack.WebpackOptions | Array, - callback?: webpack.CallbackWebpack - ) => webpack.Compiler | webpack.MultiCompiler; - export const validate: any; - export const validateSchema: (schema?: any, options?: any) => void; - export const version: any; - export const WebpackOptionsValidationError: ValidationError; - export const ValidationError: ValidationError; - export { - cli, - AutomaticPrefetchPlugin, - BannerPlugin, - Cache, - Chunk, - ChunkGraph, - Compilation, - Compiler, - ContextExclusionPlugin, - ContextReplacementPlugin, - DefinePlugin, - DelegatedPlugin, - Dependency, - DllPlugin, - DllReferencePlugin, - EntryPlugin, - EnvironmentPlugin, - EvalDevToolModulePlugin, - EvalSourceMapDevToolPlugin, - ExternalModule, - ExternalsPlugin, - Generator, - HotModuleReplacementPlugin, - IgnorePlugin, - JavascriptModulesPlugin, - LibManifestPlugin, - LibraryTemplatePlugin, - LoaderOptionsPlugin, - LoaderTargetPlugin, - Module, - ModuleFilenameHelpers, - ModuleGraph, - NoEmitOnErrorsPlugin, - NormalModule, - NormalModuleReplacementPlugin, - MultiCompiler, - Parser, - PrefetchPlugin, - ProgressPlugin, - ProvidePlugin, - RuntimeGlobals, - RuntimeModule, - EntryPlugin as SingleEntryPlugin, - SourceMapDevToolPlugin, - Stats, - Template, - WatchIgnorePlugin, - WebpackOptionsApply, - WebpackOptionsDefaulter, - __TypeLiteral_12 as cache, - __TypeLiteral_1 as config, - __TypeLiteral_2 as ids, - __TypeLiteral_3 as javascript, - __TypeLiteral_4 as optimize, - __TypeLiteral_5 as web, - __TypeLiteral_6 as webworker, - __TypeLiteral_7 as node, - __TypeLiteral_8 as wasm, - __TypeLiteral_9 as library, - __TypeLiteral_10 as debug, - __TypeLiteral_11 as util - }; - } - export namespace __TypeLiteral_1 { - export const getNormalizedWebpackOptions: ( - config: webpack.WebpackOptions - ) => webpack.WebpackOptionsNormalized; - export const applyWebpackOptionsDefaults: ( - options: webpack.WebpackOptionsNormalized - ) => void; - } - export namespace __TypeLiteral_10 { - export { ProfilingPlugin }; - } - export namespace __TypeLiteral_11 { - export const createHash: ( - algorithm: string | typeof webpack.Hash - ) => webpack.Hash; - export { comparators, serialization }; - } - export namespace __TypeLiteral_12 { + export const WebpackOptionsValidationError: ValidationError; + export const ValidationError: ValidationError; + export namespace cache { export { MemoryCachePlugin }; } - export namespace __TypeLiteral_2 { + export namespace config { + export const getNormalizedWebpackOptions: ( + config: Configuration + ) => WebpackOptionsNormalized; + export const applyWebpackOptionsDefaults: ( + options: WebpackOptionsNormalized + ) => void; + } + export namespace ids { export { ChunkModuleIdRangePlugin, NaturalModuleIdsPlugin, @@ -9305,10 +7262,10 @@ declare namespace webpack { HashedModuleIdsPlugin }; } - export namespace __TypeLiteral_3 { + export namespace javascript { export { JavascriptModulesPlugin }; } - export namespace __TypeLiteral_4 { + export namespace optimize { export { AggressiveMergingPlugin, AggressiveSplittingPlugin, @@ -9320,219 +7277,159 @@ declare namespace webpack { SplitChunksPlugin }; } - export namespace __TypeLiteral_5 { + export namespace web { export { FetchCompileWasmPlugin, JsonpTemplatePlugin }; } - export namespace __TypeLiteral_6 { + export namespace webworker { export { WebWorkerTemplatePlugin }; } - export namespace __TypeLiteral_7 { + export namespace node { export { NodeEnvironmentPlugin, NodeTemplatePlugin, ReadFileCompileWasmPlugin }; } - export namespace __TypeLiteral_8 { + export namespace wasm { export { AsyncWebAssemblyModulesPlugin }; } - export namespace __TypeLiteral_9 { + export namespace library { export { AbstractLibraryPlugin, EnableLibraryPlugin }; } - type __TypeWebpackOptions = (data: {}) => - | string - | { - /** - * Unique loader options identifier. - */ - ident?: string; - /** - * Loader name. - */ - loader?: string; - /** - * Loader options. - */ - options?: string | { [index: string]: any }; - } - | __TypeWebpackOptions - | Array; - export namespace cli { - export let getArguments: (schema?: any) => Record; - export let processArguments: ( - args: Record, - config: any, - values: Record< - string, - | string - | number - | boolean - | RegExp - | Array - > - ) => Array; + export namespace debug { + export { ProfilingPlugin }; } - export namespace comparators { - export let compareChunksById: ( - a: webpack.Chunk, - b: webpack.Chunk - ) => 0 | 1 | -1; - export let compareModulesByIdentifier: ( - a: webpack.Module, - b: webpack.Module - ) => 0 | 1 | -1; - export let compareModulesById: ( - arg0: webpack.ChunkGraph - ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; - export let compareNumbers: (a: number, b: number) => 0 | 1 | -1; - export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1; - export let compareModulesByPostOrderIndexOrIdentifier: ( - arg0: webpack.ModuleGraph - ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; - export let compareModulesByPreOrderIndexOrIdentifier: ( - arg0: webpack.ModuleGraph - ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; - export let compareModulesByIdOrIdentifier: ( - arg0: webpack.ChunkGraph - ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; - export let compareChunks: ( - arg0: webpack.ChunkGraph - ) => (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1; - export let compareIds: ( - a: string | number, - b: string | number - ) => 0 | 1 | -1; - export let compareChunkGroupsByIndex: ( - a: webpack.ChunkGroup, - b: webpack.ChunkGroup - ) => 0 | 1 | -1; - export let concatComparators: ( - c1: (arg0: T, arg1: T) => 0 | 1 | -1, - c2: (arg0: T, arg1: T) => 0 | 1 | -1, - ...cRest: Array<(arg0: T, arg1: T) => 0 | 1 | -1> - ) => (arg0: T, arg1: T) => 0 | 1 | -1; - export let compareSelect: ( - getter: (input: T) => R, - comparator: (arg0: R, arg1: R) => 0 | 1 | -1 - ) => (arg0: T, arg1: T) => 0 | 1 | -1; - export let compareIterables: ( - elementComparator: (arg0: T, arg1: T) => 0 | 1 | -1 - ) => (arg0: Iterable, arg1: Iterable) => 0 | 1 | -1; - export let keepOriginalOrder: ( - iterable: Iterable - ) => (arg0: T, arg1: T) => 0 | 1 | -1; - export let compareChunksNatural: ( - chunkGraph: webpack.ChunkGraph - ) => (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1; - export let compareLocations: ( - a: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, - b: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation - ) => 0 | 1 | -1; - } - export function exports( - options: webpack.WebpackOptions | Array, - callback?: webpack.CallbackWebpack - ): webpack.Compiler | webpack.MultiCompiler; - export namespace exports { - export const webpack: ( - options: webpack.WebpackOptions | Array, - callback?: webpack.CallbackWebpack - ) => webpack.Compiler | webpack.MultiCompiler; - export const validate: any; - export const validateSchema: (schema?: any, options?: any) => void; - export const version: any; - export const WebpackOptionsValidationError: ValidationError; - export const ValidationError: ValidationError; - export type WebpackPluginFunction = ( - this: webpack.Compiler, - compiler: webpack.Compiler - ) => void; - export type ParserState = Record & webpack.ParserStateBase; - export { - cli, - AutomaticPrefetchPlugin, - BannerPlugin, - Cache, - Chunk, - ChunkGraph, - Compilation, - Compiler, - ContextExclusionPlugin, - ContextReplacementPlugin, - DefinePlugin, - DelegatedPlugin, - Dependency, - DllPlugin, - DllReferencePlugin, - EntryPlugin, - EnvironmentPlugin, - EvalDevToolModulePlugin, - EvalSourceMapDevToolPlugin, - ExternalModule, - ExternalsPlugin, - Generator, - HotModuleReplacementPlugin, - IgnorePlugin, - JavascriptModulesPlugin, - LibManifestPlugin, - LibraryTemplatePlugin, - LoaderOptionsPlugin, - LoaderTargetPlugin, - Module, - ModuleFilenameHelpers, - ModuleGraph, - NoEmitOnErrorsPlugin, - NormalModule, - NormalModuleReplacementPlugin, - MultiCompiler, - Parser, - PrefetchPlugin, - ProgressPlugin, - ProvidePlugin, - RuntimeGlobals, - RuntimeModule, - EntryPlugin as SingleEntryPlugin, - SourceMapDevToolPlugin, - Stats, - Template, - WatchIgnorePlugin, - WebpackOptionsApply, - WebpackOptionsDefaulter, - __TypeLiteral_12 as cache, - __TypeLiteral_1 as config, - __TypeLiteral_2 as ids, - __TypeLiteral_3 as javascript, - __TypeLiteral_4 as optimize, - __TypeLiteral_5 as web, - __TypeLiteral_6 as webworker, - __TypeLiteral_7 as node, - __TypeLiteral_8 as wasm, - __TypeLiteral_9 as library, - __TypeLiteral_10 as debug, - __TypeLiteral_11 as util, - WebpackOptions as Configuration, - WebpackPluginInstance - }; - } - export namespace serialization { - export let register: ( - Constructor: { new (...params: Array): any }, - request: string, - name: string, - serializer: webpack.ObjectSerializer - ) => void; - export let registerLoader: ( - regExp: RegExp, - loader: (arg0: string) => boolean - ) => void; - export let registerNotSerializable: (Constructor: { - new (...params: Array): any; - }) => void; - export let NOT_SERIALIZABLE: {}; - export let buffersSerializer: webpack.Serializer; - export let createFileSerializer: (fs?: any) => webpack.Serializer; - export { MEASURE_START_OPERATION, MEASURE_END_OPERATION }; + export namespace util { + export const createHash: (algorithm: HashFunction) => Hash; + export namespace comparators { + export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1; + export let compareModulesByIdentifier: ( + a: Module, + b: Module + ) => 0 | 1 | -1; + export let compareModulesById: ( + arg0: ChunkGraph + ) => (arg0: Module, arg1: Module) => 0 | 1 | -1; + export let compareNumbers: (a: number, b: number) => 0 | 1 | -1; + export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1; + export let compareModulesByPostOrderIndexOrIdentifier: ( + arg0: ModuleGraph + ) => (arg0: Module, arg1: Module) => 0 | 1 | -1; + export let compareModulesByPreOrderIndexOrIdentifier: ( + arg0: ModuleGraph + ) => (arg0: Module, arg1: Module) => 0 | 1 | -1; + export let compareModulesByIdOrIdentifier: ( + arg0: ChunkGraph + ) => (arg0: Module, arg1: Module) => 0 | 1 | -1; + export let compareChunks: ( + arg0: ChunkGraph + ) => (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1; + export let compareIds: ( + a: string | number, + b: string | number + ) => 0 | 1 | -1; + export let compareChunkGroupsByIndex: ( + a: ChunkGroup, + b: ChunkGroup + ) => 0 | 1 | -1; + export let concatComparators: ( + c1: (arg0: T, arg1: T) => 0 | 1 | -1, + c2: (arg0: T, arg1: T) => 0 | 1 | -1, + ...cRest: Array<(arg0: T, arg1: T) => 0 | 1 | -1> + ) => (arg0: T, arg1: T) => 0 | 1 | -1; + export let compareSelect: ( + getter: (input: T) => R, + comparator: (arg0: R, arg1: R) => 0 | 1 | -1 + ) => (arg0: T, arg1: T) => 0 | 1 | -1; + export let compareIterables: ( + elementComparator: (arg0: T, arg1: T) => 0 | 1 | -1 + ) => (arg0: Iterable, arg1: Iterable) => 0 | 1 | -1; + export let keepOriginalOrder: ( + iterable: Iterable + ) => (arg0: T, arg1: T) => 0 | 1 | -1; + export let compareChunksNatural: ( + chunkGraph: ChunkGraph + ) => (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1; + export let compareLocations: ( + a: SyntheticDependencyLocation | RealDependencyLocation, + b: SyntheticDependencyLocation | RealDependencyLocation + ) => 0 | 1 | -1; + } + export namespace serialization { + export let register: ( + Constructor: { new (...params: Array): any }, + request: string, + name: string, + serializer: ObjectSerializer + ) => void; + export let registerLoader: ( + regExp: RegExp, + loader: (arg0: string) => boolean + ) => void; + export let registerNotSerializable: (Constructor: { + new (...params: Array): any; + }) => void; + export let NOT_SERIALIZABLE: {}; + export let buffersSerializer: Serializer; + export let createFileSerializer: (fs?: any) => Serializer; + export { MEASURE_START_OPERATION, MEASURE_END_OPERATION }; + } } + export type WebpackPluginFunction = ( + this: Compiler, + compiler: Compiler + ) => void; + export type ParserState = Record & ParserStateBase; + export { + AutomaticPrefetchPlugin, + BannerPlugin, + Cache, + Chunk, + ChunkGraph, + Compilation, + Compiler, + ContextExclusionPlugin, + ContextReplacementPlugin, + DefinePlugin, + DelegatedPlugin, + Dependency, + DllPlugin, + DllReferencePlugin, + EntryPlugin, + EnvironmentPlugin, + EvalDevToolModulePlugin, + EvalSourceMapDevToolPlugin, + ExternalModule, + ExternalsPlugin, + Generator, + HotModuleReplacementPlugin, + IgnorePlugin, + JavascriptModulesPlugin, + LibManifestPlugin, + LibraryTemplatePlugin, + LoaderOptionsPlugin, + LoaderTargetPlugin, + Module, + ModuleGraph, + NoEmitOnErrorsPlugin, + NormalModule, + NormalModuleReplacementPlugin, + MultiCompiler, + Parser, + PrefetchPlugin, + ProgressPlugin, + ProvidePlugin, + RuntimeModule, + EntryPlugin as SingleEntryPlugin, + SourceMapDevToolPlugin, + Stats, + Template, + WatchIgnorePlugin, + WebpackOptionsApply, + WebpackOptionsDefaulter, + Configuration, + WebpackPluginInstance + }; } -export = webpack.exports; +export = exports; diff --git a/yarn.lock b/yarn.lock index d633df1be..c777aecc7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6765,9 +6765,9 @@ toml@^3.0.0: resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== -tooling@webpack/tooling#v1.0.0: +tooling@webpack/tooling#v1.1.0: version "1.0.0" - resolved "https://codeload.github.com/webpack/tooling/tar.gz/275ad8a94cca2040934655c07ea70bcb6d92c7b9" + resolved "https://codeload.github.com/webpack/tooling/tar.gz/82ece2e06f9c72c6a4e08f4e33a9615d94a882a3" dependencies: "@yarnpkg/lockfile" "^1.1.0" commondir "^1.0.1" From 67d4132534453fc3eccda5d3c9a3f286d040833b Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 21 Apr 2020 08:54:59 +0200 Subject: [PATCH 27/30] improve top level types --- lib/index.js | 4 ++-- lib/webpack.js | 22 +++++++++++++++++----- types.d.ts | 25 ++++++++++++++++--------- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/lib/index.js b/lib/index.js index 8577bd0b4..fac34cd7e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -68,14 +68,14 @@ module.exports = mergeExports(fn, { get validate() { const validateSchema = require("./validateSchema"); const webpackOptionsSchema = require("../schemas/WebpackOptions.json"); - return validateSchema.bind(null, webpackOptionsSchema); + return options => validateSchema(webpackOptionsSchema, options); }, get validateSchema() { const validateSchema = require("./validateSchema"); return validateSchema; }, get version() { - return require("../package.json").version; + return /** @type {string} */ (require("../package.json").version); }, get cli() { diff --git a/lib/webpack.js b/lib/webpack.js index 08750e9c6..a1b0dc82c 100644 --- a/lib/webpack.js +++ b/lib/webpack.js @@ -80,11 +80,23 @@ const createCompiler = rawOptions => { }; /** - * @param {WebpackOptions | WebpackOptions[]} options options object - * @param {Callback=} callback callback - * @returns {Compiler | MultiCompiler} the compiler object + * @callback WebpackFunctionSingle + * @param {WebpackOptions} options options object + * @param {Callback=} callback callback + * @returns {Compiler} the compiler object */ -const webpack = (options, callback) => { + +/** + * @callback WebpackFunctionMulti + * @param {WebpackOptions[]} options options objects + * @param {Callback=} callback callback + * @returns {MultiCompiler} the multi compiler object + */ + +const webpack = /** @type {WebpackFunctionSingle & WebpackFunctionMulti} */ (( + options, + callback +) => { validateSchema(webpackOptionsSchema, options); /** @type {MultiCompiler|Compiler} */ let compiler; @@ -114,6 +126,6 @@ const webpack = (options, callback) => { } } return compiler; -}; +}); module.exports = webpack; diff --git a/types.d.ts b/types.d.ts index 25d273758..0cf2ccd21 100644 --- a/types.d.ts +++ b/types.d.ts @@ -7125,17 +7125,24 @@ type __TypeWebpackOptions = (data: {}) => | __TypeWebpackOptions | Array; declare function exports( - options: Configuration | Array, - callback?: CallbackWebpack -): Compiler | MultiCompiler; + options: Configuration, + callback?: CallbackWebpack +): Compiler; +declare function exports( + options: Array, + callback?: CallbackWebpack +): MultiCompiler; declare namespace exports { - export const webpack: ( - options: Configuration | Array, - callback?: CallbackWebpack - ) => Compiler | MultiCompiler; - export const validate: any; + export const webpack: { + (options: Configuration, callback?: CallbackWebpack): Compiler; + ( + options: Array, + callback?: CallbackWebpack + ): MultiCompiler; + }; + export const validate: (options?: any) => void; export const validateSchema: (schema?: any, options?: any) => void; - export const version: any; + export const version: string; export namespace cli { export let getArguments: (schema?: any) => Record; export let processArguments: ( From f9eb7f502807dc5d5b0ba75354ccf0c790ae51e2 Mon Sep 17 00:00:00 2001 From: Anix Date: Thu, 26 Mar 2020 12:50:16 +0000 Subject: [PATCH 28/30] fix: exporting deterministicChinkIdPlugin as ids (fixes #10608) --- lib/index.js | 3 +++ types.d.ts | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/index.js b/lib/index.js index fac34cd7e..bee5027c6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -277,6 +277,9 @@ module.exports = mergeExports(fn, { get NamedModuleIdsPlugin() { return require("./ids/NamedModuleIdsPlugin"); }, + get DeterministicChunkIdsPlugin() { + return require("./ids/DeterministicChunkIdsPlugin"); + }, get DeterministicModuleIdsPlugin() { return require("./ids/DeterministicModuleIdsPlugin"); }, diff --git a/types.d.ts b/types.d.ts index 0cf2ccd21..8a7a0e25e 100644 --- a/types.d.ts +++ b/types.d.ts @@ -1646,6 +1646,15 @@ declare abstract class DependencyTemplates { getHash(): string; clone(): DependencyTemplates; } +declare class DeterministicChunkIdsPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} declare class DeterministicModuleIdsPlugin { constructor(options?: any); options: any; @@ -7263,6 +7272,7 @@ declare namespace exports { NaturalModuleIdsPlugin, OccurrenceModuleIdsPlugin, NamedModuleIdsPlugin, + DeterministicChunkIdsPlugin, DeterministicModuleIdsPlugin, NamedChunkIdsPlugin, OccurrenceChunkIdsPlugin, From 66e3ae125263980ae5d4a048886598578d0b128c Mon Sep 17 00:00:00 2001 From: Anix Date: Thu, 9 Apr 2020 14:53:49 +0000 Subject: [PATCH 29/30] chore: added test cases --- test/configCases/optimization/chunk/files/file1.js | 1 + test/configCases/optimization/chunk/index.js | 1 + test/configCases/optimization/chunk/webpack.config.js | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 test/configCases/optimization/chunk/files/file1.js create mode 100644 test/configCases/optimization/chunk/index.js create mode 100644 test/configCases/optimization/chunk/webpack.config.js diff --git a/test/configCases/optimization/chunk/files/file1.js b/test/configCases/optimization/chunk/files/file1.js new file mode 100644 index 000000000..80e295b96 --- /dev/null +++ b/test/configCases/optimization/chunk/files/file1.js @@ -0,0 +1 @@ +module.exports = "hello"; diff --git a/test/configCases/optimization/chunk/index.js b/test/configCases/optimization/chunk/index.js new file mode 100644 index 000000000..732bebffb --- /dev/null +++ b/test/configCases/optimization/chunk/index.js @@ -0,0 +1 @@ +it("should run with deterministic chunkIds", () => {}); diff --git a/test/configCases/optimization/chunk/webpack.config.js b/test/configCases/optimization/chunk/webpack.config.js new file mode 100644 index 000000000..35b1f3a32 --- /dev/null +++ b/test/configCases/optimization/chunk/webpack.config.js @@ -0,0 +1,8 @@ +const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ +module.exports = { + optimization: { + chunkIds: false + }, + plugins: [new webpack.ids.DeterministicChunkIdsPlugin()] +}; From 4c7e5e667bd30affa2e8c3bc8c65fd38e90912fe Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Tue, 21 Apr 2020 14:06:17 +0200 Subject: [PATCH 30/30] 5.0.0-beta.15 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 945aa9c81..6f9ec14b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack", - "version": "5.0.0-beta.14", + "version": "5.0.0-beta.15", "author": "Tobias Koppers @sokra", "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", "license": "MIT",