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/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: 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.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 88059862b..bbf939de3 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. */ @@ -239,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. @@ -292,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. */ @@ -489,7 +489,7 @@ export type ResolveLoader = ResolveOptions; /** * Stats options object or preset name. */ -export type Stats = +export type StatsValue = | ( | "none" | "errors-only" @@ -539,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. @@ -555,7 +564,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 +612,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 +668,7 @@ export interface WebpackOptions { /** * Stats options object or preset name. */ - stats?: Stats; + stats?: StatsValue; /** * Environment to build for. */ @@ -906,7 +915,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. */ @@ -1323,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. */ @@ -1412,7 +1423,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. */ @@ -2096,7 +2107,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 +2155,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 +2207,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..59d8b7892 --- /dev/null +++ b/generate-types-config.js @@ -0,0 +1,7 @@ +module.exports = { + nameMapping: { + FsStats: /^Stats Import fs/, + Configuration: /^WebpackOptions / + }, + exclude: [/^devServer in WebpackOptions /] +}; diff --git a/lib/ChunkGroup.js b/lib/ChunkGroup.js index 9b99e0e01..0a749d409 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) { 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/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/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/RuntimeGlobals.js b/lib/RuntimeGlobals.js index 10d07192f..251210ce3 100644 --- a/lib/RuntimeGlobals.js +++ b/lib/RuntimeGlobals.js @@ -220,6 +220,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/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/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/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/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/index.js b/lib/index.js index f6a3e65a1..bee5027c6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,172 +5,389 @@ "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"); -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 */ +/** @typedef {import("../declarations/WebpackOptions").WebpackPluginFunction} WebpackPluginFunction */ +/** @typedef {import("../declarations/WebpackOptions").WebpackPluginInstance} WebpackPluginInstance */ +/** @typedef {import("./Parser").ParserState} ParserState */ -const exportPlugins = (obj, mappings) => { - for (const name of Object.keys(mappings)) { - Object.defineProperty(obj, name, { - configurable: false, - enumerable: true, - get: memorize(mappings[name]) - }); - } +/** + * @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); }; -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" - ), +/** + * @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 options => validateSchema(webpackOptionsSchema, options); + }, + get validateSchema() { + const validateSchema = require("./validateSchema"); + return validateSchema; + }, + get version() { + return /** @type {string} */ (require("../package.json").version); + }, + + get cli() { + return require("./cli"); + }, + get AutomaticPrefetchPlugin() { + return require("./AutomaticPrefetchPlugin"); + }, + get BannerPlugin() { + return require("./BannerPlugin"); + }, + get Cache() { + return require("./Cache"); + }, + get Chunk() { + return require("./Chunk"); + }, + get ChunkGraph() { + return require("./ChunkGraph"); + }, + 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 ExternalModule() { + return require("./ExternalModule"); + }, + 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 ModuleGraph() { + return require("./ModuleGraph"); + }, + 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 WebpackOptionsApply() { + return require("./WebpackOptionsApply"); + }, + 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 - WebpackOptionsValidationError: () => validate.ValidationError, - ValidationError: () => validate.ValidationError -}); + get WebpackOptionsValidationError() { + return require("schema-utils").ValidationError; + }, + get ValidationError() { + return require("schema-utils").ValidationError; + }, -exportPlugins((module.exports.cache = {}), { - MemoryCachePlugin: () => require("./cache/MemoryCachePlugin") -}); + cache: { + get MemoryCachePlugin() { + return require("./cache/MemoryCachePlugin"); + } + }, -exportPlugins((module.exports.config = {}), { - getNormalizedWebpackOptions: () => - require("./config/normalization").getNormalizedWebpackOptions, - applyWebpackOptionsDefaults: () => - require("./config/defaults").applyWebpackOptionsDefaults -}); + config: { + get getNormalizedWebpackOptions() { + return require("./config/normalization").getNormalizedWebpackOptions; + }, + get applyWebpackOptionsDefaults() { + return 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") -}); + 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 DeterministicChunkIdsPlugin() { + return require("./ids/DeterministicChunkIdsPlugin"); + }, + get DeterministicModuleIdsPlugin() { + return require("./ids/DeterministicModuleIdsPlugin"); + }, + get NamedChunkIdsPlugin() { + return require("./ids/NamedChunkIdsPlugin"); + }, + get OccurrenceChunkIdsPlugin() { + return require("./ids/OccurrenceChunkIdsPlugin"); + }, + get HashedModuleIdsPlugin() { + return require("./ids/HashedModuleIdsPlugin"); + } + }, -exportPlugins((module.exports.javascript = {}), { - JavascriptModulesPlugin: () => require("./javascript/JavascriptModulesPlugin") -}); + javascript: { + get JavascriptModulesPlugin() { + return 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") -}); + 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"); + } + }, -exportPlugins((module.exports.web = {}), { - FetchCompileWasmPlugin: () => require("./web/FetchCompileWasmPlugin"), - JsonpTemplatePlugin: () => require("./web/JsonpTemplatePlugin") -}); + web: { + get FetchCompileWasmPlugin() { + return require("./web/FetchCompileWasmPlugin"); + }, + get JsonpTemplatePlugin() { + return require("./web/JsonpTemplatePlugin"); + } + }, -exportPlugins((module.exports.webworker = {}), { - WebWorkerTemplatePlugin: () => require("./webworker/WebWorkerTemplatePlugin") -}); + webworker: { + get WebWorkerTemplatePlugin() { + return require("./webworker/WebWorkerTemplatePlugin"); + } + }, -exportPlugins((module.exports.node = {}), { - NodeEnvironmentPlugin: () => require("./node/NodeEnvironmentPlugin"), - NodeTemplatePlugin: () => require("./node/NodeTemplatePlugin"), - ReadFileCompileWasmPlugin: () => require("./node/ReadFileCompileWasmPlugin") -}); + node: { + get NodeEnvironmentPlugin() { + return require("./node/NodeEnvironmentPlugin"); + }, + get NodeTemplatePlugin() { + return require("./node/NodeTemplatePlugin"); + }, + get ReadFileCompileWasmPlugin() { + return require("./node/ReadFileCompileWasmPlugin"); + } + }, -exportPlugins((module.exports.wasm = {}), { - AsyncWebAssemblyModulesPlugin: () => - require("./wasm-async/AsyncWebAssemblyModulesPlugin") -}); + wasm: { + get AsyncWebAssemblyModulesPlugin() { + return require("./wasm-async/AsyncWebAssemblyModulesPlugin"); + } + }, -exportPlugins((module.exports.library = {}), { - AbstractLibraryPlugin: () => require("./library/AbstractLibraryPlugin"), - EnableLibraryPlugin: () => require("./library/EnableLibraryPlugin") -}); + library: { + get AbstractLibraryPlugin() { + return require("./library/AbstractLibraryPlugin"); + }, + get EnableLibraryPlugin() { + return require("./library/EnableLibraryPlugin"); + } + }, -exportPlugins((module.exports.debug = {}), { - ProfilingPlugin: () => require("./debug/ProfilingPlugin") -}); + debug: { + get ProfilingPlugin() { + return require("./debug/ProfilingPlugin"); + } + }, -exportPlugins((module.exports.util = {}), { - createHash: () => require("./util/createHash"), - comparators: () => require("./util/comparators"), - serialization: () => require("./util/serialization") + util: { + get createHash() { + return require("./util/createHash"); + }, + get comparators() { + return require("./util/comparators"); + }, + get serialization() { + return require("./util/serialization"); + } + } }); 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/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/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/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/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/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) { 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/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"; } 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(); 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/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/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/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/package.json b/package.json index 6bcb14eeb..690df407c 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", @@ -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#v1.2.0", "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 typings-lint && yarn pretty-lint && yarn spellcheck", "code-lint": "eslint . --ext '.js' --cache", - "type-lint": "tsc --pretty", + "type-lint": "tsc", + "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 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..23da9837d 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, @@ -1248,7 +1248,8 @@ "enum": ["initial", "async", "all"] }, { - "$ref": "#/definitions/OptimizationSplitChunksGetCacheGroups" + "instanceof": "Function", + "tsType": "((chunk: import('../lib/Chunk')) => boolean)" } ] }, @@ -1459,7 +1460,7 @@ }, { "instanceof": "Function", - "tsType": "Function" + "tsType": "((chunk: import('../lib/Chunk')) => boolean)" } ] }, @@ -2572,7 +2573,7 @@ }, { "instanceof": "Function", - "tsType": "((data: object) => RuleSetUseItem[])" + "tsType": "((data: { resource: string, realResource: string, resourceQuery: string, issuer: string, compiler: string }) => RuleSetUseItem[])" }, { "$ref": "#/definitions/RuleSetUseItem" @@ -2626,28 +2627,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 +2923,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 +3046,7 @@ "$ref": "#/definitions/Bail" }, "cache": { - "$ref": "#/definitions/CacheNormalized" + "$ref": "#/definitions/CacheOptionsNormalized" }, "context": { "$ref": "#/definitions/Context" @@ -3081,7 +3082,7 @@ "$ref": "#/definitions/Mode" }, "module": { - "$ref": "#/definitions/Module" + "$ref": "#/definitions/ModuleOptions" }, "name": { "$ref": "#/definitions/Name" @@ -3120,7 +3121,7 @@ "$ref": "#/definitions/ResolveLoader" }, "stats": { - "$ref": "#/definitions/Stats" + "$ref": "#/definitions/StatsValue" }, "target": { "$ref": "#/definitions/Target" @@ -3179,7 +3180,7 @@ "$ref": "#/definitions/Bail" }, "cache": { - "$ref": "#/definitions/Cache" + "$ref": "#/definitions/CacheOptions" }, "context": { "$ref": "#/definitions/Context" @@ -3215,7 +3216,7 @@ "$ref": "#/definitions/Mode" }, "module": { - "$ref": "#/definitions/Module" + "$ref": "#/definitions/ModuleOptions" }, "name": { "$ref": "#/definitions/Name" @@ -3257,7 +3258,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/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/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/__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/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 33cb85d7c..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("../../../../lib/NormalModule"); +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 625dccf25..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("../../../../lib/Compilation")} Compilation */ -/** @typedef {import("../../../../lib/Module")} Module */ +/** @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/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/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-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/custom-source-type/localization/webpack.config.js b/test/configCases/custom-source-type/localization/webpack.config.js index b853c09f7..de405aa31 100644 --- a/test/configCases/custom-source-type/localization/webpack.config.js +++ b/test/configCases/custom-source-type/localization/webpack.config.js @@ -5,12 +5,20 @@ const RuntimeGlobals = require("../../../../").RuntimeGlobals; const Parser = require("../../../../").Parser; const webpack = require("../../../../"); -/** @typedef {import("../../../../lib/Compiler")} Compiler */ +/** @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 59c95f6e3..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("../../../../lib/Compilation")} Compilation */ +/** @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 973fbcdc6..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("../../../../lib/Compilation")} Compilation */ +/** @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/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..b9df69a0f --- /dev/null +++ b/test/configCases/deprecations/chunk-and-module/webpack.config.js @@ -0,0 +1,63 @@ +const { ChunkGraph, ExternalModule } = require("../../../../"); +/** @type {import("../../../../").Configuration} */ +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( + typeof m.usedExports === "boolean" ? [] : [...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); + } + }); + } + ] +}; 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..9ce909941 --- /dev/null +++ b/test/configCases/deprecations/chunk-files/webpack.config.js @@ -0,0 +1,20 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + plugins: [ + compiler => { + compiler.hooks.done.tap("Test", ({ compilation }) => { + 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(",")); + 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"); + } + }); + } + ] +}; 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 6f304e92c..0bb6c323e 100644 --- a/test/configCases/entry/depend-on-advanced/webpack.config.js +++ b/test/configCases/entry/depend-on-advanced/webpack.config.js @@ -1,3 +1,9 @@ +/** @typedef {import("../../../../").Compiler} Compiler */ +/** @typedef {import("../../../../").Compilation} Compilation */ +/** @typedef {import("../../../../").Configuration} Configuration */ + +/** @type {Configuration} */ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return Promise.resolve({ @@ -15,6 +21,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..157f6ce2a 100644 --- a/test/configCases/entry/depend-on-simple/webpack.config.js +++ b/test/configCases/entry/depend-on-simple/webpack.config.js @@ -1,3 +1,7 @@ +/** @typedef {import("../../../../").Compiler} Compiler */ +/** @typedef {import("../../../../").Compilation} Compilation */ + +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { app: { import: "./app.js", dependOn: "react-vendors" }, @@ -8,6 +12,9 @@ module.exports = { filename: "[name].js" }, plugins: [ + /** + * @this {Compiler} compiler + */ function () { /** * @param {Compilation} compilation compilation 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-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/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 1da810870..af4d4907f 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 ( @@ -9,6 +12,7 @@ var testPlugin = function () { }); }; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [testPlugin] }; 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 f7130eec7..1947fa3f3 100644 --- a/test/configCases/hash-length/output-filename/webpack.config.js +++ b/test/configCases/hash-length/output-filename/webpack.config.js @@ -1,4 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration[]} */ +/** @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/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/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/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/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/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/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/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()] +}; 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 100986ba0..e15c2ba44 100644 --- a/test/configCases/optimization/minimizer/webpack.config.js +++ b/test/configCases/optimization/minimizer/webpack.config.js @@ -1,14 +1,22 @@ const Compiler = require("../../../../").Compiler; +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { 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/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/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/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/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/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/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: { 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/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/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/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/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-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/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/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..5a23d98af --- /dev/null +++ b/test/configCases/utils/lazy-set/webpack.config.js @@ -0,0 +1,24 @@ +/** @type {import("../../../../").Configuration} */ +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]))); + }); + } + ] +}; 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..63567a475 --- /dev/null +++ b/test/configCases/wasm/export-imported-global/webpack.config.js @@ -0,0 +1,16 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + entry: "./index", + module: { + rules: [ + { + test: /\.wat$/, + loader: "wast-loader", + type: "webassembly/sync" + } + ] + }, + experiments: { + syncWebAssembly: true + } +}; diff --git a/test/configCases/wasm/identical/webpack.config.js b/test/configCases/wasm/identical/webpack.config.js index 3901206b1..1e48ea814 100644 --- a/test/configCases/wasm/identical/webpack.config.js +++ b/test/configCases/wasm/identical/webpack.config.js @@ -1,8 +1,9 @@ const { CachedSource } = require("webpack-sources"); const { AsyncWebAssemblyModulesPlugin } = require("../../../../").wasm; -/** @typedef {import("../../../../lib/Compilation")} Compilation */ +/** @typedef {import("../../../../").Compiler} Compiler */ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ @@ -18,22 +19,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/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..63567a475 --- /dev/null +++ b/test/configCases/wasm/import-wasm-wasm/webpack.config.js @@ -0,0 +1,16 @@ +/** @type {import("../../../../").Configuration} */ +module.exports = { + entry: "./index", + module: { + rules: [ + { + test: /\.wat$/, + loader: "wast-loader", + type: "webassembly/sync" + } + ] + }, + experiments: { + syncWebAssembly: true + } +}; 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/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"]); 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-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/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-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/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/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/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/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/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/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/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/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/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-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/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-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/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-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/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-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/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/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/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-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-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/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/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/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/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/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/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..23a3c6e6f --- /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", "declarations.test.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..f75e23705 --- /dev/null +++ b/types.d.ts @@ -0,0 +1,7457 @@ +/** + * 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 class AbstractLibraryPlugin { + constructor(__0: { + /** + * name of the plugin + */ + pluginName: string; + /** + * used library type + */ + type: ExternalsType; + }); + + /** + * Apply the plugin + */ + 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; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +declare class AggressiveSplittingPlugin { + constructor(options?: AggressiveSplittingPluginOptions); + options: AggressiveSplittingPluginOptions; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; + static wasChunkRecorded(chunk: Chunk): boolean; +} + +/** + * 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; + + /** + * 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; +} +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; + + /** + * source of the asset + */ + source: Source; + + /** + * 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 + | ((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; + }>; + 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: Chunk): boolean; + + /** + * inserts a chunk before another existing chunk in group + */ + insertChunk(chunk: Chunk, before: Chunk): boolean; + + /** + * 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< + [ + Dependency, + { name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + > + ], + void + >; + failedEntry: SyncHook< + [ + Dependency, + { name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >, + Error + ], + void + >; + succeedEntry: SyncHook< + [ + Dependency, + { name: string } & Pick< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >, + Module + ], + void + >; + 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; + + /** + * 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): 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; + + /** + * Fetches a module from a compilation by its identifier + */ + getModule(module: Module): Module; + + /** + * Attempts to search for a module by its identifier + */ + 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< + EntryDescriptionNormalized, + "filename" | "dependOn" | "library" + >), + 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; + + /** + * 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): 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 }; + + /** + * 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; +} + +/** + * 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; + + /** + * 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?: CacheOptions; + + /** + * 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). + */ + 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; + + /** + * 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 DeterministicChunkIdsPlugin { + constructor(options?: any); + options: any; + + /** + * Apply the plugin + */ + apply(compiler: Compiler): void; +} +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; + /** + * 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: 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 = + | { + /** + * 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; + }; + 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: { + /** + * 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: 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: ChunkGraph; + /** + * the module + */ + module: 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: 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, + callback?: CallbackWebpack +): Compiler; +declare function exports( + options: Array, + callback?: CallbackWebpack +): MultiCompiler; +declare namespace exports { + 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: string; + 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; + 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 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 overrides: 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 const WebpackOptionsValidationError: ValidationError; + export const ValidationError: ValidationError; + export namespace cache { + export { MemoryCachePlugin }; + } + export namespace config { + export const getNormalizedWebpackOptions: ( + config: Configuration + ) => WebpackOptionsNormalized; + export const applyWebpackOptionsDefaults: ( + options: WebpackOptionsNormalized + ) => void; + } + export namespace ids { + export { + ChunkModuleIdRangePlugin, + NaturalModuleIdsPlugin, + OccurrenceModuleIdsPlugin, + NamedModuleIdsPlugin, + DeterministicChunkIdsPlugin, + DeterministicModuleIdsPlugin, + NamedChunkIdsPlugin, + OccurrenceChunkIdsPlugin, + HashedModuleIdsPlugin + }; + } + export namespace javascript { + export { JavascriptModulesPlugin }; + } + export namespace optimize { + export { + AggressiveMergingPlugin, + AggressiveSplittingPlugin, + LimitChunkCountPlugin, + MinChunkSizePlugin, + ModuleConcatenationPlugin, + RuntimeChunkPlugin, + SideEffectsFlagPlugin, + SplitChunksPlugin + }; + } + export namespace web { + export { FetchCompileWasmPlugin, JsonpTemplatePlugin }; + } + export namespace webworker { + export { WebWorkerTemplatePlugin }; + } + export namespace node { + export { + NodeEnvironmentPlugin, + NodeTemplatePlugin, + ReadFileCompileWasmPlugin + }; + } + export namespace wasm { + export { AsyncWebAssemblyModulesPlugin }; + } + export namespace library { + export { AbstractLibraryPlugin, EnableLibraryPlugin }; + } + export namespace debug { + export { ProfilingPlugin }; + } + 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 = exports; diff --git a/yarn.lock b/yarn.lock index 08ca6e364..ee5bf1e92 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" @@ -447,10 +448,10 @@ "@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== +"@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== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^1.1.1" @@ -551,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" @@ -569,9 +578,14 @@ 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/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" @@ -1095,16 +1109,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 +1144,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 +1167,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: @@ -1621,10 +1635,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" @@ -1773,10 +1787,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 +1934,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 +1992,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" @@ -2198,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== @@ -2568,7 +2583,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 +2599,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" @@ -2602,16 +2632,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: @@ -2944,10 +2974,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" @@ -3648,67 +3678,77 @@ 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: - version "25.3.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.3.0.tgz#0d7d6f5d6171e5dacde9e05be47b3615e147c26f" - integrity sha512-vyvs6RPoVdiwARwY4kqFWd4PirPLm2dmmkNzKqo38uZOzJvLee87yzDjIZLmY1SjM3XR5DwsUH+cdQ12vgqi1w== +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" + integrity sha512-kklLbJVXW0y8UKOWOdYhI6TH5MG6QAxrWiBMgQaPIuhj3dNFGirKCd+/xfplBXICQ7fI+3QcqHm9p9lWu1N6ug== dependencies: chalk "^3.0.0" diff-sequences "^25.2.6" jest-get-type "^25.2.6" - pretty-format "^25.3.0" + pretty-format "^25.4.0" jest-docblock@^25.3.0: version "25.3.0" @@ -3717,39 +3757,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: @@ -3757,23 +3797,23 @@ 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== -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" @@ -3781,27 +3821,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: @@ -3815,43 +3855,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" @@ -3863,78 +3903,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" @@ -3945,32 +3987,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" @@ -3987,28 +4029,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: @@ -4019,22 +4061,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" @@ -4132,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== @@ -4296,16 +4338,16 @@ 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.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" @@ -4382,6 +4424,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" @@ -4895,7 +4946,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== @@ -5401,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" @@ -5411,12 +5472,12 @@ 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== +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== dependencies: - "@jest/types" "^25.3.0" + "@jest/types" "^25.4.0" ansi-regex "^5.0.0" ansi-styles "^4.0.0" react-is "^16.12.0" @@ -5653,16 +5714,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" @@ -5680,6 +5736,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" @@ -5689,6 +5754,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" @@ -6008,9 +6083,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" @@ -6441,12 +6516,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" @@ -6690,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#v1.2.0: + version "1.0.0" + resolved "https://codeload.github.com/webpack/tooling/tar.gz/aafba4458d969ae360c1d2d30d0a132f5c0815d8" + 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" @@ -6784,6 +6869,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" @@ -6929,10 +7019,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"