diff --git a/declarations.test.d.ts b/declarations.test.d.ts new file mode 100644 index 000000000..68aa7f449 --- /dev/null +++ b/declarations.test.d.ts @@ -0,0 +1,18 @@ +declare module "*.json"; + +declare namespace jest { + interface Matchers { + toBeTypeOf: ( + expected: + | "string" + | "number" + | "bigint" + | "boolean" + | "symbol" + | "undefined" + | "object" + | "function" + ) => void; + toEndWith: (expected: string) => void; + } +} diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index ee4bfdd40..146fcdc8e 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -242,7 +242,13 @@ export type RuleSetLoaderOptions = */ export type RuleSetUse = | RuleSetUseItem[] - | ((data: object) => RuleSetUseItem[]) + | ((data: { + resource: string; + realResource: string; + resourceQuery: string; + issuer: string; + compiler: string; + }) => RuleSetUseItem[]) | RuleSetUseItem; /** * A description of an applied loader. diff --git a/lib/index.js b/lib/index.js index 9185a72b6..8577bd0b4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,23 +5,78 @@ "use strict"; -const validate = require("schema-utils"); const util = require("util"); -const { version } = require("../package.json"); -const webpackOptionsSchema = require("../schemas/WebpackOptions.json"); -const WebpackOptionsApply = require("./WebpackOptionsApply"); const memorize = require("./util/memorize"); -const validateSchema = require("./validateSchema"); -const webpack = require("./webpack"); /** @typedef {import("../declarations/WebpackOptions").WebpackOptions} Configuration */ +/** @typedef {import("../declarations/WebpackOptions").WebpackPluginFunction} WebpackPluginFunction */ +/** @typedef {import("../declarations/WebpackOptions").WebpackPluginInstance} WebpackPluginInstance */ +/** @typedef {import("./Parser").ParserState} ParserState */ -module.exports = Object.assign(webpack, { - webpack, - WebpackOptionsApply, - validate: validateSchema.bind(null, webpackOptionsSchema), - validateSchema, - version, +/** + * @template {Function} T + * @param {function(): T} factory factory function + * @returns {T} function + */ +const lazyFunction = factory => { + const fac = memorize(factory); + const f = /** @type {any} */ ((...args) => { + return fac()(...args); + }); + return /** @type {T} */ (f); +}; + +/** + * @template A + * @template B + * @param {A} obj input a + * @param {B} exports input b + * @returns {A & B} merged + */ +const mergeExports = (obj, exports) => { + const descriptors = Object.getOwnPropertyDescriptors(exports); + for (const name of Object.keys(descriptors)) { + const descriptor = descriptors[name]; + if (descriptor.get) { + const fn = descriptor.get; + Object.defineProperty(obj, name, { + configurable: false, + enumerable: true, + get: memorize(fn) + }); + } else if (typeof descriptor.value === "object") { + Object.defineProperty(obj, name, { + configurable: false, + enumerable: true, + writable: false, + value: mergeExports({}, descriptor.value) + }); + } else { + throw new Error( + "Exposed values must be either a getter or an nested object" + ); + } + } + return /** @type {A & B} */ (Object.freeze(obj)); +}; + +const fn = lazyFunction(() => require("./webpack")); +module.exports = mergeExports(fn, { + get webpack() { + return require("./webpack"); + }, + get validate() { + const validateSchema = require("./validateSchema"); + const webpackOptionsSchema = require("../schemas/WebpackOptions.json"); + return validateSchema.bind(null, webpackOptionsSchema); + }, + get validateSchema() { + const validateSchema = require("./validateSchema"); + return validateSchema; + }, + get version() { + return require("../package.json").version; + }, get cli() { return require("./cli"); @@ -35,6 +90,12 @@ module.exports = Object.assign(webpack, { get Cache() { return require("./Cache"); }, + get Chunk() { + return require("./Chunk"); + }, + get ChunkGraph() { + return require("./ChunkGraph"); + }, get Compilation() { return require("./Compilation"); }, @@ -74,6 +135,9 @@ module.exports = Object.assign(webpack, { get EvalSourceMapDevToolPlugin() { return require("./EvalSourceMapDevToolPlugin"); }, + get ExternalModule() { + return require("./ExternalModule"); + }, get ExternalsPlugin() { return require("./ExternalsPlugin"); }, @@ -115,6 +179,9 @@ module.exports = Object.assign(webpack, { get ModuleFilenameHelpers() { return require("./ModuleFilenameHelpers"); }, + get ModuleGraph() { + return require("./ModuleGraph"); + }, get NoEmitOnErrorsPlugin() { return require("./NoEmitOnErrorsPlugin"); }, @@ -164,6 +231,9 @@ module.exports = Object.assign(webpack, { get WatchIgnorePlugin() { return require("./WatchIgnorePlugin"); }, + get WebpackOptionsApply() { + return require("./WebpackOptionsApply"); + }, get WebpackOptionsDefaulter() { return util.deprecate( () => require("./WebpackOptionsDefaulter"), @@ -173,10 +243,10 @@ module.exports = Object.assign(webpack, { }, // TODO webpack 6 deprecate get WebpackOptionsValidationError() { - return validate.ValidationError; + return require("schema-utils").ValidationError; }, get ValidationError() { - return validate.ValidationError; + return require("schema-utils").ValidationError; }, cache: { @@ -318,23 +388,3 @@ module.exports = Object.assign(webpack, { } } }); - -const finishExports = obj => { - const descriptors = Object.getOwnPropertyDescriptors(obj); - for (const name of Object.keys(descriptors)) { - const descriptor = descriptors[name]; - if (descriptor.get) { - const fn = descriptor.get; - Object.defineProperty(obj, name, { - configurable: false, - enumerable: true, - get: memorize(fn) - }); - } else if (typeof descriptor.value === "object") { - finishExports(descriptor.value); - } - } - Object.freeze(obj); -}; - -finishExports(module.exports); diff --git a/package.json b/package.json index abe73b2fb..c95660694 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "strip-ansi": "^6.0.0", "style-loader": "^1.0.0", "toml": "^3.0.0", - "tooling": "webpack/tooling", + "tooling": "webpack/tooling#v1.0.0", "ts-loader": "^6.0.4", "typescript": "^3.6.4", "url-loader": "^2.1.0", @@ -131,10 +131,10 @@ "type-report": "rimraf coverage && yarn cover:types && yarn cover:report && open-cli coverage/lcov-report/index.html", "pretest": "yarn lint", "prelint": "yarn setup", - "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn pretty-lint && yarn spellcheck", + "lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-lint && yarn pretty-lint && yarn spellcheck", "code-lint": "eslint . --ext '.js' --cache", "type-lint": "tsc", - "test:types": "tsc -p tsconfig.test.json", + "typings-lint": "tsc -p tsconfig.test.json", "spellcheck": "cspell \"{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}\" \"*.md\"", "special-lint": "node node_modules/tooling/lockfile-lint && node node_modules/tooling/schemas-lint && node node_modules/tooling/inherit-types && node node_modules/tooling/format-schemas && node node_modules/tooling/format-file-header && node node_modules/tooling/compile-to-definitions && node node_modules/tooling/generate-types", "special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/generate-types --write", diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 9f6dfcb0d..4a22e03d9 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -2572,7 +2572,7 @@ }, { "instanceof": "Function", - "tsType": "((data: object) => RuleSetUseItem[])" + "tsType": "((data: { resource: string, realResource: string, resourceQuery: string, issuer: string, compiler: string }) => RuleSetUseItem[])" }, { "$ref": "#/definitions/RuleSetUseItem" diff --git a/test/benchmarkCases/large-ast/webpack.config.js b/test/benchmarkCases/large-ast/webpack.config.js index d0c9ec47c..306cc71d9 100644 --- a/test/benchmarkCases/large-ast/webpack.config.js +++ b/test/benchmarkCases/large-ast/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: ["./index", "./index2"] }; diff --git a/test/benchmarkCases/libraries/webpack.config.js b/test/benchmarkCases/libraries/webpack.config.js index 7c4ed5c64..48485fde0 100644 --- a/test/benchmarkCases/libraries/webpack.config.js +++ b/test/benchmarkCases/libraries/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: ["react", "react-dom", "lodash"] }; diff --git a/test/benchmarkCases/many-chunks/webpack.config.js b/test/benchmarkCases/many-chunks/webpack.config.js index 8c31ec4d7..4c111be6a 100644 --- a/test/benchmarkCases/many-chunks/webpack.config.js +++ b/test/benchmarkCases/many-chunks/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: "./index" }; diff --git a/test/benchmarkCases/many-modules-source-map/webpack.config.js b/test/benchmarkCases/many-modules-source-map/webpack.config.js index a61015f48..3f433b473 100644 --- a/test/benchmarkCases/many-modules-source-map/webpack.config.js +++ b/test/benchmarkCases/many-modules-source-map/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: "./index", devtool: "eval-cheap-module-source-map" diff --git a/test/benchmarkCases/many-modules/webpack.config.js b/test/benchmarkCases/many-modules/webpack.config.js index 8c31ec4d7..4c111be6a 100644 --- a/test/benchmarkCases/many-modules/webpack.config.js +++ b/test/benchmarkCases/many-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { entry: "./index" }; diff --git a/test/configCases/additional-pass/simple/webpack.config.js b/test/configCases/additional-pass/simple/webpack.config.js index 4cd7ee753..36318c9ba 100644 --- a/test/configCases/additional-pass/simple/webpack.config.js +++ b/test/configCases/additional-pass/simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").WebpackPluginFunction} */ var testPlugin = function () { var counter = 1; this.hooks.compilation.tap("TestPlugin", compilation => { @@ -8,6 +9,7 @@ var testPlugin = function () { }); }; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [testPlugin] }; diff --git a/test/configCases/amd/disabled/webpack.config.js b/test/configCases/amd/disabled/webpack.config.js index 33fa3a5fb..d28e3ce5a 100644 --- a/test/configCases/amd/disabled/webpack.config.js +++ b/test/configCases/amd/disabled/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { amd: false }; diff --git a/test/configCases/asset-emitted/normal/webpack.config.js b/test/configCases/asset-emitted/normal/webpack.config.js index ad122d5e3..63eaa7b5d 100644 --- a/test/configCases/asset-emitted/normal/webpack.config.js +++ b/test/configCases/asset-emitted/normal/webpack.config.js @@ -1,6 +1,7 @@ const Compilation = require("../../../../").Compilation; const Source = require("webpack-sources").Source; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ compiler => { diff --git a/test/configCases/asset-modules/assetModuleFilename/webpack.config.js b/test/configCases/asset-modules/assetModuleFilename/webpack.config.js index 00907ffa6..99baa04d7 100644 --- a/test/configCases/asset-modules/assetModuleFilename/webpack.config.js +++ b/test/configCases/asset-modules/assetModuleFilename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/asset-modules/custom-condition/webpack.config.js b/test/configCases/asset-modules/custom-condition/webpack.config.js index 58310ed1b..bb0895768 100644 --- a/test/configCases/asset-modules/custom-condition/webpack.config.js +++ b/test/configCases/asset-modules/custom-condition/webpack.config.js @@ -1,6 +1,7 @@ const path = require("path"); const NormalModule = require("../../../../").NormalModule; +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/custom-encoder/webpack.config.js b/test/configCases/asset-modules/custom-encoder/webpack.config.js index 9529813f2..86ac26b83 100644 --- a/test/configCases/asset-modules/custom-encoder/webpack.config.js +++ b/test/configCases/asset-modules/custom-encoder/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/data-url/webpack.config.js b/test/configCases/asset-modules/data-url/webpack.config.js index 28a3e882a..de87d5817 100644 --- a/test/configCases/asset-modules/data-url/webpack.config.js +++ b/test/configCases/asset-modules/data-url/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/file-loader/webpack.config.js b/test/configCases/asset-modules/file-loader/webpack.config.js index 6455cb7d9..835a3c38e 100644 --- a/test/configCases/asset-modules/file-loader/webpack.config.js +++ b/test/configCases/asset-modules/file-loader/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/opus/webpack.config.js b/test/configCases/asset-modules/opus/webpack.config.js index 8a8f3c45a..6966d01e2 100644 --- a/test/configCases/asset-modules/opus/webpack.config.js +++ b/test/configCases/asset-modules/opus/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/overridePath/webpack.config.js b/test/configCases/asset-modules/overridePath/webpack.config.js index a4cb22be2..fa4a01def 100644 --- a/test/configCases/asset-modules/overridePath/webpack.config.js +++ b/test/configCases/asset-modules/overridePath/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/asset-modules/path/webpack.config.js b/test/configCases/asset-modules/path/webpack.config.js index a09504b58..cbf6b2eba 100644 --- a/test/configCases/asset-modules/path/webpack.config.js +++ b/test/configCases/asset-modules/path/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/asset-modules/publicPath/webpack.config.js b/test/configCases/asset-modules/publicPath/webpack.config.js index d04ad5ec7..4962cb1ec 100644 --- a/test/configCases/asset-modules/publicPath/webpack.config.js +++ b/test/configCases/asset-modules/publicPath/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/asset-modules/source/webpack.config.js b/test/configCases/asset-modules/source/webpack.config.js index 8c96cd457..5a81c18d0 100644 --- a/test/configCases/asset-modules/source/webpack.config.js +++ b/test/configCases/asset-modules/source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/asset-modules/types/webpack.config.js b/test/configCases/asset-modules/types/webpack.config.js index 3fdbd70cc..b1de2ea22 100644 --- a/test/configCases/asset-modules/types/webpack.config.js +++ b/test/configCases/asset-modules/types/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/async-commons-chunk/all-selected/webpack.config.js b/test/configCases/async-commons-chunk/all-selected/webpack.config.js index fd4fbccbf..4224dbc77 100644 --- a/test/configCases/async-commons-chunk/all-selected/webpack.config.js +++ b/test/configCases/async-commons-chunk/all-selected/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { splitChunks: { diff --git a/test/configCases/async-commons-chunk/duplicate/webpack.config.js b/test/configCases/async-commons-chunk/duplicate/webpack.config.js index fd4fbccbf..4224dbc77 100644 --- a/test/configCases/async-commons-chunk/duplicate/webpack.config.js +++ b/test/configCases/async-commons-chunk/duplicate/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { splitChunks: { diff --git a/test/configCases/async-commons-chunk/existing-name/webpack.config.js b/test/configCases/async-commons-chunk/existing-name/webpack.config.js index 79f659d52..bf5d082bf 100644 --- a/test/configCases/async-commons-chunk/existing-name/webpack.config.js +++ b/test/configCases/async-commons-chunk/existing-name/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { performance: { hints: false diff --git a/test/configCases/async-commons-chunk/nested/webpack.config.js b/test/configCases/async-commons-chunk/nested/webpack.config.js index fd4fbccbf..4224dbc77 100644 --- a/test/configCases/async-commons-chunk/nested/webpack.config.js +++ b/test/configCases/async-commons-chunk/nested/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { splitChunks: { diff --git a/test/configCases/async-commons-chunk/node/webpack.config.js b/test/configCases/async-commons-chunk/node/webpack.config.js index 8de27bd03..d25903acd 100644 --- a/test/configCases/async-commons-chunk/node/webpack.config.js +++ b/test/configCases/async-commons-chunk/node/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "none", entry: { diff --git a/test/configCases/async-commons-chunk/simple/webpack.config.js b/test/configCases/async-commons-chunk/simple/webpack.config.js index fd4fbccbf..4224dbc77 100644 --- a/test/configCases/async-commons-chunk/simple/webpack.config.js +++ b/test/configCases/async-commons-chunk/simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { splitChunks: { diff --git a/test/configCases/chunk-graph/issue-9634/webpack.config.js b/test/configCases/chunk-graph/issue-9634/webpack.config.js index db3b667a0..42a875cba 100644 --- a/test/configCases/chunk-graph/issue-9634/webpack.config.js +++ b/test/configCases/chunk-graph/issue-9634/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { b: "./entry-b", diff --git a/test/configCases/chunk-index/order-multiple-entries/webpack.config.js b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js index b0dc1d869..1a27301af 100644 --- a/test/configCases/chunk-index/order-multiple-entries/webpack.config.js +++ b/test/configCases/chunk-index/order-multiple-entries/webpack.config.js @@ -1,6 +1,7 @@ /** @typedef {import("../../../../").Compilation} Compilation */ /** @typedef {import("../../../../").Module} Module */ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { entry1: "./entry1", @@ -22,6 +23,7 @@ module.exports = { for (const [name, group] of compilation.namedChunkGroups) { /** @type {Map} */ const modules = new Map(); + /** @type {Map} */ const modules2 = new Map(); for (const chunk of group.chunks) { for (const module of compilation.chunkGraph.getChunkModulesIterable( @@ -75,7 +77,13 @@ module.exports = { asyncIndex2: "0: ./async.js" }); const indices = Array.from(compilation.modules) - .map(m => [moduleGraph.getPreOrderIndex(m), m]) + .map( + m => + /** @type {[number, Module]} */ ([ + moduleGraph.getPreOrderIndex(m), + m + ]) + ) .filter(p => typeof p[0] === "number") .sort((a, b) => a[0] - b[0]) .map( @@ -84,7 +92,13 @@ module.exports = { ) .join(", "); const indices2 = Array.from(compilation.modules) - .map(m => [moduleGraph.getPostOrderIndex(m), m]) + .map( + m => + /** @type {[number, Module]} */ ([ + moduleGraph.getPostOrderIndex(m), + m + ]) + ) .filter(p => typeof p[0] === "number") .sort((a, b) => a[0] - b[0]) .map( diff --git a/test/configCases/code-generation/harmony-pure-default/webpack.config.js b/test/configCases/code-generation/harmony-pure-default/webpack.config.js index 94fea42dc..2ec858900 100644 --- a/test/configCases/code-generation/harmony-pure-default/webpack.config.js +++ b/test/configCases/code-generation/harmony-pure-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/configCases/code-generation/require-context-id/webpack.config.js b/test/configCases/code-generation/require-context-id/webpack.config.js index 80e9e2199..e3f2e0b3b 100644 --- a/test/configCases/code-generation/require-context-id/webpack.config.js +++ b/test/configCases/code-generation/require-context-id/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "hashed" diff --git a/test/configCases/code-generation/use-strict/webpack.config.js b/test/configCases/code-generation/use-strict/webpack.config.js index 430664cf3..877d7411e 100644 --- a/test/configCases/code-generation/use-strict/webpack.config.js +++ b/test/configCases/code-generation/use-strict/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/compiletime/error-not-found/webpack.config.js b/test/configCases/compiletime/error-not-found/webpack.config.js index 4b24c0e9f..e3128523e 100644 --- a/test/configCases/compiletime/error-not-found/webpack.config.js +++ b/test/configCases/compiletime/error-not-found/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictExportPresence: true diff --git a/test/configCases/concatenate-modules/load-chunk-function/webpack.config.js b/test/configCases/concatenate-modules/load-chunk-function/webpack.config.js index 97c8c7496..1a64af2a3 100644 --- a/test/configCases/concatenate-modules/load-chunk-function/webpack.config.js +++ b/test/configCases/concatenate-modules/load-chunk-function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { entry1: "./entry1", diff --git a/test/configCases/concatenate-modules/rename-10168/webpack.config.js b/test/configCases/concatenate-modules/rename-10168/webpack.config.js index 59e948b12..c939ba33f 100644 --- a/test/configCases/concatenate-modules/rename-10168/webpack.config.js +++ b/test/configCases/concatenate-modules/rename-10168/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { concatenateModules: true diff --git a/test/configCases/concatenate-modules/split-chunk-entry-module/webpack.config.js b/test/configCases/concatenate-modules/split-chunk-entry-module/webpack.config.js index b9c7c5310..16ed8a8d8 100644 --- a/test/configCases/concatenate-modules/split-chunk-entry-module/webpack.config.js +++ b/test/configCases/concatenate-modules/split-chunk-entry-module/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index" diff --git a/test/configCases/context-exclusion/simple/webpack.config.js b/test/configCases/context-exclusion/simple/webpack.config.js index 914088d01..355aaf856 100644 --- a/test/configCases/context-exclusion/simple/webpack.config.js +++ b/test/configCases/context-exclusion/simple/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [new webpack.ContextExclusionPlugin(/dont/)] }; diff --git a/test/configCases/context-replacement/System.import/webpack.config.js b/test/configCases/context-replacement/System.import/webpack.config.js index dd3a95923..3b5569bcc 100644 --- a/test/configCases/context-replacement/System.import/webpack.config.js +++ b/test/configCases/context-replacement/System.import/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.ContextReplacementPlugin( diff --git a/test/configCases/context-replacement/a/webpack.config.js b/test/configCases/context-replacement/a/webpack.config.js index effb49f41..49a7297f2 100644 --- a/test/configCases/context-replacement/a/webpack.config.js +++ b/test/configCases/context-replacement/a/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.ContextReplacementPlugin( diff --git a/test/configCases/context-replacement/b/webpack.config.js b/test/configCases/context-replacement/b/webpack.config.js index 90555063f..9c04b12f3 100644 --- a/test/configCases/context-replacement/b/webpack.config.js +++ b/test/configCases/context-replacement/b/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.ContextReplacementPlugin(/context-replacement.b$/, /^\.\/only/) diff --git a/test/configCases/context-replacement/c/webpack.config.js b/test/configCases/context-replacement/c/webpack.config.js index 6a7c2c314..6850f3784 100644 --- a/test/configCases/context-replacement/c/webpack.config.js +++ b/test/configCases/context-replacement/c/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.ContextReplacementPlugin( diff --git a/test/configCases/context-replacement/d/webpack.config.js b/test/configCases/context-replacement/d/webpack.config.js index 21b667c52..9710b14a8 100644 --- a/test/configCases/context-replacement/d/webpack.config.js +++ b/test/configCases/context-replacement/d/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/crossorigin/set-crossorigin/webpack.config.js b/test/configCases/crossorigin/set-crossorigin/webpack.config.js index 68eeb96a5..f76ae2a4f 100644 --- a/test/configCases/crossorigin/set-crossorigin/webpack.config.js +++ b/test/configCases/crossorigin/set-crossorigin/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/custom-source-type/localization/webpack.config.js b/test/configCases/custom-source-type/localization/webpack.config.js index cc2718da7..de405aa31 100644 --- a/test/configCases/custom-source-type/localization/webpack.config.js +++ b/test/configCases/custom-source-type/localization/webpack.config.js @@ -6,11 +6,19 @@ const Parser = require("../../../../").Parser; const webpack = require("../../../../"); /** @typedef {import("../../../../").Compiler} Compiler */ +/** @typedef {import("../../../../").ParserState} ParserState */ class LocalizationParser extends Parser { - parse(source, { module }) { + /** + * @param {string | Buffer | Record} source input source + * @param {ParserState} state state + * @returns {ParserState} state + */ + parse(source, state) { + if (typeof source !== "string") throw new Error("Unexpected input"); + const { module } = state; module.buildInfo.content = JSON.parse(source); - return true; + return state; } } diff --git a/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js b/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js index 7255f049c..8d73a4314 100644 --- a/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js +++ b/test/configCases/deep-scope-analysis/remove-export-scope-hoisting/webpack.config.js @@ -1,5 +1,6 @@ /** @typedef {import("../../../../").Compilation} Compilation */ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { usedExports: true, diff --git a/test/configCases/deep-scope-analysis/remove-export/webpack.config.js b/test/configCases/deep-scope-analysis/remove-export/webpack.config.js index b47212d58..13509d7e8 100644 --- a/test/configCases/deep-scope-analysis/remove-export/webpack.config.js +++ b/test/configCases/deep-scope-analysis/remove-export/webpack.config.js @@ -1,5 +1,6 @@ /** @typedef {import("../../../../").Compilation} Compilation */ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { usedExports: true, diff --git a/test/configCases/defaulter/immutable-config/webpack.config.js b/test/configCases/defaulter/immutable-config/webpack.config.js index ede6057b0..6d3016604 100644 --- a/test/configCases/defaulter/immutable-config/webpack.config.js +++ b/test/configCases/defaulter/immutable-config/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { resolve: Object.freeze({}) // this fails to compile when the object is not cloned diff --git a/test/configCases/delegated-hash/simple/webpack.config.js b/test/configCases/delegated-hash/simple/webpack.config.js index 9efb736a0..ed0e52f8a 100644 --- a/test/configCases/delegated-hash/simple/webpack.config.js +++ b/test/configCases/delegated-hash/simple/webpack.config.js @@ -1,4 +1,5 @@ var DelegatedPlugin = require("../../../../").DelegatedPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "hashed" diff --git a/test/configCases/delegated/simple/webpack.config.js b/test/configCases/delegated/simple/webpack.config.js index 7e3861243..8a538c2f4 100644 --- a/test/configCases/delegated/simple/webpack.config.js +++ b/test/configCases/delegated/simple/webpack.config.js @@ -1,4 +1,5 @@ var DelegatedPlugin = require("../../../../").DelegatedPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new DelegatedPlugin({ diff --git a/test/configCases/deprecations/chunk-and-module/webpack.config.js b/test/configCases/deprecations/chunk-and-module/webpack.config.js index 45e183027..b9df69a0f 100644 --- a/test/configCases/deprecations/chunk-and-module/webpack.config.js +++ b/test/configCases/deprecations/chunk-and-module/webpack.config.js @@ -1,5 +1,5 @@ -const ExternalModule = require("../../../../lib/ExternalModule"); -const ChunkGraph = require("../../../../lib/ChunkGraph"); +const { ChunkGraph, ExternalModule } = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ compiler => { @@ -44,7 +44,9 @@ module.exports = { expect(m.issuer).toBe(null); m.issuer = module; expect(m.issuer).toBe(module); - expect([...m.usedExports]).toEqual(["testExport"]); + expect( + typeof m.usedExports === "boolean" ? [] : [...m.usedExports] + ).toEqual(["testExport"]); expect(m.optimizationBailout).toEqual([]); expect(m.optional).toBe(false); expect(m.isInChunk(chunk)).toBe(true); diff --git a/test/configCases/deprecations/chunk-files/webpack.config.js b/test/configCases/deprecations/chunk-files/webpack.config.js index bca499c60..9ce909941 100644 --- a/test/configCases/deprecations/chunk-files/webpack.config.js +++ b/test/configCases/deprecations/chunk-files/webpack.config.js @@ -1,8 +1,10 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ compiler => { compiler.hooks.done.tap("Test", ({ compilation }) => { - for (const chunk of compilation.chunks) { + for (const c of compilation.chunks) { + const chunk = /** @type {{ files: string[] } & import("../../../../").Chunk} */ (c); expect(chunk.files.length).toBe(chunk.files.size); expect(chunk.files[0]).toBe(Array.from(chunk.files)[0]); expect(chunk.files.join(",")).toBe(Array.from(chunk.files).join(",")); diff --git a/test/configCases/devtools/harmony-eval-source-map/webpack.config.js b/test/configCases/devtools/harmony-eval-source-map/webpack.config.js index 21e4f13b4..568d999d5 100644 --- a/test/configCases/devtools/harmony-eval-source-map/webpack.config.js +++ b/test/configCases/devtools/harmony-eval-source-map/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "eval-source-map" }; diff --git a/test/configCases/devtools/harmony-eval/webpack.config.js b/test/configCases/devtools/harmony-eval/webpack.config.js index 8c6a61a3d..4b28913b1 100644 --- a/test/configCases/devtools/harmony-eval/webpack.config.js +++ b/test/configCases/devtools/harmony-eval/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "eval" }; diff --git a/test/configCases/dll-plugin-entry/0-create-dll/webpack.config.js b/test/configCases/dll-plugin-entry/0-create-dll/webpack.config.js index 5ca9a0e6d..4c7b8f17d 100644 --- a/test/configCases/dll-plugin-entry/0-create-dll/webpack.config.js +++ b/test/configCases/dll-plugin-entry/0-create-dll/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["."], output: { diff --git a/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js b/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js index 5be05e9c9..461b1dc69 100644 --- a/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin-entry/1-use-dll/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named" diff --git a/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js b/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js index 5be05e9c9..461b1dc69 100644 --- a/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js +++ b/test/configCases/dll-plugin-entry/2-error-non-entry/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named" diff --git a/test/configCases/dll-plugin-format/0-create-dll/webpack.config.js b/test/configCases/dll-plugin-format/0-create-dll/webpack.config.js index a9739e313..12ec47dad 100644 --- a/test/configCases/dll-plugin-format/0-create-dll/webpack.config.js +++ b/test/configCases/dll-plugin-format/0-create-dll/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["."], resolve: { diff --git a/test/configCases/dll-plugin-side-effects/0-create-dll/webpack.config.js b/test/configCases/dll-plugin-side-effects/0-create-dll/webpack.config.js index e55c9f3aa..75cfeeda7 100644 --- a/test/configCases/dll-plugin-side-effects/0-create-dll/webpack.config.js +++ b/test/configCases/dll-plugin-side-effects/0-create-dll/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./index"], output: { diff --git a/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js b/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js index 8d1738807..14b447481 100644 --- a/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin-side-effects/1-use-dll/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DllReferencePlugin({ diff --git a/test/configCases/dll-plugin/0-create-dll/webpack.config.js b/test/configCases/dll-plugin/0-create-dll/webpack.config.js index eecba8898..d81c4d7c3 100644 --- a/test/configCases/dll-plugin/0-create-dll/webpack.config.js +++ b/test/configCases/dll-plugin/0-create-dll/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./a", "./b", "./_d", "./_e", "./f", "./g.abc", "./h"], resolve: { diff --git a/test/configCases/dll-plugin/0-issue-10475/webpack.config.js b/test/configCases/dll-plugin/0-issue-10475/webpack.config.js index 04ed7a06a..f02da70d8 100644 --- a/test/configCases/dll-plugin/0-issue-10475/webpack.config.js +++ b/test/configCases/dll-plugin/0-issue-10475/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./index.js"], output: { diff --git a/test/configCases/dll-plugin/1-issue-10475/webpack.config.js b/test/configCases/dll-plugin/1-issue-10475/webpack.config.js index 06546bf81..d1cf3a50e 100644 --- a/test/configCases/dll-plugin/1-issue-10475/webpack.config.js +++ b/test/configCases/dll-plugin/1-issue-10475/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DllReferencePlugin({ diff --git a/test/configCases/dll-plugin/1-use-dll/webpack.config.js b/test/configCases/dll-plugin/1-use-dll/webpack.config.js index 5cbe50f33..dc432da78 100644 --- a/test/configCases/dll-plugin/1-use-dll/webpack.config.js +++ b/test/configCases/dll-plugin/1-use-dll/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named" diff --git a/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js b/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js index 7a4dd3ee4..0f5072756 100644 --- a/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js +++ b/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js b/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js index 97edd0588..a065fa625 100644 --- a/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js +++ b/test/configCases/dll-plugin/3-use-dll-with-hashid/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/ecmaVersion/2009/webpack.config.js b/test/configCases/ecmaVersion/2009/webpack.config.js index e06a4890c..1f0ecf71c 100644 --- a/test/configCases/ecmaVersion/2009/webpack.config.js +++ b/test/configCases/ecmaVersion/2009/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 2009 diff --git a/test/configCases/ecmaVersion/2015/webpack.config.js b/test/configCases/ecmaVersion/2015/webpack.config.js index 63ea4672e..592cca00c 100644 --- a/test/configCases/ecmaVersion/2015/webpack.config.js +++ b/test/configCases/ecmaVersion/2015/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 2015 diff --git a/test/configCases/ecmaVersion/5/webpack.config.js b/test/configCases/ecmaVersion/5/webpack.config.js index 2eeb5a078..45ee727ee 100644 --- a/test/configCases/ecmaVersion/5/webpack.config.js +++ b/test/configCases/ecmaVersion/5/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 5 diff --git a/test/configCases/ecmaVersion/6/webpack.config.js b/test/configCases/ecmaVersion/6/webpack.config.js index 537a8594e..4364c0605 100644 --- a/test/configCases/ecmaVersion/6/webpack.config.js +++ b/test/configCases/ecmaVersion/6/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 6 diff --git a/test/configCases/emit-asset/different-source/webpack.config.js b/test/configCases/emit-asset/different-source/webpack.config.js index 48a8987ca..c124af721 100644 --- a/test/configCases/emit-asset/different-source/webpack.config.js +++ b/test/configCases/emit-asset/different-source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/emit-asset/equal-source/webpack.config.js b/test/configCases/emit-asset/equal-source/webpack.config.js index 48a8987ca..c124af721 100644 --- a/test/configCases/emit-asset/equal-source/webpack.config.js +++ b/test/configCases/emit-asset/equal-source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/entry/adding-multiple-entry-points/webpack.config.js b/test/configCases/entry/adding-multiple-entry-points/webpack.config.js index d152588fc..994b605b4 100644 --- a/test/configCases/entry/adding-multiple-entry-points/webpack.config.js +++ b/test/configCases/entry/adding-multiple-entry-points/webpack.config.js @@ -1,4 +1,5 @@ const EntryPlugin = require("../../../../").EntryPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: () => ({}), optimization: { diff --git a/test/configCases/entry/depend-on-advanced/webpack.config.js b/test/configCases/entry/depend-on-advanced/webpack.config.js index ac0c0bdca..0bb6c323e 100644 --- a/test/configCases/entry/depend-on-advanced/webpack.config.js +++ b/test/configCases/entry/depend-on-advanced/webpack.config.js @@ -3,6 +3,7 @@ /** @typedef {import("../../../../").Configuration} Configuration */ /** @type {Configuration} */ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return Promise.resolve({ diff --git a/test/configCases/entry/depend-on-simple/webpack.config.js b/test/configCases/entry/depend-on-simple/webpack.config.js index ba29edb8e..157f6ce2a 100644 --- a/test/configCases/entry/depend-on-simple/webpack.config.js +++ b/test/configCases/entry/depend-on-simple/webpack.config.js @@ -1,6 +1,7 @@ /** @typedef {import("../../../../").Compiler} Compiler */ /** @typedef {import("../../../../").Compilation} Compilation */ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { app: { import: "./app.js", dependOn: "react-vendors" }, diff --git a/test/configCases/entry/descriptor/webpack.config.js b/test/configCases/entry/descriptor/webpack.config.js index 12645e335..d6e64eb6e 100644 --- a/test/configCases/entry/descriptor/webpack.config.js +++ b/test/configCases/entry/descriptor/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return { diff --git a/test/configCases/entry/function-promise/webpack.config.js b/test/configCases/entry/function-promise/webpack.config.js index 51f96abb8..50d4e4308 100644 --- a/test/configCases/entry/function-promise/webpack.config.js +++ b/test/configCases/entry/function-promise/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return Promise.resolve({ diff --git a/test/configCases/entry/function/webpack.config.js b/test/configCases/entry/function/webpack.config.js index aaeba7d0f..b7bf7cdd8 100644 --- a/test/configCases/entry/function/webpack.config.js +++ b/test/configCases/entry/function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return { diff --git a/test/configCases/entry/issue-1068/webpack.config.js b/test/configCases/entry/issue-1068/webpack.config.js index 9f42fbd69..e1229c307 100644 --- a/test/configCases/entry/issue-1068/webpack.config.js +++ b/test/configCases/entry/issue-1068/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: [ "./a", diff --git a/test/configCases/entry/issue-8110/webpack.config.js b/test/configCases/entry/issue-8110/webpack.config.js index ca8fd308d..1954865e2 100644 --- a/test/configCases/entry/issue-8110/webpack.config.js +++ b/test/configCases/entry/issue-8110/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./a", diff --git a/test/configCases/entry/require-entry-point/webpack.config.js b/test/configCases/entry/require-entry-point/webpack.config.js index 54b25366f..f8d4436d2 100644 --- a/test/configCases/entry/require-entry-point/webpack.config.js +++ b/test/configCases/entry/require-entry-point/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./require-entry-point", diff --git a/test/configCases/entry/single-entry-point/webpack.config.js b/test/configCases/entry/single-entry-point/webpack.config.js index d663ad3c4..777b9f6bd 100644 --- a/test/configCases/entry/single-entry-point/webpack.config.js +++ b/test/configCases/entry/single-entry-point/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./single-entry-point" }; diff --git a/test/configCases/entry/usage-info-in-multiple-entry-points/webpack.config.js b/test/configCases/entry/usage-info-in-multiple-entry-points/webpack.config.js index 5ccd21b88..294adb67d 100644 --- a/test/configCases/entry/usage-info-in-multiple-entry-points/webpack.config.js +++ b/test/configCases/entry/usage-info-in-multiple-entry-points/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./a", "./b"] }; diff --git a/test/configCases/errors/entry-not-found/webpack.config.js b/test/configCases/errors/entry-not-found/webpack.config.js index f053ebf79..3583b70a3 100644 --- a/test/configCases/errors/entry-not-found/webpack.config.js +++ b/test/configCases/errors/entry-not-found/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration} */ module.exports = {}; diff --git a/test/configCases/errors/exception-in-chunk-renderer/webpack.config.js b/test/configCases/errors/exception-in-chunk-renderer/webpack.config.js index 6a98bf6eb..9319d3db6 100644 --- a/test/configCases/errors/exception-in-chunk-renderer/webpack.config.js +++ b/test/configCases/errors/exception-in-chunk-renderer/webpack.config.js @@ -11,6 +11,7 @@ class ThrowsExceptionInRender { } } +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [new ThrowsExceptionInRender()] }; diff --git a/test/configCases/errors/import-missing/webpack.config.js b/test/configCases/errors/import-missing/webpack.config.js index 51f1a5d59..61694bc09 100644 --- a/test/configCases/errors/import-missing/webpack.config.js +++ b/test/configCases/errors/import-missing/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { bail: true }; diff --git a/test/configCases/errors/multi-entry-missing-module/webpack.config.js b/test/configCases/errors/multi-entry-missing-module/webpack.config.js index baf2b177a..9799f5c71 100644 --- a/test/configCases/errors/multi-entry-missing-module/webpack.config.js +++ b/test/configCases/errors/multi-entry-missing-module/webpack.config.js @@ -1,4 +1,5 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./intentionally-missing-module.js", diff --git a/test/configCases/errors/self-reexport/webpack.config.js b/test/configCases/errors/self-reexport/webpack.config.js index b913c78ab..dffc81bba 100644 --- a/test/configCases/errors/self-reexport/webpack.config.js +++ b/test/configCases/errors/self-reexport/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production" }; diff --git a/test/configCases/externals/externals-in-chunk/webpack.config.js b/test/configCases/externals/externals-in-chunk/webpack.config.js index ee8d99ce3..f147c9f5b 100644 --- a/test/configCases/externals/externals-in-chunk/webpack.config.js +++ b/test/configCases/externals/externals-in-chunk/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { externals: { external: "1+2", diff --git a/test/configCases/externals/externals-in-commons-chunk/webpack.config.js b/test/configCases/externals/externals-in-commons-chunk/webpack.config.js index 6cb5b9d6a..67937d5e7 100644 --- a/test/configCases/externals/externals-in-commons-chunk/webpack.config.js +++ b/test/configCases/externals/externals-in-commons-chunk/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index", diff --git a/test/configCases/externals/externals-system/webpack.config.js b/test/configCases/externals/externals-system/webpack.config.js index c333f47c4..283a0ba49 100644 --- a/test/configCases/externals/externals-system/webpack.config.js +++ b/test/configCases/externals/externals-system/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "system" diff --git a/test/configCases/externals/global/webpack.config.js b/test/configCases/externals/global/webpack.config.js index 5e9889bf3..0396bdef9 100644 --- a/test/configCases/externals/global/webpack.config.js +++ b/test/configCases/externals/global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { externals: { external: "global EXTERNAL_TEST_GLOBAL" diff --git a/test/configCases/externals/harmony/webpack.config.js b/test/configCases/externals/harmony/webpack.config.js index 77dccfd43..471b2a5ce 100644 --- a/test/configCases/externals/harmony/webpack.config.js +++ b/test/configCases/externals/harmony/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { externals: { external: "var 'abc'" diff --git a/test/configCases/externals/non-umd-externals-umd/webpack.config.js b/test/configCases/externals/non-umd-externals-umd/webpack.config.js index acbfaa925..bbb4c9b03 100644 --- a/test/configCases/externals/non-umd-externals-umd/webpack.config.js +++ b/test/configCases/externals/non-umd-externals-umd/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd" diff --git a/test/configCases/externals/non-umd-externals-umd2/webpack.config.js b/test/configCases/externals/non-umd-externals-umd2/webpack.config.js index edca25ee9..423ba3992 100644 --- a/test/configCases/externals/non-umd-externals-umd2/webpack.config.js +++ b/test/configCases/externals/non-umd-externals-umd2/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd2" diff --git a/test/configCases/externals/optional-externals-cjs/webpack.config.js b/test/configCases/externals/optional-externals-cjs/webpack.config.js index 6cffaf1c6..59b592cac 100644 --- a/test/configCases/externals/optional-externals-cjs/webpack.config.js +++ b/test/configCases/externals/optional-externals-cjs/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "commonjs2" diff --git a/test/configCases/externals/optional-externals-root/webpack.config.js b/test/configCases/externals/optional-externals-root/webpack.config.js index 8e541fe7e..cb1a0c126 100644 --- a/test/configCases/externals/optional-externals-root/webpack.config.js +++ b/test/configCases/externals/optional-externals-root/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { externalsType: "var", externals: { diff --git a/test/configCases/externals/optional-externals-umd/webpack.config.js b/test/configCases/externals/optional-externals-umd/webpack.config.js index fe8423e05..ec8b33938 100644 --- a/test/configCases/externals/optional-externals-umd/webpack.config.js +++ b/test/configCases/externals/optional-externals-umd/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd" diff --git a/test/configCases/externals/optional-externals-umd2-mixed/webpack.config.js b/test/configCases/externals/optional-externals-umd2-mixed/webpack.config.js index 1c34a176b..f27ef3ea2 100644 --- a/test/configCases/externals/optional-externals-umd2-mixed/webpack.config.js +++ b/test/configCases/externals/optional-externals-umd2-mixed/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd2" diff --git a/test/configCases/externals/optional-externals-umd2/webpack.config.js b/test/configCases/externals/optional-externals-umd2/webpack.config.js index a89a36f3c..d8f15c437 100644 --- a/test/configCases/externals/optional-externals-umd2/webpack.config.js +++ b/test/configCases/externals/optional-externals-umd2/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd2" diff --git a/test/configCases/filename-template/module-filename-template/webpack.config.js b/test/configCases/filename-template/module-filename-template/webpack.config.js index 735502fc3..b42c6bc33 100644 --- a/test/configCases/filename-template/module-filename-template/webpack.config.js +++ b/test/configCases/filename-template/module-filename-template/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/filename-template/script-src-filename/webpack.config.js b/test/configCases/filename-template/script-src-filename/webpack.config.js index dd02ada1f..8152f6c76 100644 --- a/test/configCases/filename-template/script-src-filename/webpack.config.js +++ b/test/configCases/filename-template/script-src-filename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development" }; diff --git a/test/configCases/filename-template/split-chunks-filename/webpack.config.js b/test/configCases/filename-template/split-chunks-filename/webpack.config.js index 9ea115219..b86d3f1b1 100644 --- a/test/configCases/filename-template/split-chunks-filename/webpack.config.js +++ b/test/configCases/filename-template/split-chunks-filename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", node: { diff --git a/test/configCases/finish-modules/simple/webpack.config.js b/test/configCases/finish-modules/simple/webpack.config.js index c0a1e91e6..af4d4907f 100644 --- a/test/configCases/finish-modules/simple/webpack.config.js +++ b/test/configCases/finish-modules/simple/webpack.config.js @@ -12,6 +12,7 @@ var testPlugin = function () { }); }; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [testPlugin] }; diff --git a/test/configCases/hash-length/output-filename/webpack.config.js b/test/configCases/hash-length/output-filename/webpack.config.js index f7130eec7..be0211d9d 100644 --- a/test/configCases/hash-length/output-filename/webpack.config.js +++ b/test/configCases/hash-length/output-filename/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration[]} */ module.exports = [ { name: "hash with length in publicPath", diff --git a/test/configCases/ignore/checkContext/webpack.config.js b/test/configCases/ignore/checkContext/webpack.config.js index 9fe886d3d..e7481af6c 100644 --- a/test/configCases/ignore/checkContext/webpack.config.js +++ b/test/configCases/ignore/checkContext/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/checkResource-one-argument/webpack.config.js b/test/configCases/ignore/checkResource-one-argument/webpack.config.js index b468d0c92..557cdc49c 100644 --- a/test/configCases/ignore/checkResource-one-argument/webpack.config.js +++ b/test/configCases/ignore/checkResource-one-argument/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/checkResource-two-arguments/webpack.config.js b/test/configCases/ignore/checkResource-two-arguments/webpack.config.js index 9fe886d3d..e7481af6c 100644 --- a/test/configCases/ignore/checkResource-two-arguments/webpack.config.js +++ b/test/configCases/ignore/checkResource-two-arguments/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/false-alias/webpack.config.js b/test/configCases/ignore/false-alias/webpack.config.js index 2aa45293d..2ab026773 100644 --- a/test/configCases/ignore/false-alias/webpack.config.js +++ b/test/configCases/ignore/false-alias/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", resolve: { diff --git a/test/configCases/ignore/multiple-with-externals/webpack.config.js b/test/configCases/ignore/multiple-with-externals/webpack.config.js index 5e383d114..b8a3a7343 100644 --- a/test/configCases/ignore/multiple-with-externals/webpack.config.js +++ b/test/configCases/ignore/multiple-with-externals/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", externals: { diff --git a/test/configCases/ignore/only-resource-context/webpack.config.js b/test/configCases/ignore/only-resource-context/webpack.config.js index 0c9f86cf2..d0210ba16 100644 --- a/test/configCases/ignore/only-resource-context/webpack.config.js +++ b/test/configCases/ignore/only-resource-context/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/only-resource/webpack.config.js b/test/configCases/ignore/only-resource/webpack.config.js index 0c9f86cf2..d0210ba16 100644 --- a/test/configCases/ignore/only-resource/webpack.config.js +++ b/test/configCases/ignore/only-resource/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/resource-and-context-contextmodule/webpack.config.js b/test/configCases/ignore/resource-and-context-contextmodule/webpack.config.js index 01bd02bc9..5c9f6cbe2 100644 --- a/test/configCases/ignore/resource-and-context-contextmodule/webpack.config.js +++ b/test/configCases/ignore/resource-and-context-contextmodule/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/ignore/resource-and-context/webpack.config.js b/test/configCases/ignore/resource-and-context/webpack.config.js index 01bd02bc9..5c9f6cbe2 100644 --- a/test/configCases/ignore/resource-and-context/webpack.config.js +++ b/test/configCases/ignore/resource-and-context/webpack.config.js @@ -2,6 +2,7 @@ const IgnorePlugin = require("../../../../").IgnorePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test.js", plugins: [ diff --git a/test/configCases/issues/issue-3596/webpack.config.js b/test/configCases/issues/issue-3596/webpack.config.js index 34cf32437..d03f4fdc1 100644 --- a/test/configCases/issues/issue-3596/webpack.config.js +++ b/test/configCases/issues/issue-3596/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./index", diff --git a/test/configCases/json/tree-shaking-default/webpack.config.js b/test/configCases/json/tree-shaking-default/webpack.config.js index f727276b3..5e6a2dea4 100644 --- a/test/configCases/json/tree-shaking-default/webpack.config.js +++ b/test/configCases/json/tree-shaking-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", node: { diff --git a/test/configCases/library/a/webpack.config.js b/test/configCases/library/a/webpack.config.js index bcd111fb1..d6284c7ac 100644 --- a/test/configCases/library/a/webpack.config.js +++ b/test/configCases/library/a/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "this" diff --git a/test/configCases/library/array-global/webpack.config.js b/test/configCases/library/array-global/webpack.config.js index bc177f6b5..2e6d8a1e2 100644 --- a/test/configCases/library/array-global/webpack.config.js +++ b/test/configCases/library/array-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: ["a", "b"] diff --git a/test/configCases/library/array-window/webpack.config.js b/test/configCases/library/array-window/webpack.config.js index 010ed97f1..0a58ae241 100644 --- a/test/configCases/library/array-window/webpack.config.js +++ b/test/configCases/library/array-window/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/library/b/webpack.config.js b/test/configCases/library/b/webpack.config.js index 92f8b666b..e2f1eaa2d 100644 --- a/test/configCases/library/b/webpack.config.js +++ b/test/configCases/library/b/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "global" diff --git a/test/configCases/library/umd-array/webpack.config.js b/test/configCases/library/umd-array/webpack.config.js index fba3d5e17..73b14934a 100644 --- a/test/configCases/library/umd-array/webpack.config.js +++ b/test/configCases/library/umd-array/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd", diff --git a/test/configCases/library/umd/webpack.config.js b/test/configCases/library/umd/webpack.config.js index 4ce89d69c..815908500 100644 --- a/test/configCases/library/umd/webpack.config.js +++ b/test/configCases/library/umd/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "umd", diff --git a/test/configCases/loaders/generate-ident/webpack.config.js b/test/configCases/loaders/generate-ident/webpack.config.js index 0f1384495..c316a6a0a 100644 --- a/test/configCases/loaders/generate-ident/webpack.config.js +++ b/test/configCases/loaders/generate-ident/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/loaders/issue-3320/webpack.config.js b/test/configCases/loaders/issue-3320/webpack.config.js index e2b3d79d2..f943c051e 100644 --- a/test/configCases/loaders/issue-3320/webpack.config.js +++ b/test/configCases/loaders/issue-3320/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { resolveLoader: { alias: { diff --git a/test/configCases/loaders/issue-9053/webpack.config.js b/test/configCases/loaders/issue-9053/webpack.config.js index b77f86881..fc77b7765 100644 --- a/test/configCases/loaders/issue-9053/webpack.config.js +++ b/test/configCases/loaders/issue-9053/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/loaders/mode-default/webpack.config.js b/test/configCases/loaders/mode-default/webpack.config.js index 87ef526b9..b991738c0 100644 --- a/test/configCases/loaders/mode-default/webpack.config.js +++ b/test/configCases/loaders/mode-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/loaders/mode-development/webpack.config.js b/test/configCases/loaders/mode-development/webpack.config.js index 5d7d3bf9b..7184f5d44 100644 --- a/test/configCases/loaders/mode-development/webpack.config.js +++ b/test/configCases/loaders/mode-development/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", module: { diff --git a/test/configCases/loaders/mode-none/webpack.config.js b/test/configCases/loaders/mode-none/webpack.config.js index ba5a8fb0a..a0b076d51 100644 --- a/test/configCases/loaders/mode-none/webpack.config.js +++ b/test/configCases/loaders/mode-none/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "none", module: { diff --git a/test/configCases/loaders/mode-production/webpack.config.js b/test/configCases/loaders/mode-production/webpack.config.js index 20f3afada..09b14d843 100644 --- a/test/configCases/loaders/mode-production/webpack.config.js +++ b/test/configCases/loaders/mode-production/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", module: { diff --git a/test/configCases/loaders/options/webpack.config.js b/test/configCases/loaders/options/webpack.config.js index c7870d8e6..6b5d57233 100644 --- a/test/configCases/loaders/options/webpack.config.js +++ b/test/configCases/loaders/options/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "none", module: { diff --git a/test/configCases/loaders/pre-post-loader/webpack.config.js b/test/configCases/loaders/pre-post-loader/webpack.config.js index 5a229d44a..c460255ce 100644 --- a/test/configCases/loaders/pre-post-loader/webpack.config.js +++ b/test/configCases/loaders/pre-post-loader/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/loaders/remaining-request/webpack.config.js b/test/configCases/loaders/remaining-request/webpack.config.js index 7109dba99..081789a6f 100644 --- a/test/configCases/loaders/remaining-request/webpack.config.js +++ b/test/configCases/loaders/remaining-request/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/mangle/mangle-with-object-prop/webpack.config.js b/test/configCases/mangle/mangle-with-object-prop/webpack.config.js index fee2bf64a..3d405a2e2 100644 --- a/test/configCases/mangle/mangle-with-object-prop/webpack.config.js +++ b/test/configCases/mangle/mangle-with-object-prop/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { mangleExports: true, diff --git a/test/configCases/mjs/esm-by-default/webpack.config.js b/test/configCases/mjs/esm-by-default/webpack.config.js index f053ebf79..3583b70a3 100644 --- a/test/configCases/mjs/esm-by-default/webpack.config.js +++ b/test/configCases/mjs/esm-by-default/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration} */ module.exports = {}; diff --git a/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js b/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js index 6527d721c..e86db6268 100644 --- a/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js +++ b/test/configCases/module-name/different-issuers-for-same-module/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", entry: ["./a", "./b", "./test"], diff --git a/test/configCases/no-parse/module.exports/webpack.config.js b/test/configCases/no-parse/module.exports/webpack.config.js index 5588dd0a1..b63c4511a 100644 --- a/test/configCases/no-parse/module.exports/webpack.config.js +++ b/test/configCases/no-parse/module.exports/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { noParse: /not-parsed/ diff --git a/test/configCases/no-parse/no-parse-function/webpack.config.js b/test/configCases/no-parse/no-parse-function/webpack.config.js index 2180c19f7..c40613062 100644 --- a/test/configCases/no-parse/no-parse-function/webpack.config.js +++ b/test/configCases/no-parse/no-parse-function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { noParse: function (content) { diff --git a/test/configCases/optimization/hashed-module-ids/webpack.config.js b/test/configCases/optimization/hashed-module-ids/webpack.config.js index 80e9e2199..e3f2e0b3b 100644 --- a/test/configCases/optimization/hashed-module-ids/webpack.config.js +++ b/test/configCases/optimization/hashed-module-ids/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "hashed" diff --git a/test/configCases/optimization/minimizer/webpack.config.js b/test/configCases/optimization/minimizer/webpack.config.js index 06ee86158..e15c2ba44 100644 --- a/test/configCases/optimization/minimizer/webpack.config.js +++ b/test/configCases/optimization/minimizer/webpack.config.js @@ -1,5 +1,6 @@ const Compiler = require("../../../../").Compiler; +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { minimize: true, diff --git a/test/configCases/optimization/named-modules/webpack.config.js b/test/configCases/optimization/named-modules/webpack.config.js index eef5638fa..15fb81f1b 100644 --- a/test/configCases/optimization/named-modules/webpack.config.js +++ b/test/configCases/optimization/named-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named" diff --git a/test/configCases/output/function/webpack.config.js b/test/configCases/output/function/webpack.config.js index 2cfbedfe1..85fe19d42 100644 --- a/test/configCases/output/function/webpack.config.js +++ b/test/configCases/output/function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return { diff --git a/test/configCases/output/inner-dirs-entries/webpack.config.js b/test/configCases/output/inner-dirs-entries/webpack.config.js index 1348a226f..74d71fbfc 100644 --- a/test/configCases/output/inner-dirs-entries/webpack.config.js +++ b/test/configCases/output/inner-dirs-entries/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "none", entry: { diff --git a/test/configCases/output/string/webpack.config.js b/test/configCases/output/string/webpack.config.js index 113bc4282..d96ec181e 100644 --- a/test/configCases/output/string/webpack.config.js +++ b/test/configCases/output/string/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry() { return { diff --git a/test/configCases/parsing/context/webpack.config.js b/test/configCases/parsing/context/webpack.config.js index cac06dfd0..91e80ba3b 100644 --- a/test/configCases/parsing/context/webpack.config.js +++ b/test/configCases/parsing/context/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { unknownContextRegExp: /^\.\//, diff --git a/test/configCases/parsing/extended-api/webpack.config.js b/test/configCases/parsing/extended-api/webpack.config.js index 4e7044c97..111b9e76b 100644 --- a/test/configCases/parsing/extended-api/webpack.config.js +++ b/test/configCases/parsing/extended-api/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { other: "./index" diff --git a/test/configCases/parsing/harmony-global/webpack.config.js b/test/configCases/parsing/harmony-global/webpack.config.js index a65179e2b..7bb5f004c 100644 --- a/test/configCases/parsing/harmony-global/webpack.config.js +++ b/test/configCases/parsing/harmony-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", performance: { diff --git a/test/configCases/parsing/harmony-this-concat/webpack.config.js b/test/configCases/parsing/harmony-this-concat/webpack.config.js index dfb1984cf..8c13599c6 100644 --- a/test/configCases/parsing/harmony-this-concat/webpack.config.js +++ b/test/configCases/parsing/harmony-this-concat/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictThisContextOnImports: true diff --git a/test/configCases/parsing/harmony-this/webpack.config.js b/test/configCases/parsing/harmony-this/webpack.config.js index 3877e9e67..2423e135e 100644 --- a/test/configCases/parsing/harmony-this/webpack.config.js +++ b/test/configCases/parsing/harmony-this/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictThisContextOnImports: true diff --git a/test/configCases/parsing/import-ignore/webpack.config.js b/test/configCases/parsing/import-ignore/webpack.config.js index 4fcaf47ef..a824d9201 100644 --- a/test/configCases/parsing/import-ignore/webpack.config.js +++ b/test/configCases/parsing/import-ignore/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./index.js", diff --git a/test/configCases/parsing/issue-2942/webpack.config.js b/test/configCases/parsing/issue-2942/webpack.config.js index 0570b6f2f..cb87a26bb 100644 --- a/test/configCases/parsing/issue-2942/webpack.config.js +++ b/test/configCases/parsing/issue-2942/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/parsing/issue-336/webpack.config.js b/test/configCases/parsing/issue-336/webpack.config.js index acaf8803c..987365418 100644 --- a/test/configCases/parsing/issue-336/webpack.config.js +++ b/test/configCases/parsing/issue-336/webpack.config.js @@ -1,4 +1,5 @@ var ProvidePlugin = require("../../../../").ProvidePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new ProvidePlugin({ diff --git a/test/configCases/parsing/issue-4857/webpack.config.js b/test/configCases/parsing/issue-4857/webpack.config.js index 61e31872c..e30e85e93 100644 --- a/test/configCases/parsing/issue-4857/webpack.config.js +++ b/test/configCases/parsing/issue-4857/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { minimize: false diff --git a/test/configCases/parsing/issue-5624/webpack.config.js b/test/configCases/parsing/issue-5624/webpack.config.js index dfb1984cf..8c13599c6 100644 --- a/test/configCases/parsing/issue-5624/webpack.config.js +++ b/test/configCases/parsing/issue-5624/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictThisContextOnImports: true diff --git a/test/configCases/parsing/issue-8293/webpack.config.js b/test/configCases/parsing/issue-8293/webpack.config.js index da6af6d20..09541e8dc 100644 --- a/test/configCases/parsing/issue-8293/webpack.config.js +++ b/test/configCases/parsing/issue-8293/webpack.config.js @@ -1,5 +1,6 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: "./index.js", diff --git a/test/configCases/parsing/issue-9042/webpack.config.js b/test/configCases/parsing/issue-9042/webpack.config.js index 47da81765..0a96337dc 100644 --- a/test/configCases/parsing/issue-9042/webpack.config.js +++ b/test/configCases/parsing/issue-9042/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", node: { diff --git a/test/configCases/parsing/issue-9156/webpack.config.js b/test/configCases/parsing/issue-9156/webpack.config.js index 9f1a00b55..0c8b672e3 100644 --- a/test/configCases/parsing/issue-9156/webpack.config.js +++ b/test/configCases/parsing/issue-9156/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", node: false diff --git a/test/configCases/parsing/node-source-plugin-off/webpack.config.js b/test/configCases/parsing/node-source-plugin-off/webpack.config.js index 9f1a00b55..0c8b672e3 100644 --- a/test/configCases/parsing/node-source-plugin-off/webpack.config.js +++ b/test/configCases/parsing/node-source-plugin-off/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", node: false diff --git a/test/configCases/parsing/node-stuff-plugin-off/webpack.config.js b/test/configCases/parsing/node-stuff-plugin-off/webpack.config.js index 9f1a00b55..0c8b672e3 100644 --- a/test/configCases/parsing/node-stuff-plugin-off/webpack.config.js +++ b/test/configCases/parsing/node-stuff-plugin-off/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", node: false diff --git a/test/configCases/parsing/relative-filedirname/webpack.config.js b/test/configCases/parsing/relative-filedirname/webpack.config.js index 3381b779e..14316147f 100644 --- a/test/configCases/parsing/relative-filedirname/webpack.config.js +++ b/test/configCases/parsing/relative-filedirname/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __filename: true, diff --git a/test/configCases/parsing/require.main/webpack.config.js b/test/configCases/parsing/require.main/webpack.config.js index f053ebf79..3583b70a3 100644 --- a/test/configCases/parsing/require.main/webpack.config.js +++ b/test/configCases/parsing/require.main/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration} */ module.exports = {}; diff --git a/test/configCases/parsing/requirejs/webpack.config.js b/test/configCases/parsing/requirejs/webpack.config.js index 44b2c6f35..8da4d0ff7 100644 --- a/test/configCases/parsing/requirejs/webpack.config.js +++ b/test/configCases/parsing/requirejs/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/performance/many-async-imports/webpack.config.js b/test/configCases/performance/many-async-imports/webpack.config.js index 61e31872c..e30e85e93 100644 --- a/test/configCases/performance/many-async-imports/webpack.config.js +++ b/test/configCases/performance/many-async-imports/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { minimize: false diff --git a/test/configCases/performance/many-exports/webpack.config.js b/test/configCases/performance/many-exports/webpack.config.js index 61e31872c..e30e85e93 100644 --- a/test/configCases/performance/many-exports/webpack.config.js +++ b/test/configCases/performance/many-exports/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { minimize: false diff --git a/test/configCases/plugins/banner-plugin-hashing/webpack.config.js b/test/configCases/plugins/banner-plugin-hashing/webpack.config.js index 48dc816c2..5d62b4121 100644 --- a/test/configCases/plugins/banner-plugin-hashing/webpack.config.js +++ b/test/configCases/plugins/banner-plugin-hashing/webpack.config.js @@ -2,6 +2,7 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/plugins/banner-plugin/webpack.config.js b/test/configCases/plugins/banner-plugin/webpack.config.js index da65d83f9..ced05eea1 100644 --- a/test/configCases/plugins/banner-plugin/webpack.config.js +++ b/test/configCases/plugins/banner-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/plugins/define-plugin-bigint/webpack.config.js b/test/configCases/plugins/define-plugin-bigint/webpack.config.js index 456650581..b5b8cca1c 100644 --- a/test/configCases/plugins/define-plugin-bigint/webpack.config.js +++ b/test/configCases/plugins/define-plugin-bigint/webpack.config.js @@ -1,5 +1,6 @@ var DefinePlugin = require("../../../../").DefinePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { output: { ecmaVersion: 11 diff --git a/test/configCases/plugins/define-plugin/webpack.config.js b/test/configCases/plugins/define-plugin/webpack.config.js index 8b85abe12..4f202b594 100644 --- a/test/configCases/plugins/define-plugin/webpack.config.js +++ b/test/configCases/plugins/define-plugin/webpack.config.js @@ -1,5 +1,6 @@ var DefinePlugin = require("../../../../").DefinePlugin; const Module = require("../../../../").Module; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new DefinePlugin({ diff --git a/test/configCases/plugins/lib-manifest-plugin/webpack.config.js b/test/configCases/plugins/lib-manifest-plugin/webpack.config.js index 471c797ab..db7a115a5 100644 --- a/test/configCases/plugins/lib-manifest-plugin/webpack.config.js +++ b/test/configCases/plugins/lib-manifest-plugin/webpack.config.js @@ -1,6 +1,7 @@ var path = require("path"); var LibManifestPlugin = require("../../../../").LibManifestPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { bundle0: ["./"] diff --git a/test/configCases/plugins/loader-options-plugin/webpack.config.js b/test/configCases/plugins/loader-options-plugin/webpack.config.js index 57efbcfad..4f644b0d6 100644 --- a/test/configCases/plugins/loader-options-plugin/webpack.config.js +++ b/test/configCases/plugins/loader-options-plugin/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.LoaderOptionsPlugin({ diff --git a/test/configCases/plugins/min-chunk-size/webpack.config.js b/test/configCases/plugins/min-chunk-size/webpack.config.js index 9ab2871e4..2464a9a3e 100644 --- a/test/configCases/plugins/min-chunk-size/webpack.config.js +++ b/test/configCases/plugins/min-chunk-size/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.optimize.MinChunkSizePlugin({ diff --git a/test/configCases/plugins/mini-css-extract-plugin/webpack.config.js b/test/configCases/plugins/mini-css-extract-plugin/webpack.config.js index 97589b2d1..37397dd24 100644 --- a/test/configCases/plugins/mini-css-extract-plugin/webpack.config.js +++ b/test/configCases/plugins/mini-css-extract-plugin/webpack.config.js @@ -1,5 +1,6 @@ var MCEP = require("mini-css-extract-plugin"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/plugins/progress-plugin/data.js b/test/configCases/plugins/progress-plugin/data.js index e0a30c5df..747c818b0 100644 --- a/test/configCases/plugins/progress-plugin/data.js +++ b/test/configCases/plugins/progress-plugin/data.js @@ -1 +1 @@ -module.exports = []; +module.exports = /** @type {string[]} */ ([]); diff --git a/test/configCases/plugins/progress-plugin/webpack.config.js b/test/configCases/plugins/progress-plugin/webpack.config.js index ddcf06368..3fc4768be 100644 --- a/test/configCases/plugins/progress-plugin/webpack.config.js +++ b/test/configCases/plugins/progress-plugin/webpack.config.js @@ -1,6 +1,7 @@ const path = require("path"); const webpack = require("../../../../"); const data = require("./data"); +/** @type {import("../../../../").Configuration} */ module.exports = { externals: { data: "commonjs " + path.resolve(__dirname, "data.js") diff --git a/test/configCases/plugins/provide-plugin/webpack.config.js b/test/configCases/plugins/provide-plugin/webpack.config.js index bbabf3dc1..bf040faf1 100644 --- a/test/configCases/plugins/provide-plugin/webpack.config.js +++ b/test/configCases/plugins/provide-plugin/webpack.config.js @@ -1,4 +1,5 @@ var ProvidePlugin = require("../../../../").ProvidePlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new ProvidePlugin({ diff --git a/test/configCases/plugins/source-map-dev-tool-plugin/webpack.config.js b/test/configCases/plugins/source-map-dev-tool-plugin/webpack.config.js index 59bb25d2a..1e0012a05 100644 --- a/test/configCases/plugins/source-map-dev-tool-plugin/webpack.config.js +++ b/test/configCases/plugins/source-map-dev-tool-plugin/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); var TerserPlugin = require("terser-webpack-plugin"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/plugins/source-map-dev-tool-plugin~append/webpack.config.js b/test/configCases/plugins/source-map-dev-tool-plugin~append/webpack.config.js index 6942bf0dd..3fff92b5c 100644 --- a/test/configCases/plugins/source-map-dev-tool-plugin~append/webpack.config.js +++ b/test/configCases/plugins/source-map-dev-tool-plugin~append/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); var TerserPlugin = require("terser-webpack-plugin"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/plugins/terser-plugin/webpack.config.js b/test/configCases/plugins/terser-plugin/webpack.config.js index 6e8384f21..04c63a9a9 100644 --- a/test/configCases/plugins/terser-plugin/webpack.config.js +++ b/test/configCases/plugins/terser-plugin/webpack.config.js @@ -1,4 +1,5 @@ const TerserPlugin = require("terser-webpack-plugin"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/race-conditions/load-module/webpack.config.js b/test/configCases/race-conditions/load-module/webpack.config.js index e39f50108..40427f860 100644 --- a/test/configCases/race-conditions/load-module/webpack.config.js +++ b/test/configCases/race-conditions/load-module/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { parallelism: 1 }; diff --git a/test/configCases/records/issue-295/webpack.config.js b/test/configCases/records/issue-295/webpack.config.js index 987f3640b..f285f7279 100644 --- a/test/configCases/records/issue-295/webpack.config.js +++ b/test/configCases/records/issue-295/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test", recordsPath: path.resolve( diff --git a/test/configCases/records/issue-2991/webpack.config.js b/test/configCases/records/issue-2991/webpack.config.js index 3d017931f..06e85654a 100644 --- a/test/configCases/records/issue-2991/webpack.config.js +++ b/test/configCases/records/issue-2991/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test", recordsOutputPath: path.resolve( diff --git a/test/configCases/records/issue-7339/webpack.config.js b/test/configCases/records/issue-7339/webpack.config.js index 0d7b9410f..51fca1dd2 100644 --- a/test/configCases/records/issue-7339/webpack.config.js +++ b/test/configCases/records/issue-7339/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./test", recordsOutputPath: path.resolve( diff --git a/test/configCases/records/issue-7492/webpack.config.js b/test/configCases/records/issue-7492/webpack.config.js index 32bbc5f69..f7e9c7b3f 100644 --- a/test/configCases/records/issue-7492/webpack.config.js +++ b/test/configCases/records/issue-7492/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", recordsInputPath: path.resolve(__dirname, "records.json"), diff --git a/test/configCases/records/stable-sort/webpack.config.js b/test/configCases/records/stable-sort/webpack.config.js index d44a32f15..94f54c2e5 100644 --- a/test/configCases/records/stable-sort/webpack.config.js +++ b/test/configCases/records/stable-sort/webpack.config.js @@ -1,5 +1,6 @@ var path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", entry: "./test", diff --git a/test/configCases/resolve/multi-alias/webpack.config.js b/test/configCases/resolve/multi-alias/webpack.config.js index 7e5109376..5d07a1386 100644 --- a/test/configCases/resolve/multi-alias/webpack.config.js +++ b/test/configCases/resolve/multi-alias/webpack.config.js @@ -1,4 +1,5 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { resolve: { alias: { diff --git a/test/configCases/rule-set/chaining/webpack.config.js b/test/configCases/rule-set/chaining/webpack.config.js index 908eda0c5..88c052b57 100644 --- a/test/configCases/rule-set/chaining/webpack.config.js +++ b/test/configCases/rule-set/chaining/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/compiler/webpack.config.js b/test/configCases/rule-set/compiler/webpack.config.js index 3b42db9b0..11c0be4e0 100644 --- a/test/configCases/rule-set/compiler/webpack.config.js +++ b/test/configCases/rule-set/compiler/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { name: "compiler-name", module: { diff --git a/test/configCases/rule-set/custom/webpack.config.js b/test/configCases/rule-set/custom/webpack.config.js index 6c1851b2f..dd898aebc 100644 --- a/test/configCases/rule-set/custom/webpack.config.js +++ b/test/configCases/rule-set/custom/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/query/webpack.config.js b/test/configCases/rule-set/query/webpack.config.js index cfa3e696e..589fd6fe6 100644 --- a/test/configCases/rule-set/query/webpack.config.js +++ b/test/configCases/rule-set/query/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/resolve-options/webpack.config.js b/test/configCases/rule-set/resolve-options/webpack.config.js index 7808abf02..cf15580f0 100644 --- a/test/configCases/rule-set/resolve-options/webpack.config.js +++ b/test/configCases/rule-set/resolve-options/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { resolve: { alias: { diff --git a/test/configCases/rule-set/simple-use-array-fn/webpack.config.js b/test/configCases/rule-set/simple-use-array-fn/webpack.config.js index 852de277a..5e3b61809 100644 --- a/test/configCases/rule-set/simple-use-array-fn/webpack.config.js +++ b/test/configCases/rule-set/simple-use-array-fn/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/simple-use-fn-array/webpack.config.js b/test/configCases/rule-set/simple-use-fn-array/webpack.config.js index b58ddda2c..6ac920770 100644 --- a/test/configCases/rule-set/simple-use-fn-array/webpack.config.js +++ b/test/configCases/rule-set/simple-use-fn-array/webpack.config.js @@ -22,6 +22,7 @@ var useArray = createFunctionArrayFromUseArray([ } ]); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/simple/webpack.config.js b/test/configCases/rule-set/simple/webpack.config.js index 5447ed4e1..663137217 100644 --- a/test/configCases/rule-set/simple/webpack.config.js +++ b/test/configCases/rule-set/simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/rule-set/undefined-values/webpack.config.js b/test/configCases/rule-set/undefined-values/webpack.config.js index c130e4148..0b3933fba 100644 --- a/test/configCases/rule-set/undefined-values/webpack.config.js +++ b/test/configCases/rule-set/undefined-values/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/runtime/invalid-esm-export/webpack.config.js b/test/configCases/runtime/invalid-esm-export/webpack.config.js index dd02ada1f..8152f6c76 100644 --- a/test/configCases/runtime/invalid-esm-export/webpack.config.js +++ b/test/configCases/runtime/invalid-esm-export/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development" }; diff --git a/test/configCases/runtime/opt-in-finally/webpack.config.js b/test/configCases/runtime/opt-in-finally/webpack.config.js index 15a47b1f6..b98edea7f 100644 --- a/test/configCases/runtime/opt-in-finally/webpack.config.js +++ b/test/configCases/runtime/opt-in-finally/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { strictModuleExceptionHandling: true diff --git a/test/configCases/scope-hoisting/class-naming/webpack.config.js b/test/configCases/scope-hoisting/class-naming/webpack.config.js index 59e948b12..c939ba33f 100644 --- a/test/configCases/scope-hoisting/class-naming/webpack.config.js +++ b/test/configCases/scope-hoisting/class-naming/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { concatenateModules: true diff --git a/test/configCases/scope-hoisting/create-dll-plugin/webpack.config.js b/test/configCases/scope-hoisting/create-dll-plugin/webpack.config.js index f169ea12e..7727d1499 100644 --- a/test/configCases/scope-hoisting/create-dll-plugin/webpack.config.js +++ b/test/configCases/scope-hoisting/create-dll-plugin/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: ["./index.js"], plugins: [ diff --git a/test/configCases/scope-hoisting/dll-plugin/webpack.config.js b/test/configCases/scope-hoisting/dll-plugin/webpack.config.js index b79c4000a..a001ff03c 100644 --- a/test/configCases/scope-hoisting/dll-plugin/webpack.config.js +++ b/test/configCases/scope-hoisting/dll-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DllReferencePlugin({ diff --git a/test/configCases/scope-hoisting/esModule/webpack.config.js b/test/configCases/scope-hoisting/esModule/webpack.config.js index b5fcc43ed..363b516ca 100644 --- a/test/configCases/scope-hoisting/esModule/webpack.config.js +++ b/test/configCases/scope-hoisting/esModule/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", devtool: false, diff --git a/test/configCases/scope-hoisting/export-global/webpack.config.js b/test/configCases/scope-hoisting/export-global/webpack.config.js index 59e948b12..c939ba33f 100644 --- a/test/configCases/scope-hoisting/export-global/webpack.config.js +++ b/test/configCases/scope-hoisting/export-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { concatenateModules: true diff --git a/test/configCases/scope-hoisting/harmony-pure-default/webpack.config.js b/test/configCases/scope-hoisting/harmony-pure-default/webpack.config.js index e963f0342..7d36a68c1 100644 --- a/test/configCases/scope-hoisting/harmony-pure-default/webpack.config.js +++ b/test/configCases/scope-hoisting/harmony-pure-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/configCases/scope-hoisting/named-modules/webpack.config.js b/test/configCases/scope-hoisting/named-modules/webpack.config.js index 4f053bf10..4a7373bf9 100644 --- a/test/configCases/scope-hoisting/named-modules/webpack.config.js +++ b/test/configCases/scope-hoisting/named-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { moduleIds: "named", diff --git a/test/configCases/scope-hoisting/strictThisContextOnImports/webpack.config.js b/test/configCases/scope-hoisting/strictThisContextOnImports/webpack.config.js index 9cd2bdf56..4b05152b1 100644 --- a/test/configCases/scope-hoisting/strictThisContextOnImports/webpack.config.js +++ b/test/configCases/scope-hoisting/strictThisContextOnImports/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { module: { strictThisContextOnImports: true diff --git a/test/configCases/side-effects/side-effects-override/webpack.config.js b/test/configCases/side-effects/side-effects-override/webpack.config.js index 789ad53cf..8270d6220 100644 --- a/test/configCases/side-effects/side-effects-override/webpack.config.js +++ b/test/configCases/side-effects/side-effects-override/webpack.config.js @@ -1,4 +1,5 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", module: { diff --git a/test/configCases/side-effects/side-effects-values/webpack.config.js b/test/configCases/side-effects/side-effects-values/webpack.config.js index c5fce2d1b..5e498c669 100644 --- a/test/configCases/side-effects/side-effects-values/webpack.config.js +++ b/test/configCases/side-effects/side-effects-values/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", module: { diff --git a/test/configCases/simple/empty-config/webpack.config.js b/test/configCases/simple/empty-config/webpack.config.js index f053ebf79..3583b70a3 100644 --- a/test/configCases/simple/empty-config/webpack.config.js +++ b/test/configCases/simple/empty-config/webpack.config.js @@ -1 +1,2 @@ +/** @type {import("../../../../").Configuration} */ module.exports = {}; diff --git a/test/configCases/source-map/array-as-output-library-in-object-output/webpack.config.js b/test/configCases/source-map/array-as-output-library-in-object-output/webpack.config.js index d9c8900e5..5adb84b32 100644 --- a/test/configCases/source-map/array-as-output-library-in-object-output/webpack.config.js +++ b/test/configCases/source-map/array-as-output-library-in-object-output/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "source-map", output: { diff --git a/test/configCases/source-map/array-as-output-library/webpack.config.js b/test/configCases/source-map/array-as-output-library/webpack.config.js index ee3cbe39b..81087b112 100644 --- a/test/configCases/source-map/array-as-output-library/webpack.config.js +++ b/test/configCases/source-map/array-as-output-library/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "source-map", output: { diff --git a/test/configCases/source-map/default-filename-extensions-css/webpack.config.js b/test/configCases/source-map/default-filename-extensions-css/webpack.config.js index 1b969d38d..ae476c291 100644 --- a/test/configCases/source-map/default-filename-extensions-css/webpack.config.js +++ b/test/configCases/source-map/default-filename-extensions-css/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/default-filename-extensions-js/webpack.config.js b/test/configCases/source-map/default-filename-extensions-js/webpack.config.js index 597a81501..63d1ba55a 100644 --- a/test/configCases/source-map/default-filename-extensions-js/webpack.config.js +++ b/test/configCases/source-map/default-filename-extensions-js/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js b/test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js index 9f5b271c0..a4ea70713 100644 --- a/test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js +++ b/test/configCases/source-map/default-filename-extensions-mjs/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/exclude-chunks-source-map/webpack.config.js b/test/configCases/source-map/exclude-chunks-source-map/webpack.config.js index 3e69a12fe..e84cbb332 100644 --- a/test/configCases/source-map/exclude-chunks-source-map/webpack.config.js +++ b/test/configCases/source-map/exclude-chunks-source-map/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", devtool: false, diff --git a/test/configCases/source-map/exclude-modules-source-map/webpack.config.js b/test/configCases/source-map/exclude-modules-source-map/webpack.config.js index 028743e5c..c78370dd6 100644 --- a/test/configCases/source-map/exclude-modules-source-map/webpack.config.js +++ b/test/configCases/source-map/exclude-modules-source-map/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/source-map/module-names/webpack.config.js b/test/configCases/source-map/module-names/webpack.config.js index 961eb67d9..249cf04c4 100644 --- a/test/configCases/source-map/module-names/webpack.config.js +++ b/test/configCases/source-map/module-names/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/namespace-source-path.library/webpack.config.js b/test/configCases/source-map/namespace-source-path.library/webpack.config.js index ae84e5f4b..71e95006f 100644 --- a/test/configCases/source-map/namespace-source-path.library/webpack.config.js +++ b/test/configCases/source-map/namespace-source-path.library/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/namespace-source-path/webpack.config.js b/test/configCases/source-map/namespace-source-path/webpack.config.js index 37c0d2642..12407607a 100644 --- a/test/configCases/source-map/namespace-source-path/webpack.config.js +++ b/test/configCases/source-map/namespace-source-path/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/nosources/webpack.config.js b/test/configCases/source-map/nosources/webpack.config.js index 07b6b6160..3cf657210 100644 --- a/test/configCases/source-map/nosources/webpack.config.js +++ b/test/configCases/source-map/nosources/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", node: { diff --git a/test/configCases/source-map/object-as-output-library/webpack.config.js b/test/configCases/source-map/object-as-output-library/webpack.config.js index 13662dafd..5da44457e 100644 --- a/test/configCases/source-map/object-as-output-library/webpack.config.js +++ b/test/configCases/source-map/object-as-output-library/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { devtool: "source-map", output: { diff --git a/test/configCases/source-map/relative-source-map-path/webpack.config.js b/test/configCases/source-map/relative-source-map-path/webpack.config.js index 07b079a42..ccfc9bff6 100644 --- a/test/configCases/source-map/relative-source-map-path/webpack.config.js +++ b/test/configCases/source-map/relative-source-map-path/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", output: { diff --git a/test/configCases/source-map/relative-source-maps-by-loader/webpack.config.js b/test/configCases/source-map/relative-source-maps-by-loader/webpack.config.js index 628f31af6..c0a285cd1 100644 --- a/test/configCases/source-map/relative-source-maps-by-loader/webpack.config.js +++ b/test/configCases/source-map/relative-source-maps-by-loader/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", node: { diff --git a/test/configCases/source-map/source-map-filename-contenthash/webpack.config.js b/test/configCases/source-map/source-map-filename-contenthash/webpack.config.js index 01478ecd9..1926f4f11 100644 --- a/test/configCases/source-map/source-map-filename-contenthash/webpack.config.js +++ b/test/configCases/source-map/source-map-filename-contenthash/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", node: { diff --git a/test/configCases/source-map/source-map-with-profiling-plugin/webpack.config.js b/test/configCases/source-map/source-map-with-profiling-plugin/webpack.config.js index ecc013f88..8c475bd85 100644 --- a/test/configCases/source-map/source-map-with-profiling-plugin/webpack.config.js +++ b/test/configCases/source-map/source-map-with-profiling-plugin/webpack.config.js @@ -2,6 +2,7 @@ var webpack = require("../../../../"); var path = require("path"); var os = require("os"); +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/source-map/sources-array-production/webpack.config.js b/test/configCases/source-map/sources-array-production/webpack.config.js index acbb8608c..e741f449e 100644 --- a/test/configCases/source-map/sources-array-production/webpack.config.js +++ b/test/configCases/source-map/sources-array-production/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { node: { __dirname: false, diff --git a/test/configCases/split-chunks-common/correct-order/webpack.config.js b/test/configCases/split-chunks-common/correct-order/webpack.config.js index cc7e99cd6..65bafc0f6 100644 --- a/test/configCases/split-chunks-common/correct-order/webpack.config.js +++ b/test/configCases/split-chunks-common/correct-order/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["./a"], diff --git a/test/configCases/split-chunks-common/extract-async-from-entry/webpack.config.js b/test/configCases/split-chunks-common/extract-async-from-entry/webpack.config.js index 39260c23c..715e35bdb 100644 --- a/test/configCases/split-chunks-common/extract-async-from-entry/webpack.config.js +++ b/test/configCases/split-chunks-common/extract-async-from-entry/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index", diff --git a/test/configCases/split-chunks-common/hot-multi/webpack.config.js b/test/configCases/split-chunks-common/hot-multi/webpack.config.js index 10a7fc60a..62a60e069 100644 --- a/test/configCases/split-chunks-common/hot-multi/webpack.config.js +++ b/test/configCases/split-chunks-common/hot-multi/webpack.config.js @@ -1,5 +1,6 @@ var HotModuleReplacementPlugin = require("../../../../") .HotModuleReplacementPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { first: ["./shared", "./first"], diff --git a/test/configCases/split-chunks-common/hot/webpack.config.js b/test/configCases/split-chunks-common/hot/webpack.config.js index 3319ff9ac..e5d5f87c7 100644 --- a/test/configCases/split-chunks-common/hot/webpack.config.js +++ b/test/configCases/split-chunks-common/hot/webpack.config.js @@ -1,5 +1,6 @@ var HotModuleReplacementPlugin = require("../../../../") .HotModuleReplacementPlugin; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index" diff --git a/test/configCases/split-chunks-common/inverted-order/webpack.config.js b/test/configCases/split-chunks-common/inverted-order/webpack.config.js index cc7e99cd6..65bafc0f6 100644 --- a/test/configCases/split-chunks-common/inverted-order/webpack.config.js +++ b/test/configCases/split-chunks-common/inverted-order/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["./a"], diff --git a/test/configCases/split-chunks-common/move-entry/webpack.config.js b/test/configCases/split-chunks-common/move-entry/webpack.config.js index 9310be1c3..36226f722 100644 --- a/test/configCases/split-chunks-common/move-entry/webpack.config.js +++ b/test/configCases/split-chunks-common/move-entry/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index?0", diff --git a/test/configCases/split-chunks-common/move-to-grandparent/webpack.config.js b/test/configCases/split-chunks-common/move-to-grandparent/webpack.config.js index 520f039b2..183a1227e 100644 --- a/test/configCases/split-chunks-common/move-to-grandparent/webpack.config.js +++ b/test/configCases/split-chunks-common/move-to-grandparent/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index", diff --git a/test/configCases/split-chunks-common/simple/webpack.config.js b/test/configCases/split-chunks-common/simple/webpack.config.js index cc7e99cd6..65bafc0f6 100644 --- a/test/configCases/split-chunks-common/simple/webpack.config.js +++ b/test/configCases/split-chunks-common/simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["./a"], diff --git a/test/configCases/split-chunks/chunk-filename-delimiter-default/webpack.config.js b/test/configCases/split-chunks/chunk-filename-delimiter-default/webpack.config.js index 437704f50..1395d0976 100644 --- a/test/configCases/split-chunks/chunk-filename-delimiter-default/webpack.config.js +++ b/test/configCases/split-chunks/chunk-filename-delimiter-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/configCases/split-chunks/chunk-filename-delimiter/webpack.config.js b/test/configCases/split-chunks/chunk-filename-delimiter/webpack.config.js index 0214b8486..968fd8fc9 100644 --- a/test/configCases/split-chunks/chunk-filename-delimiter/webpack.config.js +++ b/test/configCases/split-chunks/chunk-filename-delimiter/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/configCases/split-chunks/custom-filename-function/webpack.config.js b/test/configCases/split-chunks/custom-filename-function/webpack.config.js index e54b5b878..91d2a24b5 100644 --- a/test/configCases/split-chunks/custom-filename-function/webpack.config.js +++ b/test/configCases/split-chunks/custom-filename-function/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/split-chunks/custom-filename-many-custom/webpack.config.js b/test/configCases/split-chunks/custom-filename-many-custom/webpack.config.js index f398c1169..46accefd6 100644 --- a/test/configCases/split-chunks/custom-filename-many-custom/webpack.config.js +++ b/test/configCases/split-chunks/custom-filename-many-custom/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/split-chunks/custom-filename/webpack.config.js b/test/configCases/split-chunks/custom-filename/webpack.config.js index f398c1169..46accefd6 100644 --- a/test/configCases/split-chunks/custom-filename/webpack.config.js +++ b/test/configCases/split-chunks/custom-filename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/split-chunks/entry-point-error/webpack.config.js b/test/configCases/split-chunks/entry-point-error/webpack.config.js index fb8410004..dacba3864 100644 --- a/test/configCases/split-chunks/entry-point-error/webpack.config.js +++ b/test/configCases/split-chunks/entry-point-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendors: ["./module"], diff --git a/test/configCases/split-chunks/incorrect-chunk-reuse/webpack.config.js b/test/configCases/split-chunks/incorrect-chunk-reuse/webpack.config.js index 9c635ed7c..5704fc5c5 100644 --- a/test/configCases/split-chunks/incorrect-chunk-reuse/webpack.config.js +++ b/test/configCases/split-chunks/incorrect-chunk-reuse/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", optimization: { diff --git a/test/configCases/split-chunks/issue-8908/webpack.config.js b/test/configCases/split-chunks/issue-8908/webpack.config.js index b0cf6df96..c7307692c 100644 --- a/test/configCases/split-chunks/issue-8908/webpack.config.js +++ b/test/configCases/split-chunks/issue-8908/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/split-chunks/issue-9491/webpack.config.js b/test/configCases/split-chunks/issue-9491/webpack.config.js index a77f03a66..bfced90ac 100644 --- a/test/configCases/split-chunks/issue-9491/webpack.config.js +++ b/test/configCases/split-chunks/issue-9491/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { constructor: "./index" diff --git a/test/configCases/split-chunks/module-type-filter/webpack.config.js b/test/configCases/split-chunks/module-type-filter/webpack.config.js index 3a6eac218..3b2df399f 100644 --- a/test/configCases/split-chunks/module-type-filter/webpack.config.js +++ b/test/configCases/split-chunks/module-type-filter/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index" diff --git a/test/configCases/split-chunks/no-options/webpack.config.js b/test/configCases/split-chunks/no-options/webpack.config.js index 3298c5aae..2fec23d7f 100644 --- a/test/configCases/split-chunks/no-options/webpack.config.js +++ b/test/configCases/split-chunks/no-options/webpack.config.js @@ -1,5 +1,6 @@ const { SplitChunksPlugin } = require("../../../../").optimize; +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { vendor: ["./a"], diff --git a/test/configCases/split-chunks/reuse-chunk-name/webpack.config.js b/test/configCases/split-chunks/reuse-chunk-name/webpack.config.js index 773d3304c..a31736a39 100644 --- a/test/configCases/split-chunks/reuse-chunk-name/webpack.config.js +++ b/test/configCases/split-chunks/reuse-chunk-name/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { filename: "[name].js" diff --git a/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js b/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js index 5f4da7943..b8fb043d7 100644 --- a/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js +++ b/test/configCases/split-chunks/runtime-chunk-no-async/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { main: "./index" diff --git a/test/configCases/split-chunks/runtime-chunk/webpack.config.js b/test/configCases/split-chunks/runtime-chunk/webpack.config.js index c3b3f6110..180a47ff5 100644 --- a/test/configCases/split-chunks/runtime-chunk/webpack.config.js +++ b/test/configCases/split-chunks/runtime-chunk/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { entry: { a: "./a", diff --git a/test/configCases/target/amd-named/webpack.config.js b/test/configCases/target/amd-named/webpack.config.js index f80f8f3a0..426146503 100644 --- a/test/configCases/target/amd-named/webpack.config.js +++ b/test/configCases/target/amd-named/webpack.config.js @@ -1,4 +1,5 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "NamedLibrary", diff --git a/test/configCases/target/amd-require/webpack.config.js b/test/configCases/target/amd-require/webpack.config.js index 1bb3b0ac2..a280fb2a0 100644 --- a/test/configCases/target/amd-require/webpack.config.js +++ b/test/configCases/target/amd-require/webpack.config.js @@ -1,4 +1,5 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "amd-require" diff --git a/test/configCases/target/amd-unnamed/webpack.config.js b/test/configCases/target/amd-unnamed/webpack.config.js index 494051b75..3f02249eb 100644 --- a/test/configCases/target/amd-unnamed/webpack.config.js +++ b/test/configCases/target/amd-unnamed/webpack.config.js @@ -1,4 +1,5 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "amd" diff --git a/test/configCases/target/electron-renderer/webpack.config.js b/test/configCases/target/electron-renderer/webpack.config.js index 55a90182f..e7d1ecf5c 100644 --- a/test/configCases/target/electron-renderer/webpack.config.js +++ b/test/configCases/target/electron-renderer/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "electron-renderer", optimization: { diff --git a/test/configCases/target/node-dynamic-import/webpack.config.js b/test/configCases/target/node-dynamic-import/webpack.config.js index 85beb01b7..411eb1af1 100644 --- a/test/configCases/target/node-dynamic-import/webpack.config.js +++ b/test/configCases/target/node-dynamic-import/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "node", performance: { diff --git a/test/configCases/target/strict-mode-global/webpack.config.js b/test/configCases/target/strict-mode-global/webpack.config.js index 7105dc09e..03c779ee0 100644 --- a/test/configCases/target/strict-mode-global/webpack.config.js +++ b/test/configCases/target/strict-mode-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web" }; diff --git a/test/configCases/target/system-context/webpack.config.js b/test/configCases/target/system-context/webpack.config.js index 063b49207..2d1a8001f 100644 --- a/test/configCases/target/system-context/webpack.config.js +++ b/test/configCases/target/system-context/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "system" diff --git a/test/configCases/target/system-export/webpack.config.js b/test/configCases/target/system-export/webpack.config.js index 063b49207..2d1a8001f 100644 --- a/test/configCases/target/system-export/webpack.config.js +++ b/test/configCases/target/system-export/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "system" diff --git a/test/configCases/target/system-named-assets-path/webpack.config.js b/test/configCases/target/system-named-assets-path/webpack.config.js index 16bbc7f12..4dc791678 100644 --- a/test/configCases/target/system-named-assets-path/webpack.config.js +++ b/test/configCases/target/system-named-assets-path/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "named-system-module-[name]", diff --git a/test/configCases/target/system-named/webpack.config.js b/test/configCases/target/system-named/webpack.config.js index 1f4b76b0c..fef28f250 100644 --- a/test/configCases/target/system-named/webpack.config.js +++ b/test/configCases/target/system-named/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "named-system-module", diff --git a/test/configCases/target/system-unnamed/webpack.config.js b/test/configCases/target/system-unnamed/webpack.config.js index 063b49207..2d1a8001f 100644 --- a/test/configCases/target/system-unnamed/webpack.config.js +++ b/test/configCases/target/system-unnamed/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { libraryTarget: "system" diff --git a/test/configCases/target/umd-auxiliary-comments-object/webpack.config.js b/test/configCases/target/umd-auxiliary-comments-object/webpack.config.js index 194732838..43147101b 100644 --- a/test/configCases/target/umd-auxiliary-comments-object/webpack.config.js +++ b/test/configCases/target/umd-auxiliary-comments-object/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "NamedLibrary", diff --git a/test/configCases/target/umd-auxiliary-comments-string/webpack.config.js b/test/configCases/target/umd-auxiliary-comments-string/webpack.config.js index 82e0dfe1e..739c67f4f 100644 --- a/test/configCases/target/umd-auxiliary-comments-string/webpack.config.js +++ b/test/configCases/target/umd-auxiliary-comments-string/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "NamedLibrary", diff --git a/test/configCases/target/umd-named-define/webpack.config.js b/test/configCases/target/umd-named-define/webpack.config.js index be904c79d..bfe025995 100644 --- a/test/configCases/target/umd-named-define/webpack.config.js +++ b/test/configCases/target/umd-named-define/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { library: "NamedLibrary", diff --git a/test/configCases/utils/lazy-set/webpack.config.js b/test/configCases/utils/lazy-set/webpack.config.js index 39ff2ee83..5a23d98af 100644 --- a/test/configCases/utils/lazy-set/webpack.config.js +++ b/test/configCases/utils/lazy-set/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ compiler => { diff --git a/test/configCases/wasm/export-imported-global/webpack.config.js b/test/configCases/wasm/export-imported-global/webpack.config.js index 7ac4a3ab7..63567a475 100644 --- a/test/configCases/wasm/export-imported-global/webpack.config.js +++ b/test/configCases/wasm/export-imported-global/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", module: { diff --git a/test/configCases/wasm/identical/webpack.config.js b/test/configCases/wasm/identical/webpack.config.js index 614dd5574..1e48ea814 100644 --- a/test/configCases/wasm/identical/webpack.config.js +++ b/test/configCases/wasm/identical/webpack.config.js @@ -3,6 +3,7 @@ const { AsyncWebAssemblyModulesPlugin } = require("../../../../").wasm; /** @typedef {import("../../../../").Compiler} Compiler */ +/** @type {import("../../../../").Configuration} */ module.exports = { module: { rules: [ diff --git a/test/configCases/wasm/import-wasm-wasm/webpack.config.js b/test/configCases/wasm/import-wasm-wasm/webpack.config.js index 7ac4a3ab7..63567a475 100644 --- a/test/configCases/wasm/import-wasm-wasm/webpack.config.js +++ b/test/configCases/wasm/import-wasm-wasm/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", module: { diff --git a/test/configCases/wasm/wasm-in-initial-chunk-error/webpack.config.js b/test/configCases/wasm/wasm-in-initial-chunk-error/webpack.config.js index bc80a015f..13e314096 100644 --- a/test/configCases/wasm/wasm-in-initial-chunk-error/webpack.config.js +++ b/test/configCases/wasm/wasm-in-initial-chunk-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { entry: "./index", module: { diff --git a/test/configCases/web/node-source/webpack.config.js b/test/configCases/web/node-source/webpack.config.js index 721e519b0..6524ff2c4 100644 --- a/test/configCases/web/node-source/webpack.config.js +++ b/test/configCases/web/node-source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", entry: "./index.mjs", diff --git a/test/configCases/web/prefetch-preload/webpack.config.js b/test/configCases/web/prefetch-preload/webpack.config.js index 34460c414..08945539a 100644 --- a/test/configCases/web/prefetch-preload/webpack.config.js +++ b/test/configCases/web/prefetch-preload/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/web/prefetch-split-chunks/webpack.config.js b/test/configCases/web/prefetch-split-chunks/webpack.config.js index 6a2f545c4..392e26644 100644 --- a/test/configCases/web/prefetch-split-chunks/webpack.config.js +++ b/test/configCases/web/prefetch-split-chunks/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/web/retry-failed-import/webpack.config.js b/test/configCases/web/retry-failed-import/webpack.config.js index c9b63678b..f7950dc53 100644 --- a/test/configCases/web/retry-failed-import/webpack.config.js +++ b/test/configCases/web/retry-failed-import/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/configCases/web/unique-jsonp/webpack.config.js b/test/configCases/web/unique-jsonp/webpack.config.js index 6094bc126..681dcca65 100644 --- a/test/configCases/web/unique-jsonp/webpack.config.js +++ b/test/configCases/web/unique-jsonp/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { target: "web", output: { diff --git a/test/hotCases/concat/reload-compat-flag/webpack.config.js b/test/hotCases/concat/reload-compat-flag/webpack.config.js index 1e91d5bfb..af38831a6 100644 --- a/test/hotCases/concat/reload-compat-flag/webpack.config.js +++ b/test/hotCases/concat/reload-compat-flag/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/hotCases/concat/reload-external/webpack.config.js b/test/hotCases/concat/reload-external/webpack.config.js index 1e91d5bfb..af38831a6 100644 --- a/test/hotCases/concat/reload-external/webpack.config.js +++ b/test/hotCases/concat/reload-external/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/hotCases/define/issue-6962/webpack.config.js b/test/hotCases/define/issue-6962/webpack.config.js index 3d212ee5e..933fa42c9 100644 --- a/test/hotCases/define/issue-6962/webpack.config.js +++ b/test/hotCases/define/issue-6962/webpack.config.js @@ -2,6 +2,7 @@ const webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DefinePlugin({ diff --git a/test/hotCases/numeric-ids/production/webpack.config.js b/test/hotCases/numeric-ids/production/webpack.config.js index 1e91d5bfb..af38831a6 100644 --- a/test/hotCases/numeric-ids/production/webpack.config.js +++ b/test/hotCases/numeric-ids/production/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", optimization: { diff --git a/test/hotPlayground/webpack.config.js b/test/hotPlayground/webpack.config.js index 65d1d9bd6..c27afdd64 100644 --- a/test/hotPlayground/webpack.config.js +++ b/test/hotPlayground/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../"); +/** @type {import("../../").Configuration} */ module.exports = { entry: ["../../hot/dev-server", "./index.js"], output: { diff --git a/test/statsCases/aggressive-splitting-on-demand/webpack.config.js b/test/statsCases/aggressive-splitting-on-demand/webpack.config.js index 0abc3b5bf..1af9f4056 100644 --- a/test/statsCases/aggressive-splitting-on-demand/webpack.config.js +++ b/test/statsCases/aggressive-splitting-on-demand/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/asset/webpack.config.js b/test/statsCases/asset/webpack.config.js index 3b8a08504..be774ea86 100644 --- a/test/statsCases/asset/webpack.config.js +++ b/test/statsCases/asset/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index.js", diff --git a/test/statsCases/async-commons-chunk/webpack.config.js b/test/statsCases/async-commons-chunk/webpack.config.js index e694033c4..aee3af004 100644 --- a/test/statsCases/async-commons-chunk/webpack.config.js +++ b/test/statsCases/async-commons-chunk/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./", diff --git a/test/statsCases/chunk-module-id-range/webpack.config.js b/test/statsCases/chunk-module-id-range/webpack.config.js index 106510f42..e1f2fa4a4 100644 --- a/test/statsCases/chunk-module-id-range/webpack.config.js +++ b/test/statsCases/chunk-module-id-range/webpack.config.js @@ -1,5 +1,6 @@ const webpack = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "none", entry: { diff --git a/test/statsCases/chunks-development/webpack.config.js b/test/statsCases/chunks-development/webpack.config.js index 861efcb11..0bb545053 100644 --- a/test/statsCases/chunks-development/webpack.config.js +++ b/test/statsCases/chunks-development/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: "./index", diff --git a/test/statsCases/chunks/webpack.config.js b/test/statsCases/chunks/webpack.config.js index c9d18ec9b..77e3fd4f9 100644 --- a/test/statsCases/chunks/webpack.config.js +++ b/test/statsCases/chunks/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/circular-correctness/webpack.config.js b/test/statsCases/circular-correctness/webpack.config.js index e23a3870e..ca513b287 100644 --- a/test/statsCases/circular-correctness/webpack.config.js +++ b/test/statsCases/circular-correctness/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/color-disabled/webpack.config.js b/test/statsCases/color-disabled/webpack.config.js index 1ef4d9dca..5d1378233 100644 --- a/test/statsCases/color-disabled/webpack.config.js +++ b/test/statsCases/color-disabled/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/color-enabled-custom/webpack.config.js b/test/statsCases/color-enabled-custom/webpack.config.js index 92a8a2296..a8cf451ed 100644 --- a/test/statsCases/color-enabled-custom/webpack.config.js +++ b/test/statsCases/color-enabled-custom/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/color-enabled/webpack.config.js b/test/statsCases/color-enabled/webpack.config.js index e2970ecca..8db94e736 100644 --- a/test/statsCases/color-enabled/webpack.config.js +++ b/test/statsCases/color-enabled/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/commons-chunk-min-size-0/webpack.config.js b/test/statsCases/commons-chunk-min-size-0/webpack.config.js index 7a7759a70..a68deca16 100644 --- a/test/statsCases/commons-chunk-min-size-0/webpack.config.js +++ b/test/statsCases/commons-chunk-min-size-0/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/commons-chunk-min-size-Infinity/webpack.config.js b/test/statsCases/commons-chunk-min-size-Infinity/webpack.config.js index 38d753566..b4b0364a3 100644 --- a/test/statsCases/commons-chunk-min-size-Infinity/webpack.config.js +++ b/test/statsCases/commons-chunk-min-size-Infinity/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/concat-and-sideeffects/webpack.config.js b/test/statsCases/concat-and-sideeffects/webpack.config.js index 82aa88389..14ef0be99 100644 --- a/test/statsCases/concat-and-sideeffects/webpack.config.js +++ b/test/statsCases/concat-and-sideeffects/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/dll-reference-plugin-issue-7624-error/webpack.config.js b/test/statsCases/dll-reference-plugin-issue-7624-error/webpack.config.js index aa0403c26..66cb016c3 100644 --- a/test/statsCases/dll-reference-plugin-issue-7624-error/webpack.config.js +++ b/test/statsCases/dll-reference-plugin-issue-7624-error/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./entry.js", diff --git a/test/statsCases/dll-reference-plugin-issue-7624/webpack.config.js b/test/statsCases/dll-reference-plugin-issue-7624/webpack.config.js index cfd2bfe93..d23d0a6a9 100644 --- a/test/statsCases/dll-reference-plugin-issue-7624/webpack.config.js +++ b/test/statsCases/dll-reference-plugin-issue-7624/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./entry.js", diff --git a/test/statsCases/entry-filename/webpack.config.js b/test/statsCases/entry-filename/webpack.config.js index d04fbcd00..c5f9cf1a8 100644 --- a/test/statsCases/entry-filename/webpack.config.js +++ b/test/statsCases/entry-filename/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/exclude-with-loader/webpack.config.js b/test/statsCases/exclude-with-loader/webpack.config.js index 46ce565d5..973691d20 100644 --- a/test/statsCases/exclude-with-loader/webpack.config.js +++ b/test/statsCases/exclude-with-loader/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/external/webpack.config.js b/test/statsCases/external/webpack.config.js index 24daca96b..9dcff537b 100644 --- a/test/statsCases/external/webpack.config.js +++ b/test/statsCases/external/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/graph-correctness-entries/webpack.config.js b/test/statsCases/graph-correctness-entries/webpack.config.js index 3e7aec2ab..9730d47fd 100644 --- a/test/statsCases/graph-correctness-entries/webpack.config.js +++ b/test/statsCases/graph-correctness-entries/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/graph-correctness-modules/webpack.config.js b/test/statsCases/graph-correctness-modules/webpack.config.js index 3e7aec2ab..9730d47fd 100644 --- a/test/statsCases/graph-correctness-modules/webpack.config.js +++ b/test/statsCases/graph-correctness-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/graph-roots/webpack.config.js b/test/statsCases/graph-roots/webpack.config.js index 2fb6a9a36..2a5d6a4b7 100644 --- a/test/statsCases/graph-roots/webpack.config.js +++ b/test/statsCases/graph-roots/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: "./index.js", diff --git a/test/statsCases/immutable/webpack.config.js b/test/statsCases/immutable/webpack.config.js index 99361f45e..2bbf3aa2c 100644 --- a/test/statsCases/immutable/webpack.config.js +++ b/test/statsCases/immutable/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: "./index.js", diff --git a/test/statsCases/import-context-filter/webpack.config.js b/test/statsCases/import-context-filter/webpack.config.js index 070e43028..250f8f5e6 100644 --- a/test/statsCases/import-context-filter/webpack.config.js +++ b/test/statsCases/import-context-filter/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/import-weak/webpack.config.js b/test/statsCases/import-weak/webpack.config.js index 070e43028..250f8f5e6 100644 --- a/test/statsCases/import-weak/webpack.config.js +++ b/test/statsCases/import-weak/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/import-with-invalid-options-comments/webpack.config.js b/test/statsCases/import-with-invalid-options-comments/webpack.config.js index 4a36fba10..29bbb8551 100644 --- a/test/statsCases/import-with-invalid-options-comments/webpack.config.js +++ b/test/statsCases/import-with-invalid-options-comments/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/logging/webpack.config.js b/test/statsCases/logging/webpack.config.js index 8d89f8f6a..e3e086af9 100644 --- a/test/statsCases/logging/webpack.config.js +++ b/test/statsCases/logging/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/max-modules-default/webpack.config.js b/test/statsCases/max-modules-default/webpack.config.js index 069d6d62d..30e8de2c0 100644 --- a/test/statsCases/max-modules-default/webpack.config.js +++ b/test/statsCases/max-modules-default/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/max-modules/webpack.config.js b/test/statsCases/max-modules/webpack.config.js index c2f9c5fdd..9336217b1 100644 --- a/test/statsCases/max-modules/webpack.config.js +++ b/test/statsCases/max-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-assets/webpack.config.js b/test/statsCases/module-assets/webpack.config.js index ce6ab4d08..2f4363315 100644 --- a/test/statsCases/module-assets/webpack.config.js +++ b/test/statsCases/module-assets/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-deduplication-named/webpack.config.js b/test/statsCases/module-deduplication-named/webpack.config.js index 039f03011..5d2d91f08 100644 --- a/test/statsCases/module-deduplication-named/webpack.config.js +++ b/test/statsCases/module-deduplication-named/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/module-deduplication/webpack.config.js b/test/statsCases/module-deduplication/webpack.config.js index 039f03011..5d2d91f08 100644 --- a/test/statsCases/module-deduplication/webpack.config.js +++ b/test/statsCases/module-deduplication/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/module-not-found-error/webpack.config.js b/test/statsCases/module-not-found-error/webpack.config.js index 7f65a6052..04f99c809 100644 --- a/test/statsCases/module-not-found-error/webpack.config.js +++ b/test/statsCases/module-not-found-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-reasons/webpack.config.js b/test/statsCases/module-reasons/webpack.config.js index 3ff01eb5c..db7b8b180 100644 --- a/test/statsCases/module-reasons/webpack.config.js +++ b/test/statsCases/module-reasons/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-trace-disabled-in-error/webpack.config.js b/test/statsCases/module-trace-disabled-in-error/webpack.config.js index cb5614a81..c860373b9 100644 --- a/test/statsCases/module-trace-disabled-in-error/webpack.config.js +++ b/test/statsCases/module-trace-disabled-in-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/module-trace-enabled-in-error/webpack.config.js b/test/statsCases/module-trace-enabled-in-error/webpack.config.js index d282e7799..f4751ec1b 100644 --- a/test/statsCases/module-trace-enabled-in-error/webpack.config.js +++ b/test/statsCases/module-trace-enabled-in-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/named-chunks-plugin-async/webpack.config.js b/test/statsCases/named-chunks-plugin-async/webpack.config.js index 9464080e2..e43559383 100644 --- a/test/statsCases/named-chunks-plugin-async/webpack.config.js +++ b/test/statsCases/named-chunks-plugin-async/webpack.config.js @@ -1,37 +1,15 @@ "use strict"; -const webpack = require("../../../"); -const RequestShortener = require("../../../lib/RequestShortener"); -const { compareModulesByIdentifier } = require("../../../lib/util/comparators"); +const { + ids: { NamedChunkIdsPlugin } +} = require("../../../"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", optimization: { chunkIds: false }, entry: { entry: "./entry" }, - plugins: [ - new webpack.ids.NamedChunkIdsPlugin((chunk, { chunkGraph }) => { - if (chunk.name) { - return chunk.name; - } - const chunkModulesToName = chunk => - Array.from( - chunkGraph.getOrderedChunkModulesIterable( - chunk, - compareModulesByIdentifier - ), - mod => { - const rs = new RequestShortener(mod.context); - return rs.shorten(mod.request).replace(/[./\\]/g, "_"); - } - ).join("-"); - - if (chunkGraph.getNumberOfChunkModules(chunk) > 0) { - return `chunk-containing-${chunkModulesToName(chunk)}`; - } - - return null; - }) - ] + plugins: [new NamedChunkIdsPlugin()] }; diff --git a/test/statsCases/named-chunks-plugin/webpack.config.js b/test/statsCases/named-chunks-plugin/webpack.config.js index 25b43be57..b358371ed 100644 --- a/test/statsCases/named-chunks-plugin/webpack.config.js +++ b/test/statsCases/named-chunks-plugin/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/no-emit-on-errors-plugin-with-child-error/TestChildCompilationFailurePlugin.js b/test/statsCases/no-emit-on-errors-plugin-with-child-error/TestChildCompilationFailurePlugin.js index 2c5f1ce1a..886ccc49b 100644 --- a/test/statsCases/no-emit-on-errors-plugin-with-child-error/TestChildCompilationFailurePlugin.js +++ b/test/statsCases/no-emit-on-errors-plugin-with-child-error/TestChildCompilationFailurePlugin.js @@ -1,6 +1,6 @@ "use strict"; -var EntryPlugin = require("../../../lib/EntryPlugin"); +var EntryPlugin = require("../../../").EntryPlugin; /** * Runs a child compilation which produces an error in order to test that NoEmitErrorsPlugin diff --git a/test/statsCases/no-emit-on-errors-plugin-with-child-error/webpack.config.js b/test/statsCases/no-emit-on-errors-plugin-with-child-error/webpack.config.js index 427b1b0a6..f63e085ff 100644 --- a/test/statsCases/no-emit-on-errors-plugin-with-child-error/webpack.config.js +++ b/test/statsCases/no-emit-on-errors-plugin-with-child-error/webpack.config.js @@ -3,6 +3,7 @@ var NoEmitOnErrorsPlugin = require("../../../").NoEmitOnErrorsPlugin; var TestChildCompilationFailurePlugin = require("./TestChildCompilationFailurePlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { entry: "./index", output: { diff --git a/test/statsCases/optimize-chunks/webpack.config.js b/test/statsCases/optimize-chunks/webpack.config.js index 8c46b3ed4..3e8414aa5 100644 --- a/test/statsCases/optimize-chunks/webpack.config.js +++ b/test/statsCases/optimize-chunks/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/parse-error/webpack.config.js b/test/statsCases/parse-error/webpack.config.js index 1bc2a16d0..a5a7c03fe 100644 --- a/test/statsCases/parse-error/webpack.config.js +++ b/test/statsCases/parse-error/webpack.config.js @@ -1,5 +1,6 @@ "use strict"; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/performance-disabled/webpack.config.js b/test/statsCases/performance-disabled/webpack.config.js index 801f4a8da..49d169952 100644 --- a/test/statsCases/performance-disabled/webpack.config.js +++ b/test/statsCases/performance-disabled/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/performance-error/webpack.config.js b/test/statsCases/performance-error/webpack.config.js index 285444ea3..2a53b9837 100644 --- a/test/statsCases/performance-error/webpack.config.js +++ b/test/statsCases/performance-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/performance-no-async-chunks-shown/webpack.config.js b/test/statsCases/performance-no-async-chunks-shown/webpack.config.js index d015fde10..1147c3f18 100644 --- a/test/statsCases/performance-no-async-chunks-shown/webpack.config.js +++ b/test/statsCases/performance-no-async-chunks-shown/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/performance-no-hints/webpack.config.js b/test/statsCases/performance-no-hints/webpack.config.js index 1aed48513..793fe03db 100644 --- a/test/statsCases/performance-no-hints/webpack.config.js +++ b/test/statsCases/performance-no-hints/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/performance-oversize-limit-error/webpack.config.js b/test/statsCases/performance-oversize-limit-error/webpack.config.js index 9e37f0aef..79b0915ec 100644 --- a/test/statsCases/performance-oversize-limit-error/webpack.config.js +++ b/test/statsCases/performance-oversize-limit-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/prefetch-preload-mixed/webpack.config.js b/test/statsCases/prefetch-preload-mixed/webpack.config.js index f5306974b..d864bc6af 100644 --- a/test/statsCases/prefetch-preload-mixed/webpack.config.js +++ b/test/statsCases/prefetch-preload-mixed/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/prefetch/webpack.config.js b/test/statsCases/prefetch/webpack.config.js index 6c11dc3dd..3d0b86864 100644 --- a/test/statsCases/prefetch/webpack.config.js +++ b/test/statsCases/prefetch/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preload/webpack.config.js b/test/statsCases/preload/webpack.config.js index 17dba56db..98ab976d6 100644 --- a/test/statsCases/preload/webpack.config.js +++ b/test/statsCases/preload/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-detailed/webpack.config.js b/test/statsCases/preset-detailed/webpack.config.js index 27d988981..b3f4ace1f 100644 --- a/test/statsCases/preset-detailed/webpack.config.js +++ b/test/statsCases/preset-detailed/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-errors-only-error/webpack.config.js b/test/statsCases/preset-errors-only-error/webpack.config.js index 0f4a73577..a07357dda 100644 --- a/test/statsCases/preset-errors-only-error/webpack.config.js +++ b/test/statsCases/preset-errors-only-error/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-errors-only/webpack.config.js b/test/statsCases/preset-errors-only/webpack.config.js index 7f65a6052..04f99c809 100644 --- a/test/statsCases/preset-errors-only/webpack.config.js +++ b/test/statsCases/preset-errors-only/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-errors-warnings/webpack.config.js b/test/statsCases/preset-errors-warnings/webpack.config.js index 7697cda4e..68ce0928c 100644 --- a/test/statsCases/preset-errors-warnings/webpack.config.js +++ b/test/statsCases/preset-errors-warnings/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-minimal-simple/webpack.config.js b/test/statsCases/preset-minimal-simple/webpack.config.js index 53931799c..c4fb6fdc0 100644 --- a/test/statsCases/preset-minimal-simple/webpack.config.js +++ b/test/statsCases/preset-minimal-simple/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-minimal/webpack.config.js b/test/statsCases/preset-minimal/webpack.config.js index 85a5515e2..7ba0caf0a 100644 --- a/test/statsCases/preset-minimal/webpack.config.js +++ b/test/statsCases/preset-minimal/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-none-error/webpack.config.js b/test/statsCases/preset-none-error/webpack.config.js index e99589235..fc5edb6b4 100644 --- a/test/statsCases/preset-none-error/webpack.config.js +++ b/test/statsCases/preset-none-error/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-none/webpack.config.js b/test/statsCases/preset-none/webpack.config.js index 750ca8a51..54cc4b2d3 100644 --- a/test/statsCases/preset-none/webpack.config.js +++ b/test/statsCases/preset-none/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/webpack.config.js b/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/webpack.config.js index a15145c2a..919599037 100644 --- a/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/webpack.config.js +++ b/test/statsCases/preset-normal-performance-ensure-filter-sourcemaps/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", devtool: "source-map", diff --git a/test/statsCases/preset-normal-performance/webpack.config.js b/test/statsCases/preset-normal-performance/webpack.config.js index bc76bd698..1de6394e5 100644 --- a/test/statsCases/preset-normal-performance/webpack.config.js +++ b/test/statsCases/preset-normal-performance/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-normal/webpack.config.js b/test/statsCases/preset-normal/webpack.config.js index ae534acc1..6b76a5c3b 100644 --- a/test/statsCases/preset-normal/webpack.config.js +++ b/test/statsCases/preset-normal/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/preset-verbose/webpack.config.js b/test/statsCases/preset-verbose/webpack.config.js index b4e977e78..912534b99 100644 --- a/test/statsCases/preset-verbose/webpack.config.js +++ b/test/statsCases/preset-verbose/webpack.config.js @@ -1,5 +1,6 @@ const LogTestPlugin = require("../../helpers/LogTestPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/resolve-plugin-context/webpack.config.js b/test/statsCases/resolve-plugin-context/webpack.config.js index 5d7be1fe4..34ed2f09c 100644 --- a/test/statsCases/resolve-plugin-context/webpack.config.js +++ b/test/statsCases/resolve-plugin-context/webpack.config.js @@ -1,5 +1,6 @@ var ResolvePackageFromRootPlugin = require("./ResolvePackageFromRootPlugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/reverse-sort-modules/webpack.config.js b/test/statsCases/reverse-sort-modules/webpack.config.js index f1f2620ec..58fb498c8 100644 --- a/test/statsCases/reverse-sort-modules/webpack.config.js +++ b/test/statsCases/reverse-sort-modules/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/runtime-chunk-issue-7382/webpack.config.js b/test/statsCases/runtime-chunk-issue-7382/webpack.config.js index ba14189a1..b44443f50 100644 --- a/test/statsCases/runtime-chunk-issue-7382/webpack.config.js +++ b/test/statsCases/runtime-chunk-issue-7382/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/statsCases/runtime-chunk-single/webpack.config.js b/test/statsCases/runtime-chunk-single/webpack.config.js index d221181ec..f5b3476f7 100644 --- a/test/statsCases/runtime-chunk-single/webpack.config.js +++ b/test/statsCases/runtime-chunk-single/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/statsCases/runtime-chunk/webpack.config.js b/test/statsCases/runtime-chunk/webpack.config.js index 0abe241e7..8bbebaa7b 100644 --- a/test/statsCases/runtime-chunk/webpack.config.js +++ b/test/statsCases/runtime-chunk/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "development", entry: { diff --git a/test/statsCases/scope-hoisting-bailouts/webpack.config.js b/test/statsCases/scope-hoisting-bailouts/webpack.config.js index 780993d09..61a8acc6d 100644 --- a/test/statsCases/scope-hoisting-bailouts/webpack.config.js +++ b/test/statsCases/scope-hoisting-bailouts/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/side-effects-issue-7428/webpack.config.js b/test/statsCases/side-effects-issue-7428/webpack.config.js index ad3db197d..7d6f086d6 100644 --- a/test/statsCases/side-effects-issue-7428/webpack.config.js +++ b/test/statsCases/side-effects-issue-7428/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "none", entry: "./main.js", diff --git a/test/statsCases/side-effects-simple-unused/webpack.config.js b/test/statsCases/side-effects-simple-unused/webpack.config.js index 3f2af3b91..f41626e10 100644 --- a/test/statsCases/side-effects-simple-unused/webpack.config.js +++ b/test/statsCases/side-effects-simple-unused/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/simple-more-info/webpack.config.js b/test/statsCases/simple-more-info/webpack.config.js index 3ac8e8d8b..b26ccc2f4 100644 --- a/test/statsCases/simple-more-info/webpack.config.js +++ b/test/statsCases/simple-more-info/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/split-chunks-automatic-name/webpack.config.js b/test/statsCases/split-chunks-automatic-name/webpack.config.js index 7f4361afe..fc73caaf9 100644 --- a/test/statsCases/split-chunks-automatic-name/webpack.config.js +++ b/test/statsCases/split-chunks-automatic-name/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { name: "production", mode: "production", diff --git a/test/statsCases/split-chunks-chunk-name/webpack.config.js b/test/statsCases/split-chunks-chunk-name/webpack.config.js index c9bbde44b..eedc456bb 100644 --- a/test/statsCases/split-chunks-chunk-name/webpack.config.js +++ b/test/statsCases/split-chunks-chunk-name/webpack.config.js @@ -10,6 +10,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/split-chunks-combinations/webpack.config.js b/test/statsCases/split-chunks-combinations/webpack.config.js index 505244e9c..da6f5b22d 100644 --- a/test/statsCases/split-chunks-combinations/webpack.config.js +++ b/test/statsCases/split-chunks-combinations/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/split-chunks-issue-6413/webpack.config.js b/test/statsCases/split-chunks-issue-6413/webpack.config.js index dc64cbc5c..ba523d3f0 100644 --- a/test/statsCases/split-chunks-issue-6413/webpack.config.js +++ b/test/statsCases/split-chunks-issue-6413/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { name: "default", mode: "production", diff --git a/test/statsCases/split-chunks-issue-6696/webpack.config.js b/test/statsCases/split-chunks-issue-6696/webpack.config.js index c7e0a3547..5cdafb245 100644 --- a/test/statsCases/split-chunks-issue-6696/webpack.config.js +++ b/test/statsCases/split-chunks-issue-6696/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { name: "default", mode: "production", diff --git a/test/statsCases/split-chunks-issue-7401/webpack.config.js b/test/statsCases/split-chunks-issue-7401/webpack.config.js index c0d98f4a1..891845a83 100644 --- a/test/statsCases/split-chunks-issue-7401/webpack.config.js +++ b/test/statsCases/split-chunks-issue-7401/webpack.config.js @@ -10,6 +10,7 @@ const stats = { chunkGroups: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { name: "default", mode: "production", diff --git a/test/statsCases/split-chunks-keep-remaining-size/webpack.config.js b/test/statsCases/split-chunks-keep-remaining-size/webpack.config.js index c9bbde44b..eedc456bb 100644 --- a/test/statsCases/split-chunks-keep-remaining-size/webpack.config.js +++ b/test/statsCases/split-chunks-keep-remaining-size/webpack.config.js @@ -10,6 +10,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/split-chunks-prefer-bigger-splits/webpack.config.js b/test/statsCases/split-chunks-prefer-bigger-splits/webpack.config.js index 628d02a95..49a833b9f 100644 --- a/test/statsCases/split-chunks-prefer-bigger-splits/webpack.config.js +++ b/test/statsCases/split-chunks-prefer-bigger-splits/webpack.config.js @@ -9,6 +9,7 @@ const stats = { entrypoints: true, modules: false }; +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: { diff --git a/test/statsCases/tree-shaking/webpack.config.js b/test/statsCases/tree-shaking/webpack.config.js index 5de0fe940..018c4209c 100644 --- a/test/statsCases/tree-shaking/webpack.config.js +++ b/test/statsCases/tree-shaking/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/warnings-terser/webpack.config.js b/test/statsCases/warnings-terser/webpack.config.js index 19487004a..ab35f8345 100644 --- a/test/statsCases/warnings-terser/webpack.config.js +++ b/test/statsCases/warnings-terser/webpack.config.js @@ -1,4 +1,5 @@ const TerserPlugin = require("terser-webpack-plugin"); +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/statsCases/wasm-explorer-examples-sync/webpack.config.js b/test/statsCases/wasm-explorer-examples-sync/webpack.config.js index ae6b26888..9efd5d0c8 100644 --- a/test/statsCases/wasm-explorer-examples-sync/webpack.config.js +++ b/test/statsCases/wasm-explorer-examples-sync/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../").Configuration} */ module.exports = { mode: "production", entry: "./index", diff --git a/test/watchCases/cache/managedPath/webpack.config.js b/test/watchCases/cache/managedPath/webpack.config.js index 124df2152..fbaa23d88 100644 --- a/test/watchCases/cache/managedPath/webpack.config.js +++ b/test/watchCases/cache/managedPath/webpack.config.js @@ -1,5 +1,6 @@ const path = require("path"); +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "development", cache: { diff --git a/test/watchCases/long-term-caching/issue-8766/webpack.config.js b/test/watchCases/long-term-caching/issue-8766/webpack.config.js index 8ee17130d..b3c40d339 100644 --- a/test/watchCases/long-term-caching/issue-8766/webpack.config.js +++ b/test/watchCases/long-term-caching/issue-8766/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production", output: { diff --git a/test/watchCases/plugins/automatic-prefetch-plugin/webpack.config.js b/test/watchCases/plugins/automatic-prefetch-plugin/webpack.config.js index a33728b6c..70e0b4f38 100644 --- a/test/watchCases/plugins/automatic-prefetch-plugin/webpack.config.js +++ b/test/watchCases/plugins/automatic-prefetch-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [new webpack.AutomaticPrefetchPlugin()] }; diff --git a/test/watchCases/plugins/define-plugin/webpack.config.js b/test/watchCases/plugins/define-plugin/webpack.config.js index ffca20082..3aa0f9f09 100644 --- a/test/watchCases/plugins/define-plugin/webpack.config.js +++ b/test/watchCases/plugins/define-plugin/webpack.config.js @@ -5,6 +5,7 @@ const valueFile = path.resolve( __dirname, "../../../js/watch-src/plugins/define-plugin/value.txt" ); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DefinePlugin({ diff --git a/test/watchCases/plugins/dll-reference-plugin/webpack.config.js b/test/watchCases/plugins/dll-reference-plugin/webpack.config.js index 14a6d08cc..dd41f3827 100644 --- a/test/watchCases/plugins/dll-reference-plugin/webpack.config.js +++ b/test/watchCases/plugins/dll-reference-plugin/webpack.config.js @@ -1,4 +1,5 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [ new webpack.DllReferencePlugin({ diff --git a/test/watchCases/plugins/module-concatenation-plugin/webpack.config.js b/test/watchCases/plugins/module-concatenation-plugin/webpack.config.js index b913c78ab..dffc81bba 100644 --- a/test/watchCases/plugins/module-concatenation-plugin/webpack.config.js +++ b/test/watchCases/plugins/module-concatenation-plugin/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { mode: "production" }; diff --git a/test/watchCases/plugins/watch-ignore-plugin/webpack.config.js b/test/watchCases/plugins/watch-ignore-plugin/webpack.config.js index 81c7a169c..814c0459e 100644 --- a/test/watchCases/plugins/watch-ignore-plugin/webpack.config.js +++ b/test/watchCases/plugins/watch-ignore-plugin/webpack.config.js @@ -1,5 +1,6 @@ var webpack = require("../../../../"); +/** @type {import("../../../../").Configuration} */ module.exports = { plugins: [new webpack.WatchIgnorePlugin({ paths: [/file\.js$/, /foo$/] })] }; diff --git a/test/watchCases/runtime/dynamic-import/webpack.config.js b/test/watchCases/runtime/dynamic-import/webpack.config.js index 019baa474..b536f6cfe 100644 --- a/test/watchCases/runtime/dynamic-import/webpack.config.js +++ b/test/watchCases/runtime/dynamic-import/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { chunkFilename: "[name].[chunkhash].js" diff --git a/test/watchCases/runtime/static-import/webpack.config.js b/test/watchCases/runtime/static-import/webpack.config.js index 22f0a470f..c95208c17 100644 --- a/test/watchCases/runtime/static-import/webpack.config.js +++ b/test/watchCases/runtime/static-import/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { output: { filename: "[name].js" diff --git a/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js b/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js index 59e948b12..c939ba33f 100644 --- a/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js +++ b/test/watchCases/scope-hoisting/caching-inner-source/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { concatenateModules: true diff --git a/test/watchCases/side-effects/issue-7400/webpack.config.js b/test/watchCases/side-effects/issue-7400/webpack.config.js index 2bd35aa7c..58251b86a 100644 --- a/test/watchCases/side-effects/issue-7400/webpack.config.js +++ b/test/watchCases/side-effects/issue-7400/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { optimization: { sideEffects: true diff --git a/test/watchCases/wasm/caching/webpack.config.js b/test/watchCases/wasm/caching/webpack.config.js index 20364aea7..d2aff73f7 100644 --- a/test/watchCases/wasm/caching/webpack.config.js +++ b/test/watchCases/wasm/caching/webpack.config.js @@ -1,3 +1,4 @@ +/** @type {import("../../../../").Configuration} */ module.exports = { experiments: { asyncWebAssembly: true diff --git a/tsconfig.test.json b/tsconfig.test.json index 8c9e7177c..23a3c6e6f 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -12,5 +12,5 @@ "types": ["node", "jest"], "esModuleInterop": true }, - "include": ["test/**/webpack.config.js", "types.d.ts"] + "include": ["test/**/webpack.config.js", "declarations.test.d.ts"] } diff --git a/types.d.ts b/types.d.ts index 954a27e5f..ed3f44644 100644 --- a/types.d.ts +++ b/types.d.ts @@ -75,7 +75,7 @@ import { SyncWaterfallHook } from "tapable"; -declare namespace internals { +declare namespace webpack { export class AbstractLibraryPlugin { constructor(__0: { /** @@ -107,27 +107,27 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; - parseOptions(library: internals.LibraryOptions): false | T; + apply(compiler: webpack.Compiler): void; + parseOptions(library: webpack.LibraryOptions): false | T; finishEntryModule( - module: internals.Module, - libraryContext: internals.LibraryContext + module: webpack.Module, + libraryContext: webpack.LibraryContext ): void; runtimeRequirements( - chunk: internals.Chunk, + chunk: webpack.Chunk, set: Set, - libraryContext: internals.LibraryContext + libraryContext: webpack.LibraryContext ): void; render( - source: internals.Source, - renderContext: internals.RenderContextJavascriptModulesPlugin, - libraryContext: internals.LibraryContext - ): internals.Source; + source: webpack.Source, + renderContext: webpack.RenderContextJavascriptModulesPlugin, + libraryContext: webpack.LibraryContext + ): webpack.Source; chunkHash( - chunk: internals.Chunk, - hash: internals.Hash, - chunkHashContext: internals.ChunkHashContext, - libraryContext: internals.LibraryContext + chunk: webpack.Chunk, + hash: webpack.Hash, + chunkHashContext: webpack.ChunkHashContext, + libraryContext: webpack.LibraryContext ): void; } export class AggressiveMergingPlugin { @@ -137,17 +137,17 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class AggressiveSplittingPlugin { - constructor(options?: internals.AggressiveSplittingPluginOptions); - options: internals.AggressiveSplittingPluginOptions; + constructor(options?: webpack.AggressiveSplittingPluginOptions); + options: webpack.AggressiveSplittingPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; - static wasChunkRecorded(chunk: internals.Chunk): boolean; + apply(compiler: webpack.Compiler): void; + static wasChunkRecorded(chunk: webpack.Chunk): boolean; } /** @@ -181,7 +181,7 @@ declare namespace internals { description: string; simpleType: "string" | "number" | "boolean"; multiple: boolean; - configs: Array; + configs: Array; } export interface ArgumentConfig { description: string; @@ -206,17 +206,17 @@ declare namespace internals { /** * source of the asset */ - source: internals.Source; + source: webpack.Source; /** * info about the asset */ - info: internals.AssetInfo; + info: webpack.AssetInfo; } export interface AssetEmittedInfo { content: Buffer; - source: internals.Source; - compilation: internals.Compilation; + source: webpack.Source; + compilation: webpack.Compilation; outputPath: string; targetPath: string; } @@ -243,21 +243,16 @@ declare namespace internals { } export type AssetModuleFilename = | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); - export abstract class AsyncDependenciesBlock extends internals.DependenciesBlock { + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); + export abstract class AsyncDependenciesBlock extends webpack.DependenciesBlock { groupOptions: { preloadOrder?: number; prefetchOrder?: number; name: string; }; - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation; + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; request: string; - parent: internals.DependenciesBlock; + parent: webpack.DependenciesBlock; chunkName: string; module: any; } @@ -269,7 +264,7 @@ declare namespace internals { started: SyncHook<[T], void>; result: SyncHook<[T, Error, R], void>; }; - add(item: T, callback: internals.CallbackCompiler): void; + add(item: T, callback: webpack.CallbackCompiler): void; invalidate(item: T): void; stop(): void; increaseParallelism(): void; @@ -285,11 +280,11 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; renderModule(module?: any, renderContext?: any, hooks?: any): any; static getCompilationHooks( - compilation: internals.Compilation - ): internals.CompilationHooksAsyncWebAssemblyModulesPlugin; + compilation: webpack.Compilation + ): webpack.CompilationHooksAsyncWebAssemblyModulesPlugin; } export class AutomaticPrefetchPlugin { constructor(); @@ -297,40 +292,38 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export type AuxiliaryComment = - | string - | internals.LibraryCustomUmdCommentObject; + export type AuxiliaryComment = string | webpack.LibraryCustomUmdCommentObject; export class BannerPlugin { constructor( options: | string - | internals.BannerPluginOptions + | webpack.BannerPluginOptions | ((data: { hash: string; - chunk: internals.Chunk; + chunk: webpack.Chunk; filename: string; }) => string) ); - options: internals.BannerPluginOptions; + options: webpack.BannerPluginOptions; banner: (data: { hash: string; - chunk: internals.Chunk; + chunk: webpack.Chunk; filename: string; }) => string; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type BannerPluginArgument = | string - | internals.BannerPluginOptions + | webpack.BannerPluginOptions | ((data: { hash: string; - chunk: internals.Chunk; + chunk: webpack.Chunk; filename: string; }) => string); export interface BannerPluginOptions { @@ -341,7 +334,7 @@ declare namespace internals { | string | ((data: { hash: string; - chunk: internals.Chunk; + chunk: webpack.Chunk; filename: string; }) => string); @@ -408,38 +401,38 @@ declare namespace internals { isFalsy(): boolean; asBool(): any; asString(): any; - setString(string?: any): internals.BasicEvaluatedExpression; - setNull(): internals.BasicEvaluatedExpression; - setNumber(number?: any): internals.BasicEvaluatedExpression; - setBigInt(bigint?: any): internals.BasicEvaluatedExpression; - setBoolean(bool?: any): internals.BasicEvaluatedExpression; - setRegExp(regExp?: any): internals.BasicEvaluatedExpression; + setString(string?: any): webpack.BasicEvaluatedExpression; + setNull(): webpack.BasicEvaluatedExpression; + setNumber(number?: any): webpack.BasicEvaluatedExpression; + setBigInt(bigint?: any): webpack.BasicEvaluatedExpression; + setBoolean(bool?: any): webpack.BasicEvaluatedExpression; + setRegExp(regExp?: any): webpack.BasicEvaluatedExpression; setIdentifier( identifier?: any, rootInfo?: any, getMembers?: any - ): internals.BasicEvaluatedExpression; + ): webpack.BasicEvaluatedExpression; setWrapped( prefix?: any, postfix?: any, innerExpressions?: any - ): internals.BasicEvaluatedExpression; - setOptions(options?: any): internals.BasicEvaluatedExpression; - addOptions(options?: any): internals.BasicEvaluatedExpression; - setItems(items?: any): internals.BasicEvaluatedExpression; - setArray(array?: any): internals.BasicEvaluatedExpression; + ): webpack.BasicEvaluatedExpression; + setOptions(options?: any): webpack.BasicEvaluatedExpression; + addOptions(options?: any): webpack.BasicEvaluatedExpression; + setItems(items?: any): webpack.BasicEvaluatedExpression; + setArray(array?: any): webpack.BasicEvaluatedExpression; setTemplateString( quasis?: any, parts?: any, kind?: any - ): internals.BasicEvaluatedExpression; + ): webpack.BasicEvaluatedExpression; templateStringKind: any; - setTruthy(): internals.BasicEvaluatedExpression; - setFalsy(): internals.BasicEvaluatedExpression; - setRange(range?: any): internals.BasicEvaluatedExpression; - setExpression(expression?: any): internals.BasicEvaluatedExpression; + setTruthy(): webpack.BasicEvaluatedExpression; + setFalsy(): webpack.BasicEvaluatedExpression; + setRange(range?: any): webpack.BasicEvaluatedExpression; + setExpression(expression?: any): webpack.BasicEvaluatedExpression; } - export abstract class ByTypeGenerator extends internals.Generator { + export abstract class ByTypeGenerator extends webpack.Generator { map: any; } export class Cache { @@ -448,12 +441,12 @@ declare namespace internals { get: AsyncSeriesBailHook< [ string, - internals.Etag, - Array<(result: any, stats: internals.CallbackCache) => void> + webpack.Etag, + Array<(result: any, stats: webpack.CallbackCache) => void> ], any >; - store: AsyncParallelHook<[string, internals.Etag, any]>; + store: AsyncParallelHook<[string, webpack.Etag, any]>; storeBuildDependencies: AsyncParallelHook<[Iterable]>; beginIdle: SyncHook<[], void>; endIdle: AsyncParallelHook<[]>; @@ -461,14 +454,14 @@ declare namespace internals { }; get( identifier: string, - etag: internals.Etag, - callback: internals.CallbackCache + etag: webpack.Etag, + callback: webpack.CallbackCache ): void; store( identifier: string, - etag: internals.Etag, + etag: webpack.Etag, data: T, - callback: internals.CallbackCache + callback: webpack.CallbackCache ): void; /** @@ -476,11 +469,11 @@ declare namespace internals { */ storeBuildDependencies( dependencies: Iterable, - callback: internals.CallbackCache + callback: webpack.CallbackCache ): void; beginIdle(): void; - endIdle(callback: internals.CallbackCache): void; - shutdown(callback: internals.CallbackCache): void; + endIdle(callback: webpack.CallbackCache): void; + shutdown(callback: webpack.CallbackCache): void; static STAGE_MEMORY: number; static STAGE_DEFAULT: number; static STAGE_DISK: number; @@ -490,11 +483,11 @@ declare namespace internals { key?: string; priority?: number; getName?: ( - module?: internals.Module, - chunks?: Array, + module?: webpack.Module, + chunks?: Array, key?: string ) => string; - chunksFilter?: (chunk: internals.Chunk) => boolean; + chunksFilter?: (chunk: webpack.Chunk) => boolean; enforce?: boolean; minSize: Record; minRemainingSize: Record; @@ -505,26 +498,26 @@ declare namespace internals { maxInitialRequests?: number; filename?: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); idHint?: string; automaticNameDelimiter: string; reuseExistingChunk?: boolean; } export interface CacheGroupsContext { - moduleGraph: internals.ModuleGraph; - chunkGraph: internals.ChunkGraph; + moduleGraph: webpack.ModuleGraph; + chunkGraph: webpack.ChunkGraph; } export type CacheOptions = | boolean - | internals.MemoryCacheOptions - | internals.FileCacheOptions; + | webpack.MemoryCacheOptions + | webpack.FileCacheOptions; export type CacheOptionsNormalized = | false - | internals.MemoryCacheOptions - | internals.FileCacheOptions; + | webpack.MemoryCacheOptions + | webpack.FileCacheOptions; export type CallExpression = SimpleCallExpression | NewExpression; export interface CallbackCache { - (err?: internals.WebpackError, stats?: T): void; + (err?: webpack.WebpackError, stats?: T): void; } export interface CallbackCompiler { (err?: Error, result?: T): any; @@ -532,16 +525,17 @@ declare namespace internals { export interface CallbackWebpack { (err?: Error, stats?: T): void; } - export abstract class Chunk { + export class Chunk { + constructor(name?: string); id: string | number; ids: Array; debugId: number; name: string; - idNameHints: internals.SortableSet; + idNameHints: webpack.SortableSet; preventIntegration: boolean; filenameTemplate: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); files: Set; auxiliaryFiles: Set; rendered: boolean; @@ -550,258 +544,248 @@ declare namespace internals { renderedHash: string; chunkReason: string; extraAsync: boolean; - readonly entryModule: internals.Module; + readonly entryModule: webpack.Module; hasEntryModule(): boolean; - addModule(module: internals.Module): boolean; - removeModule(module: internals.Module): void; + addModule(module: webpack.Module): boolean; + removeModule(module: webpack.Module): void; getNumberOfModules(): number; - readonly modulesIterable: Iterable; - compareTo(otherChunk: internals.Chunk): 0 | 1 | -1; - containsModule(module: internals.Module): boolean; - getModules(): Array; + readonly modulesIterable: Iterable; + compareTo(otherChunk: webpack.Chunk): 0 | 1 | -1; + containsModule(module: webpack.Module): boolean; + getModules(): Array; remove(): void; - moveModule(module: internals.Module, otherChunk: internals.Chunk): void; - integrate(otherChunk: internals.Chunk): boolean; - canBeIntegrated(otherChunk: internals.Chunk): boolean; + moveModule(module: webpack.Module, otherChunk: webpack.Chunk): void; + integrate(otherChunk: webpack.Chunk): boolean; + canBeIntegrated(otherChunk: webpack.Chunk): boolean; isEmpty(): boolean; modulesSize(): number; - size(options?: internals.ChunkSizeOptions): number; + size(options?: webpack.ChunkSizeOptions): number; integratedSize( - otherChunk: internals.Chunk, - options: internals.ChunkSizeOptions + otherChunk: webpack.Chunk, + options: webpack.ChunkSizeOptions ): number; getChunkModuleMaps( - filterFn: (m: internals.Module) => boolean - ): internals.ChunkModuleMaps; + filterFn: (m: webpack.Module) => boolean + ): webpack.ChunkModuleMaps; hasModuleInGraph( - filterFn: (m: internals.Module) => boolean, - filterChunkFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph + filterFn: (m: webpack.Module) => boolean, + filterChunkFn?: ( + c: webpack.Chunk, + chunkGraph: webpack.ChunkGraph ) => boolean ): boolean; - getChunkMaps(realHash: boolean): internals.ChunkMaps; + getChunkMaps(realHash: boolean): webpack.ChunkMaps; hasRuntime(): boolean; canBeInitial(): boolean; isOnlyInitial(): boolean; - addGroup(chunkGroup: internals.ChunkGroup): void; - removeGroup(chunkGroup: internals.ChunkGroup): void; - isInGroup(chunkGroup: internals.ChunkGroup): boolean; + addGroup(chunkGroup: webpack.ChunkGroup): void; + removeGroup(chunkGroup: webpack.ChunkGroup): void; + isInGroup(chunkGroup: webpack.ChunkGroup): boolean; getNumberOfGroups(): number; - readonly groupsIterable: Iterable; + readonly groupsIterable: Iterable; disconnectFromGroups(): void; - split(newChunk: internals.Chunk): void; - - /** - * Update the hash - */ - updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; - getAllAsyncChunks(): Set; - getAllReferencedChunks(): Set; + split(newChunk: webpack.Chunk): void; + updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; + getAllAsyncChunks(): Set; + getAllReferencedChunks(): Set; hasAsyncChunks(): boolean; getChildIdsByOrders( - chunkGraph: internals.ChunkGraph, - filterFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph - ) => boolean + chunkGraph: webpack.ChunkGraph, + filterFn?: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean ): Record>; getChildIdsByOrdersMap( - chunkGraph: internals.ChunkGraph, - includeDirectChildren: boolean, - filterFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph - ) => boolean + chunkGraph: webpack.ChunkGraph, + includeDirectChildren?: boolean, + filterFn?: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean ): Record>>; } - export abstract class ChunkGraph { - moduleGraph: internals.ModuleGraph; - connectChunkAndModule( - chunk: internals.Chunk, - module: internals.Module - ): void; + export class ChunkGraph { + constructor(moduleGraph: webpack.ModuleGraph); + moduleGraph: webpack.ModuleGraph; + connectChunkAndModule(chunk: webpack.Chunk, module: webpack.Module): void; disconnectChunkAndModule( - chunk: internals.Chunk, - module: internals.Module + chunk: webpack.Chunk, + module: webpack.Module ): void; - disconnectChunk(chunk: internals.Chunk): void; + disconnectChunk(chunk: webpack.Chunk): void; attachModules( - chunk: internals.Chunk, - modules: Iterable + chunk: webpack.Chunk, + modules: Iterable ): void; attachRuntimeModules( - chunk: internals.Chunk, - modules: Iterable + chunk: webpack.Chunk, + modules: Iterable ): void; - replaceModule( - oldModule: internals.Module, - newModule: internals.Module - ): void; - isModuleInChunk(module: internals.Module, chunk: internals.Chunk): boolean; + replaceModule(oldModule: webpack.Module, newModule: webpack.Module): void; + isModuleInChunk(module: webpack.Module, chunk: webpack.Chunk): boolean; isModuleInChunkGroup( - module: internals.Module, - chunkGroup: internals.ChunkGroup + module: webpack.Module, + chunkGroup: webpack.ChunkGroup ): boolean; - isEntryModule(module: internals.Module): boolean; - getModuleChunksIterable( - module: internals.Module - ): Iterable; + isEntryModule(module: webpack.Module): boolean; + getModuleChunksIterable(module: webpack.Module): Iterable; getOrderedModuleChunksIterable( - module: internals.Module, - sortFn: (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1 - ): Iterable; - getModuleChunks(module: internals.Module): Array; - getNumberOfModuleChunks(module: internals.Module): number; + module: webpack.Module, + sortFn: (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1 + ): Iterable; + getModuleChunks(module: webpack.Module): Array; + getNumberOfModuleChunks(module: webpack.Module): number; haveModulesEqualChunks( - moduleA: internals.Module, - moduleB: internals.Module + moduleA: webpack.Module, + moduleB: webpack.Module ): boolean; - getNumberOfChunkModules(chunk: internals.Chunk): number; - getChunkModulesIterable(chunk: internals.Chunk): Iterable; + getNumberOfChunkModules(chunk: webpack.Chunk): number; + getChunkModulesIterable(chunk: webpack.Chunk): Iterable; getChunkModulesIterableBySourceType( - chunk: internals.Chunk, + chunk: webpack.Chunk, sourceType: string - ): Iterable; + ): Iterable; getOrderedChunkModulesIterable( - chunk: internals.Chunk, - comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 - ): Iterable; + chunk: webpack.Chunk, + comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 + ): Iterable; getOrderedChunkModulesIterableBySourceType( - chunk: internals.Chunk, + chunk: webpack.Chunk, sourceType: string, - comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 - ): Iterable; - getChunkModules(chunk: internals.Chunk): Array; + comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 + ): Iterable; + getChunkModules(chunk: webpack.Chunk): Array; getOrderedChunkModules( - chunk: internals.Chunk, - comparator: (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1 - ): Array; + chunk: webpack.Chunk, + comparator: (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1 + ): Array; getChunkModuleMaps( - chunk: internals.Chunk, - filterFn: (m: internals.Module) => boolean, + chunk: webpack.Chunk, + filterFn: (m: webpack.Module) => boolean, includeAllChunks?: boolean - ): internals.ChunkModuleMaps; + ): webpack.ChunkModuleMaps; getChunkConditionMap( - chunk: internals.Chunk, - filterFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph - ) => boolean + chunk: webpack.Chunk, + filterFn: (c: webpack.Chunk, chunkGraph: webpack.ChunkGraph) => boolean ): Record; hasModuleInChunk( - chunk: internals.Chunk, - filterFn: (m: internals.Module) => boolean + chunk: webpack.Chunk, + filterFn: (m: webpack.Module) => boolean ): boolean; hasModuleInGraph( - chunk: internals.Chunk, - filterFn: (m: internals.Module) => boolean, - filterChunkFn: ( - c: internals.Chunk, - chunkGraph: internals.ChunkGraph + chunk: webpack.Chunk, + filterFn: (m: webpack.Module) => boolean, + filterChunkFn?: ( + c: webpack.Chunk, + chunkGraph: webpack.ChunkGraph ) => boolean ): boolean; - compareChunks(chunkA: internals.Chunk, chunkB: internals.Chunk): 0 | 1 | -1; - getChunkModulesSize(chunk: internals.Chunk): number; - getChunkModulesSizes(chunk: internals.Chunk): Record; - getChunkRootModules(chunk: internals.Chunk): Array; + compareChunks(chunkA: webpack.Chunk, chunkB: webpack.Chunk): 0 | 1 | -1; + getChunkModulesSize(chunk: webpack.Chunk): number; + getChunkModulesSizes(chunk: webpack.Chunk): Record; + getChunkRootModules(chunk: webpack.Chunk): Array; getChunkSize( - chunk: internals.Chunk, - options?: internals.ChunkSizeOptions + chunk: webpack.Chunk, + options?: webpack.ChunkSizeOptions ): number; getIntegratedChunksSize( - chunkA: internals.Chunk, - chunkB: internals.Chunk, - options?: internals.ChunkSizeOptions + chunkA: webpack.Chunk, + chunkB: webpack.Chunk, + options?: webpack.ChunkSizeOptions ): number; canChunksBeIntegrated( - chunkA: internals.Chunk, - chunkB: internals.Chunk - ): boolean; - integrateChunks(chunkA: internals.Chunk, chunkB: internals.Chunk): void; - isEntryModuleInChunk( - module: internals.Module, - chunk: internals.Chunk + chunkA: webpack.Chunk, + chunkB: webpack.Chunk ): boolean; + integrateChunks(chunkA: webpack.Chunk, chunkB: webpack.Chunk): void; + isEntryModuleInChunk(module: webpack.Module, chunk: webpack.Chunk): boolean; connectChunkAndEntryModule( - chunk: internals.Chunk, - module: internals.Module, - entrypoint: internals.Entrypoint + chunk: webpack.Chunk, + module: webpack.Module, + entrypoint?: webpack.Entrypoint ): void; connectChunkAndRuntimeModule( - chunk: internals.Chunk, - module: internals.RuntimeModule + chunk: webpack.Chunk, + module: webpack.RuntimeModule ): void; disconnectChunkAndEntryModule( - chunk: internals.Chunk, - module: internals.Module + chunk: webpack.Chunk, + module: webpack.Module ): void; disconnectChunkAndRuntimeModule( - chunk: internals.Chunk, - module: internals.RuntimeModule + chunk: webpack.Chunk, + module: webpack.RuntimeModule ): void; - disconnectEntryModule(module: internals.Module): void; - disconnectEntries(chunk: internals.Chunk): void; - getNumberOfEntryModules(chunk: internals.Chunk): number; - getNumberOfRuntimeModules(chunk: internals.Chunk): number; + disconnectEntryModule(module: webpack.Module): void; + disconnectEntries(chunk: webpack.Chunk): void; + getNumberOfEntryModules(chunk: webpack.Chunk): number; + getNumberOfRuntimeModules(chunk: webpack.Chunk): number; getChunkEntryModulesIterable( - chunk: internals.Chunk - ): Iterable; + chunk: webpack.Chunk + ): Iterable; getChunkEntryDependentChunksIterable( - chunk: internals.Chunk - ): Iterable; - hasChunkEntryDependentChunks(chunk: internals.Chunk): boolean; + chunk: webpack.Chunk + ): Iterable; + hasChunkEntryDependentChunks(chunk: webpack.Chunk): boolean; getChunkRuntimeModulesIterable( - chunk: internals.Chunk - ): Iterable; + chunk: webpack.Chunk + ): Iterable; getChunkRuntimeModulesInOrder( - chunk: internals.Chunk - ): Array; + chunk: webpack.Chunk + ): Array; getChunkEntryModulesWithChunkGroupIterable( - chunk: internals.Chunk - ): Iterable<[internals.Module, internals.Entrypoint]>; + chunk: webpack.Chunk + ): Iterable<[webpack.Module, webpack.Entrypoint]>; getBlockChunkGroup( - depBlock: internals.AsyncDependenciesBlock - ): internals.ChunkGroup; + depBlock: webpack.AsyncDependenciesBlock + ): webpack.ChunkGroup; connectBlockAndChunkGroup( - depBlock: internals.AsyncDependenciesBlock, - chunkGroup: internals.ChunkGroup + depBlock: webpack.AsyncDependenciesBlock, + chunkGroup: webpack.ChunkGroup ): void; - disconnectChunkGroup(chunkGroup: internals.ChunkGroup): void; - getModuleId(module: internals.Module): string | number; - setModuleId(module: internals.Module, id: string | number): void; - getModuleHash(module: internals.Module): string; - getRenderedModuleHash(module: internals.Module): string; + disconnectChunkGroup(chunkGroup: webpack.ChunkGroup): void; + getModuleId(module: webpack.Module): string | number; + setModuleId(module: webpack.Module, id: string | number): void; + getModuleHash(module: webpack.Module): string; + getRenderedModuleHash(module: webpack.Module): string; setModuleHashes( - module: internals.Module, + module: webpack.Module, hash: string, renderedHash: string ): void; addModuleRuntimeRequirements( - module: internals.Module, - items: Set - ): void; - addChunkRuntimeRequirements( - chunk: internals.Chunk, + module: webpack.Module, items: Set ): void; + addChunkRuntimeRequirements(chunk: webpack.Chunk, items: Set): void; addTreeRuntimeRequirements( - chunk: internals.Chunk, + chunk: webpack.Chunk, items: Iterable ): void; - getModuleRuntimeRequirements(module: internals.Module): ReadonlySet; - getChunkRuntimeRequirements(chunk: internals.Chunk): ReadonlySet; - getTreeRuntimeRequirements(chunk: internals.Chunk): ReadonlySet; + getModuleRuntimeRequirements(module: webpack.Module): ReadonlySet; + getChunkRuntimeRequirements(chunk: webpack.Chunk): ReadonlySet; + getTreeRuntimeRequirements(chunk: webpack.Chunk): ReadonlySet; + static getChunkGraphForModule( + module: webpack.Module, + deprecateMessage: string, + deprecationCode: string + ): webpack.ChunkGraph; + static setChunkGraphForModule( + module: webpack.Module, + chunkGraph: webpack.ChunkGraph + ): void; + static getChunkGraphForChunk( + chunk: webpack.Chunk, + deprecateMessage: string, + deprecationCode: string + ): webpack.ChunkGraph; + static setChunkGraphForChunk( + chunk: webpack.Chunk, + chunkGraph: webpack.ChunkGraph + ): void; } export abstract class ChunkGroup { groupDebugId: number; options: { preloadOrder?: number; prefetchOrder?: number; name: string }; - chunks: Array; + chunks: Array; origins: Array<{ - module: internals.Module; - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation; + module: webpack.Module; + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; request: string; }>; index: number; @@ -836,41 +820,39 @@ declare namespace internals { /** * Performs an unshift of a specific chunk */ - unshiftChunk(chunk: internals.Chunk): boolean; + unshiftChunk(chunk: webpack.Chunk): boolean; /** * inserts a chunk before another existing chunk in group */ - insertChunk(chunk: internals.Chunk, before: internals.Chunk): boolean; + insertChunk(chunk: webpack.Chunk, before: webpack.Chunk): boolean; /** * add a chunk into ChunkGroup. Is pushed on or prepended */ - pushChunk(chunk: internals.Chunk): boolean; - replaceChunk(oldChunk: internals.Chunk, newChunk: internals.Chunk): boolean; - removeChunk(chunk: internals.Chunk): boolean; + pushChunk(chunk: webpack.Chunk): boolean; + replaceChunk(oldChunk: webpack.Chunk, newChunk: webpack.Chunk): boolean; + removeChunk(chunk: webpack.Chunk): boolean; isInitial(): boolean; - addChild(group: internals.ChunkGroup): boolean; - getChildren(): Array; + addChild(group: webpack.ChunkGroup): boolean; + getChildren(): Array; getNumberOfChildren(): number; - readonly childrenIterable: internals.SortableSet; - removeChild(group: internals.ChunkGroup): boolean; - addParent(parentChunk: internals.ChunkGroup): boolean; - getParents(): Array; + readonly childrenIterable: webpack.SortableSet; + removeChild(group: webpack.ChunkGroup): boolean; + addParent(parentChunk: webpack.ChunkGroup): boolean; + getParents(): Array; getNumberOfParents(): number; - hasParent(parent: internals.ChunkGroup): boolean; - readonly parentsIterable: internals.SortableSet; - removeParent(chunkGroup: internals.ChunkGroup): boolean; + hasParent(parent: webpack.ChunkGroup): boolean; + readonly parentsIterable: webpack.SortableSet; + removeParent(chunkGroup: webpack.ChunkGroup): boolean; getBlocks(): Array; getNumberOfBlocks(): number; hasBlock(block?: any): boolean; - readonly blocksIterable: Iterable; - addBlock(block: internals.AsyncDependenciesBlock): boolean; + readonly blocksIterable: Iterable; + addBlock(block: webpack.AsyncDependenciesBlock): boolean; addOrigin( - module: internals.Module, - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation, + module: webpack.Module, + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, request: string ): void; getFiles(): Array; @@ -882,52 +864,52 @@ declare namespace internals { * Sorting values are based off of number of chunks in ChunkGroup. */ compareTo( - chunkGraph: internals.ChunkGraph, - otherGroup: internals.ChunkGroup + chunkGraph: webpack.ChunkGraph, + otherGroup: webpack.ChunkGroup ): 0 | 1 | -1; getChildrenByOrders( - moduleGraph: internals.ModuleGraph, - chunkGraph: internals.ChunkGraph - ): Record>; + moduleGraph: webpack.ModuleGraph, + chunkGraph: webpack.ChunkGraph + ): Record>; /** * Sets the top-down index of a module in this ChunkGroup */ - setModulePreOrderIndex(module: internals.Module, index: number): void; + setModulePreOrderIndex(module: webpack.Module, index: number): void; /** * Gets the top-down index of a module in this ChunkGroup */ - getModulePreOrderIndex(module: internals.Module): number; + getModulePreOrderIndex(module: webpack.Module): number; /** * Sets the bottom-up index of a module in this ChunkGroup */ - setModulePostOrderIndex(module: internals.Module, index: number): void; + setModulePostOrderIndex(module: webpack.Module, index: number): void; /** * Gets the bottom-up index of a module in this ChunkGroup */ - getModulePostOrderIndex(module: internals.Module): number; + getModulePostOrderIndex(module: webpack.Module): number; checkConstraints(): void; - getModuleIndex: (module: internals.Module) => number; - getModuleIndex2: (module: internals.Module) => number; + getModuleIndex: (module: webpack.Module) => number; + getModuleIndex2: (module: webpack.Module) => number; } export interface ChunkHashContext { /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; } /** @@ -945,7 +927,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface ChunkModuleMaps { id: Record>; @@ -985,28 +967,28 @@ declare namespace internals { /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; } export interface CodeGenerationResult { /** * the resulting sources for all source types */ - sources: Map; + sources: Map; /** * the runtime requirements @@ -1017,29 +999,29 @@ declare namespace internals { /** * Creates an instance of Compilation. */ - constructor(compiler: internals.Compiler); + constructor(compiler: webpack.Compiler); hooks: Readonly<{ - buildModule: SyncHook<[internals.Module], void>; - rebuildModule: SyncHook<[internals.Module], void>; - failedModule: SyncHook<[internals.Module, internals.WebpackError], void>; - succeedModule: SyncHook<[internals.Module], void>; - stillValidModule: SyncHook<[internals.Module], void>; + buildModule: SyncHook<[webpack.Module], void>; + rebuildModule: SyncHook<[webpack.Module], void>; + failedModule: SyncHook<[webpack.Module, webpack.WebpackError], void>; + succeedModule: SyncHook<[webpack.Module], void>; + stillValidModule: SyncHook<[webpack.Module], void>; addEntry: SyncHook< [ - internals.Dependency, + webpack.Dependency, { name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" > ], void >; failedEntry: SyncHook< [ - internals.Dependency, + webpack.Dependency, { name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >, Error ], @@ -1047,88 +1029,88 @@ declare namespace internals { >; succeedEntry: SyncHook< [ - internals.Dependency, + webpack.Dependency, { name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >, - internals.Module + webpack.Module ], void >; dependencyReferencedExports: SyncWaterfallHook< - [Array>, internals.Dependency] + [Array>, webpack.Dependency] >; - finishModules: AsyncSeriesHook<[Iterable]>; - finishRebuildingModule: AsyncSeriesHook<[internals.Module]>; + finishModules: AsyncSeriesHook<[Iterable]>; + finishRebuildingModule: AsyncSeriesHook<[webpack.Module]>; unseal: SyncHook<[], void>; seal: SyncHook<[], void>; beforeChunks: SyncHook<[], void>; - afterChunks: SyncHook<[Iterable], void>; - optimizeDependencies: SyncBailHook<[Iterable], any>; - afterOptimizeDependencies: SyncHook<[Iterable], void>; + afterChunks: SyncHook<[Iterable], void>; + optimizeDependencies: SyncBailHook<[Iterable], any>; + afterOptimizeDependencies: SyncHook<[Iterable], void>; optimize: SyncHook<[], void>; - optimizeModules: SyncBailHook<[Iterable], any>; - afterOptimizeModules: SyncHook<[Iterable], void>; + optimizeModules: SyncBailHook<[Iterable], any>; + afterOptimizeModules: SyncHook<[Iterable], void>; optimizeChunks: SyncBailHook< - [Iterable, Array], + [Iterable, Array], any >; afterOptimizeChunks: SyncHook< - [Iterable, Array], + [Iterable, Array], void >; optimizeTree: AsyncSeriesHook< - [Iterable, Iterable] + [Iterable, Iterable] >; afterOptimizeTree: SyncHook< - [Iterable, Iterable], + [Iterable, Iterable], void >; optimizeChunkModules: AsyncSeriesBailHook< - [Iterable, Iterable], + [Iterable, Iterable], any >; afterOptimizeChunkModules: SyncHook< - [Iterable, Iterable], + [Iterable, Iterable], void >; shouldRecord: SyncBailHook<[], boolean>; additionalChunkRuntimeRequirements: SyncHook< - [internals.Chunk, Set], + [webpack.Chunk, Set], void >; runtimeRequirementInChunk: HookMap< - SyncBailHook<[internals.Chunk, Set], any> + SyncBailHook<[webpack.Chunk, Set], any> >; additionalModuleRuntimeRequirements: SyncHook< - [internals.Module, Set], + [webpack.Module, Set], void >; runtimeRequirementInModule: HookMap< - SyncBailHook<[internals.Module, Set], any> + SyncBailHook<[webpack.Module, Set], any> >; additionalTreeRuntimeRequirements: SyncHook< - [internals.Chunk, Set], + [webpack.Chunk, Set], void >; runtimeRequirementInTree: HookMap< - SyncBailHook<[internals.Chunk, Set], any> + SyncBailHook<[webpack.Chunk, Set], any> >; - runtimeModule: SyncHook<[internals.RuntimeModule, internals.Chunk], void>; - reviveModules: SyncHook<[Iterable, any], void>; - beforeModuleIds: SyncHook<[Iterable], void>; - moduleIds: SyncHook<[Iterable], void>; - optimizeModuleIds: SyncHook<[Iterable], void>; - afterOptimizeModuleIds: SyncHook<[Iterable], void>; - reviveChunks: SyncHook<[Iterable, any], void>; - beforeChunkIds: SyncHook<[Iterable], void>; - chunkIds: SyncHook<[Iterable], void>; - optimizeChunkIds: SyncHook<[Iterable], void>; - afterOptimizeChunkIds: SyncHook<[Iterable], void>; - recordModules: SyncHook<[Iterable, any], void>; - recordChunks: SyncHook<[Iterable, any], void>; - optimizeCodeGeneration: SyncHook<[Iterable], void>; + runtimeModule: SyncHook<[webpack.RuntimeModule, webpack.Chunk], void>; + reviveModules: SyncHook<[Iterable, any], void>; + beforeModuleIds: SyncHook<[Iterable], void>; + moduleIds: SyncHook<[Iterable], void>; + optimizeModuleIds: SyncHook<[Iterable], void>; + afterOptimizeModuleIds: SyncHook<[Iterable], void>; + reviveChunks: SyncHook<[Iterable, any], void>; + beforeChunkIds: SyncHook<[Iterable], void>; + chunkIds: SyncHook<[Iterable], void>; + optimizeChunkIds: SyncHook<[Iterable], void>; + afterOptimizeChunkIds: SyncHook<[Iterable], void>; + recordModules: SyncHook<[Iterable, any], void>; + recordChunks: SyncHook<[Iterable, any], void>; + optimizeCodeGeneration: SyncHook<[Iterable], void>; beforeModuleHash: SyncHook<[], void>; afterModuleHash: SyncHook<[], void>; beforeCodeGeneration: SyncHook<[], void>; @@ -1136,93 +1118,83 @@ declare namespace internals { beforeRuntimeRequirements: SyncHook<[], void>; afterRuntimeRequirements: SyncHook<[], void>; beforeHash: SyncHook<[], void>; - contentHash: SyncHook<[internals.Chunk], void>; + contentHash: SyncHook<[webpack.Chunk], void>; afterHash: SyncHook<[], void>; recordHash: SyncHook<[any], void>; - record: SyncHook<[internals.Compilation, any], void>; + record: SyncHook<[webpack.Compilation, any], void>; beforeModuleAssets: SyncHook<[], void>; shouldGenerateChunkAssets: SyncBailHook<[], boolean>; beforeChunkAssets: SyncHook<[], void>; - additionalChunkAssets: SyncHook<[Iterable], void>; + additionalChunkAssets: SyncHook<[Iterable], void>; additionalAssets: AsyncSeriesHook<[]>; - optimizeChunkAssets: AsyncSeriesHook<[Iterable]>; - afterOptimizeChunkAssets: SyncHook<[Iterable], void>; - optimizeAssets: AsyncSeriesHook<[Record]>; - afterOptimizeAssets: SyncHook<[Record], void>; - finishAssets: AsyncSeriesHook<[Record]>; - afterFinishAssets: SyncHook<[Record], void>; + optimizeChunkAssets: AsyncSeriesHook<[Iterable]>; + afterOptimizeChunkAssets: SyncHook<[Iterable], void>; + optimizeAssets: AsyncSeriesHook<[Record]>; + afterOptimizeAssets: SyncHook<[Record], void>; + finishAssets: AsyncSeriesHook<[Record]>; + afterFinishAssets: SyncHook<[Record], void>; needAdditionalSeal: SyncBailHook<[], boolean>; afterSeal: AsyncSeriesHook<[]>; renderManifest: SyncWaterfallHook< - [Array, internals.RenderManifestOptions] + [Array, webpack.RenderManifestOptions] >; - fullHash: SyncHook<[internals.Hash], void>; + fullHash: SyncHook<[webpack.Hash], void>; chunkHash: SyncHook< - [internals.Chunk, internals.Hash, internals.ChunkHashContext], + [webpack.Chunk, webpack.Hash, webpack.ChunkHashContext], void >; - moduleAsset: SyncHook<[internals.Module, string], void>; - chunkAsset: SyncHook<[internals.Chunk, string], void>; - assetPath: SyncWaterfallHook<[string, any, internals.AssetInfo]>; + moduleAsset: SyncHook<[webpack.Module, string], void>; + chunkAsset: SyncHook<[webpack.Chunk, string], void>; + assetPath: SyncWaterfallHook<[string, any, webpack.AssetInfo]>; needAdditionalPass: SyncBailHook<[], boolean>; - childCompiler: SyncHook<[internals.Compiler, string, number], void>; - log: SyncBailHook<[string, internals.LogEntry], true>; + childCompiler: SyncHook<[webpack.Compiler, string, number], void>; + log: SyncBailHook<[string, webpack.LogEntry], true>; statsPreset: HookMap>; statsNormalize: SyncHook<[any, any], void>; - statsFactory: SyncHook<[internals.StatsFactory, any], void>; - statsPrinter: SyncHook<[internals.StatsPrinter, any], void>; - readonly normalModuleLoader: SyncHook< - [any, internals.NormalModule], - void - >; + statsFactory: SyncHook<[webpack.StatsFactory, any], void>; + statsPrinter: SyncHook<[webpack.StatsPrinter, any], void>; + readonly normalModuleLoader: SyncHook<[any, webpack.NormalModule], void>; }>; name: string; - compiler: internals.Compiler; - resolverFactory: internals.ResolverFactory; - inputFileSystem: internals.InputFileSystem; - fileSystemInfo: internals.FileSystemInfo; - requestShortener: internals.RequestShortener; + compiler: webpack.Compiler; + resolverFactory: webpack.ResolverFactory; + inputFileSystem: webpack.InputFileSystem; + fileSystemInfo: webpack.FileSystemInfo; + requestShortener: webpack.RequestShortener; compilerPath: string; - cache: internals.Cache; - logger: internals.WebpackLogger; - options: internals.WebpackOptionsNormalized; - outputOptions: internals.OutputNormalized; + cache: webpack.Cache; + logger: webpack.WebpackLogger; + options: webpack.WebpackOptionsNormalized; + outputOptions: webpack.OutputNormalized; bail: boolean; profile: boolean; - mainTemplate: internals.MainTemplate; - chunkTemplate: internals.ChunkTemplate; - runtimeTemplate: internals.RuntimeTemplate; - moduleTemplates: { javascript: internals.ModuleTemplate }; - moduleGraph: internals.ModuleGraph; - chunkGraph: internals.ChunkGraph; - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; - factorizeQueue: internals.AsyncQueue< - internals.FactorizeModuleOptions, + mainTemplate: webpack.MainTemplate; + chunkTemplate: webpack.ChunkTemplate; + runtimeTemplate: webpack.RuntimeTemplate; + moduleTemplates: { javascript: webpack.ModuleTemplate }; + moduleGraph: webpack.ModuleGraph; + chunkGraph: webpack.ChunkGraph; + codeGenerationResults: Map; + factorizeQueue: webpack.AsyncQueue< + webpack.FactorizeModuleOptions, string, - internals.Module + webpack.Module >; - addModuleQueue: internals.AsyncQueue< - internals.Module, - string, - internals.Module + addModuleQueue: webpack.AsyncQueue; + buildQueue: webpack.AsyncQueue< + webpack.Module, + webpack.Module, + webpack.Module >; - buildQueue: internals.AsyncQueue< - internals.Module, - internals.Module, - internals.Module + rebuildQueue: webpack.AsyncQueue< + webpack.Module, + webpack.Module, + webpack.Module >; - rebuildQueue: internals.AsyncQueue< - internals.Module, - internals.Module, - internals.Module - >; - processDependenciesQueue: internals.AsyncQueue< - internals.Module, - internals.Module, - internals.Module + processDependenciesQueue: webpack.AsyncQueue< + webpack.Module, + webpack.Module, + webpack.Module >; /** @@ -1230,168 +1202,137 @@ declare namespace internals { * Means value blocking key from finishing. * Needed to detect build cycles. */ - creatingModuleDuringBuild: WeakMap>; - entries: Map; - entrypoints: Map; - chunks: Set; - chunkGroups: Array; - namedChunkGroups: Map; - namedChunks: Map; - modules: Set; + creatingModuleDuringBuild: WeakMap>; + entries: Map; + entrypoints: Map; + chunks: Set; + chunkGroups: Array; + namedChunkGroups: Map; + namedChunks: Map; + modules: Set; records: any; additionalChunkAssets: Array; - assets: Record; - assetsInfo: Map; - errors: Array; - warnings: Array; - children: Array; - logging: Map>; + assets: Record; + assetsInfo: Map; + errors: Array; + warnings: Array; + children: Array; + logging: Map>; dependencyFactories: Map< - { new (...args: Array): internals.Dependency }, - internals.ModuleFactory + { new (...args: Array): webpack.Dependency }, + webpack.ModuleFactory >; - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; childrenCounters: {}; usedChunkIds: Set; usedModuleIds: Set; needAdditionalPass: boolean; - builtModules: WeakSet; + builtModules: WeakSet; emittedAssets: Set; comparedForEmitAssets: Set; - fileDependencies: internals.LazySet; - contextDependencies: internals.LazySet; - missingDependencies: internals.LazySet; - buildDependencies: internals.LazySet; - compilationDependencies: { add: (item?: any) => internals.LazySet }; - getStats(): internals.Stats; + fileDependencies: webpack.LazySet; + contextDependencies: webpack.LazySet; + missingDependencies: webpack.LazySet; + buildDependencies: webpack.LazySet; + compilationDependencies: { add: (item?: any) => webpack.LazySet }; + getStats(): webpack.Stats; createStatsOptions(optionsOrPreset?: any, context?: {}): {}; - createStatsFactory(options?: any): internals.StatsFactory; - createStatsPrinter(options?: any): internals.StatsPrinter; - getLogger(name: string | (() => string)): internals.WebpackLogger; + createStatsFactory(options?: any): webpack.StatsFactory; + createStatsPrinter(options?: any): webpack.StatsPrinter; + getLogger(name: string | (() => string)): webpack.WebpackLogger; addModule( - module: internals.Module, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + module: webpack.Module, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; /** * Fetches a module from a compilation by its identifier */ - getModule(module: internals.Module): internals.Module; + getModule(module: webpack.Module): webpack.Module; /** * Attempts to search for a module by its identifier */ - findModule(identifier: string): internals.Module; + findModule(identifier: string): webpack.Module; /** * Schedules a build of the module object */ buildModule( - module: internals.Module, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + module: webpack.Module, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; processModuleDependencies( - module: internals.Module, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + module: webpack.Module, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; handleModuleCreation( - __0: internals.HandleModuleCreationOptions, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + __0: webpack.HandleModuleCreationOptions, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; factorizeModule( - options: internals.FactorizeModuleOptions, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + options: webpack.FactorizeModuleOptions, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; addModuleChain( context: string, - dependency: internals.Dependency, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + dependency: webpack.Dependency, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; addEntry( context: string, - entry: internals.EntryDependency, + entry: webpack.EntryDependency, optionsOrName: | string | ({ name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >), - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; rebuildModule( - module: internals.Module, - callback: ( - err?: internals.WebpackError, - result?: internals.Module - ) => void + module: webpack.Module, + callback: (err?: webpack.WebpackError, result?: webpack.Module) => void ): void; finish(callback?: any): void; unseal(): void; - seal(callback: (err?: internals.WebpackError) => void): void; + seal(callback: (err?: webpack.WebpackError) => void): void; reportDependencyErrorsAndWarnings( - module: internals.Module, - blocks: Array + module: webpack.Module, + blocks: Array ): void; codeGeneration(): Map; - processRuntimeRequirements( - entrypoints: Iterable - ): void; - addRuntimeModule( - chunk: internals.Chunk, - module: internals.RuntimeModule - ): void; + processRuntimeRequirements(entrypoints: Iterable): void; + addRuntimeModule(chunk: webpack.Chunk, module: webpack.RuntimeModule): void; addChunkInGroup( groupOptions: | string | { preloadOrder?: number; prefetchOrder?: number; name: string }, - module: internals.Module, - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation, + module: webpack.Module, + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, request: string - ): internals.ChunkGroup; + ): webpack.ChunkGroup; /** * This method first looks to see if a name is provided for a new chunk, * and first looks to see if any named chunks already exist and reuse that chunk instead. */ - addChunk(name: string): internals.Chunk; - assignDepth(module: internals.Module): void; + addChunk(name?: string): webpack.Chunk; + assignDepth(module: webpack.Module): void; getDependencyReferencedExports( - dependency: internals.Dependency + dependency: webpack.Dependency ): Array>; removeReasonsOfDependencyBlock( - module: internals.Module, - block: internals.DependenciesBlockLike + module: webpack.Module, + block: webpack.DependenciesBlockLike ): void; patchChunksAfterReasonRemoval( - module: internals.Module, - chunk: internals.Chunk + module: webpack.Module, + chunk: webpack.Chunk ): void; removeChunkFromDependencies( - block: internals.DependenciesBlock, - chunk: internals.Chunk + block: webpack.DependenciesBlock, + chunk: webpack.Chunk ): void; sortItemsWithChunkIds(): void; summarizeDependencies(): void; @@ -1402,50 +1343,50 @@ declare namespace internals { modifyHash(update: string): void; emitAsset( file: string, - source: internals.Source, - assetInfo?: internals.AssetInfo + source: webpack.Source, + assetInfo?: webpack.AssetInfo ): void; updateAsset( file: string, newSourceOrFunction: - | internals.Source - | ((arg0: internals.Source) => internals.Source), + | webpack.Source + | ((arg0: webpack.Source) => webpack.Source), assetInfoUpdateOrFunction?: - | internals.AssetInfo - | ((arg0: internals.AssetInfo) => internals.AssetInfo) + | webpack.AssetInfo + | ((arg0: webpack.AssetInfo) => webpack.AssetInfo) ): void; - getAssets(): Array; - getAsset(name: string): internals.Asset; + getAssets(): Array; + getAsset(name: string): webpack.Asset; clearAssets(): void; createModuleAssets(): void; getRenderManifest( - options: internals.RenderManifestOptions - ): Array; - createChunkAssets(callback: (err?: internals.WebpackError) => void): void; + options: webpack.RenderManifestOptions + ): Array; + createChunkAssets(callback: (err?: webpack.WebpackError) => void): void; getPath( filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), - data?: internals.PathData + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), + data?: webpack.PathData ): string; getPathWithInfo( filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), - data?: internals.PathData - ): { path: string; info: internals.AssetInfo }; + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), + data?: webpack.PathData + ): { path: string; info: webpack.AssetInfo }; getAssetPath( filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), - data: internals.PathData + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), + data: webpack.PathData ): string; getAssetPathWithInfo( filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string), - data: internals.PathData - ): { path: string; info: internals.AssetInfo }; + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string), + data: webpack.PathData + ): { path: string; info: webpack.AssetInfo }; /** * This function allows you to run another instance of webpack inside of webpack however as @@ -1454,119 +1395,117 @@ declare namespace internals { */ createChildCompiler( name: string, - outputOptions: internals.OutputNormalized, - plugins: Array - ): internals.Compiler; + outputOptions: webpack.OutputNormalized, + plugins: Array + ): webpack.Compiler; checkConstraints(): void; } export interface CompilationHooksAsyncWebAssemblyModulesPlugin { renderModuleContent: SyncWaterfallHook< [ - internals.Source, - internals.Module, - internals.RenderContextAsyncWebAssemblyModulesPlugin + webpack.Source, + webpack.Module, + webpack.RenderContextAsyncWebAssemblyModulesPlugin ] >; } export interface CompilationHooksJavascriptModulesPlugin { renderModuleContent: SyncWaterfallHook< [ - internals.Source, - internals.Module, - internals.RenderContextJavascriptModulesPlugin + webpack.Source, + webpack.Module, + webpack.RenderContextJavascriptModulesPlugin ] >; renderModuleContainer: SyncWaterfallHook< [ - internals.Source, - internals.Module, - internals.RenderContextJavascriptModulesPlugin + webpack.Source, + webpack.Module, + webpack.RenderContextJavascriptModulesPlugin ] >; renderModulePackage: SyncWaterfallHook< [ - internals.Source, - internals.Module, - internals.RenderContextJavascriptModulesPlugin + webpack.Source, + webpack.Module, + webpack.RenderContextJavascriptModulesPlugin ] >; renderChunk: SyncWaterfallHook< - [internals.Source, internals.RenderContextJavascriptModulesPlugin] + [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] >; renderMain: SyncWaterfallHook< - [internals.Source, internals.RenderContextJavascriptModulesPlugin] + [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] >; render: SyncWaterfallHook< - [internals.Source, internals.RenderContextJavascriptModulesPlugin] - >; - renderRequire: SyncWaterfallHook< - [string, internals.RenderBootstrapContext] + [webpack.Source, webpack.RenderContextJavascriptModulesPlugin] >; + renderRequire: SyncWaterfallHook<[string, webpack.RenderBootstrapContext]>; chunkHash: SyncHook< - [internals.Chunk, internals.Hash, internals.ChunkHashContext], + [webpack.Chunk, webpack.Hash, webpack.ChunkHashContext], void >; } export interface CompilationParams { - normalModuleFactory: internals.NormalModuleFactory; - contextModuleFactory: internals.ContextModuleFactory; + normalModuleFactory: webpack.NormalModuleFactory; + contextModuleFactory: webpack.ContextModuleFactory; } export class Compiler { constructor(context: string); hooks: Readonly<{ initialize: SyncHook<[], void>; - shouldEmit: SyncBailHook<[internals.Compilation], boolean>; - done: AsyncSeriesHook<[internals.Stats]>; - afterDone: SyncHook<[internals.Stats], void>; + shouldEmit: SyncBailHook<[webpack.Compilation], boolean>; + done: AsyncSeriesHook<[webpack.Stats]>; + afterDone: SyncHook<[webpack.Stats], void>; additionalPass: AsyncSeriesHook<[]>; - beforeRun: AsyncSeriesHook<[internals.Compiler]>; - run: AsyncSeriesHook<[internals.Compiler]>; - emit: AsyncSeriesHook<[internals.Compilation]>; - assetEmitted: AsyncSeriesHook<[string, internals.AssetEmittedInfo]>; - afterEmit: AsyncSeriesHook<[internals.Compilation]>; + beforeRun: AsyncSeriesHook<[webpack.Compiler]>; + run: AsyncSeriesHook<[webpack.Compiler]>; + emit: AsyncSeriesHook<[webpack.Compilation]>; + assetEmitted: AsyncSeriesHook<[string, webpack.AssetEmittedInfo]>; + afterEmit: AsyncSeriesHook<[webpack.Compilation]>; thisCompilation: SyncHook< - [internals.Compilation, internals.CompilationParams], + [webpack.Compilation, webpack.CompilationParams], void >; compilation: SyncHook< - [internals.Compilation, internals.CompilationParams], + [webpack.Compilation, webpack.CompilationParams], void >; - normalModuleFactory: SyncHook<[internals.NormalModuleFactory], void>; - contextModuleFactory: SyncHook<[internals.ContextModuleFactory], void>; - beforeCompile: AsyncSeriesHook<[internals.CompilationParams]>; - compile: SyncHook<[internals.CompilationParams], void>; - make: AsyncParallelHook<[internals.Compilation]>; - afterCompile: AsyncSeriesHook<[internals.Compilation]>; - watchRun: AsyncSeriesHook<[internals.Compiler]>; + normalModuleFactory: SyncHook<[webpack.NormalModuleFactory], void>; + contextModuleFactory: SyncHook<[webpack.ContextModuleFactory], void>; + beforeCompile: AsyncSeriesHook<[webpack.CompilationParams]>; + compile: SyncHook<[webpack.CompilationParams], void>; + make: AsyncParallelHook<[webpack.Compilation]>; + afterCompile: AsyncSeriesHook<[webpack.Compilation]>; + watchRun: AsyncSeriesHook<[webpack.Compiler]>; failed: SyncHook<[Error], void>; invalid: SyncHook<[string, string], void>; watchClose: SyncHook<[], void>; infrastructureLog: SyncBailHook<[string, string, Array], true>; environment: SyncHook<[], void>; afterEnvironment: SyncHook<[], void>; - afterPlugins: SyncHook<[internals.Compiler], void>; - afterResolvers: SyncHook<[internals.Compiler], void>; + afterPlugins: SyncHook<[webpack.Compiler], void>; + afterResolvers: SyncHook<[webpack.Compiler], void>; entryOption: SyncBailHook< [ string, ( - | (() => Promise) - | internals.EntryStaticNormalized + | (() => Promise) + | webpack.EntryStaticNormalized ) ], boolean >; }>; name: string; - parentCompilation: internals.Compilation; - root: internals.Compiler; + parentCompilation: webpack.Compilation; + root: webpack.Compiler; outputPath: string; - outputFileSystem: internals.OutputFileSystem; - intermediateFileSystem: internals.InputFileSystem & - internals.OutputFileSystem & - internals.IntermediateFileSystemExtras; - inputFileSystem: internals.InputFileSystem; + outputFileSystem: webpack.OutputFileSystem; + intermediateFileSystem: webpack.InputFileSystem & + webpack.OutputFileSystem & + webpack.IntermediateFileSystemExtras; + inputFileSystem: webpack.InputFileSystem; watchFileSystem: any; recordsInputPath: string; recordsOutputPath: string; @@ -1575,57 +1514,57 @@ declare namespace internals { immutablePaths: Set; modifiedFiles: Set; removedFiles: Set; - fileTimestamps: Map; - contextTimestamps: Map; - resolverFactory: internals.ResolverFactory; + fileTimestamps: Map; + contextTimestamps: Map; + resolverFactory: webpack.ResolverFactory; infrastructureLogger: any; - options: internals.WebpackOptionsNormalized; + options: webpack.WebpackOptionsNormalized; context: string; - requestShortener: internals.RequestShortener; - cache: internals.Cache; + requestShortener: webpack.RequestShortener; + cache: webpack.Cache; compilerPath: string; running: boolean; watchMode: boolean; getInfrastructureLogger( name: string | (() => string) - ): internals.WebpackLogger; + ): webpack.WebpackLogger; watch( - watchOptions: internals.WatchOptions, - handler: internals.CallbackCompiler - ): internals.Watching; - run(callback: internals.CallbackCompiler): void; + watchOptions: webpack.WatchOptions, + handler: webpack.CallbackCompiler + ): webpack.Watching; + run(callback: webpack.CallbackCompiler): void; runAsChild( callback: ( err?: Error, - entries?: Array, - compilation?: internals.Compilation + entries?: Array, + compilation?: webpack.Compilation ) => any ): void; purgeInputFileSystem(): void; emitAssets( - compilation: internals.Compilation, - callback: internals.CallbackCompiler + compilation: webpack.Compilation, + callback: webpack.CallbackCompiler ): void; - emitRecords(callback: internals.CallbackCompiler): void; - readRecords(callback: internals.CallbackCompiler): void; + emitRecords(callback: webpack.CallbackCompiler): void; + readRecords(callback: webpack.CallbackCompiler): void; createChildCompiler( - compilation: internals.Compilation, + compilation: webpack.Compilation, compilerName: string, compilerIndex: number, - outputOptions: internals.OutputNormalized, - plugins: Array - ): internals.Compiler; + outputOptions: webpack.OutputNormalized, + plugins: Array + ): webpack.Compiler; isChild(): boolean; - createCompilation(): internals.Compilation; - newCompilation(params: internals.CompilationParams): internals.Compilation; - createNormalModuleFactory(): internals.NormalModuleFactory; - createContextModuleFactory(): internals.ContextModuleFactory; + createCompilation(): webpack.Compilation; + newCompilation(params: webpack.CompilationParams): webpack.Compilation; + createNormalModuleFactory(): webpack.NormalModuleFactory; + createContextModuleFactory(): webpack.ContextModuleFactory; newCompilationParams(): { - normalModuleFactory: internals.NormalModuleFactory; - contextModuleFactory: internals.ContextModuleFactory; + normalModuleFactory: webpack.NormalModuleFactory; + contextModuleFactory: webpack.ContextModuleFactory; }; - compile(callback: internals.CallbackCompiler): void; - close(callback: internals.CallbackCompiler): void; + compile(callback: webpack.CallbackCompiler): void; + close(callback: webpack.CallbackCompiler): void; } export class ContextExclusionPlugin { constructor(negativeMatcher: RegExp); @@ -1634,9 +1573,9 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export abstract class ContextModuleFactory extends internals.ModuleFactory { + export abstract class ContextModuleFactory extends webpack.ModuleFactory { hooks: Readonly<{ beforeResolve: AsyncSeriesWaterfallHook<[any]>; afterResolve: AsyncSeriesWaterfallHook<[any]>; @@ -1679,7 +1618,7 @@ declare namespace internals { | boolean | Function | RegExp - | internals.RuntimeValue + | webpack.RuntimeValue | { [index: string]: RecursiveArrayOrRecordDeclarations } | Array > @@ -1692,7 +1631,7 @@ declare namespace internals { | boolean | Function | RegExp - | internals.RuntimeValue + | webpack.RuntimeValue | { [index: string]: RecursiveArrayOrRecordDeclarations } | Array >; @@ -1700,11 +1639,8 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; - static runtimeValue( - fn?: any, - fileDependencies?: any - ): internals.RuntimeValue; + apply(compiler: webpack.Compiler): void; + static runtimeValue(fn?: any, fileDependencies?: any): webpack.RuntimeValue; } export class DelegatedPlugin { constructor(options?: any); @@ -1713,78 +1649,64 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export abstract class DependenciesBlock { - dependencies: Array; - blocks: Array; + dependencies: Array; + blocks: Array; /** * Adds a DependencyBlock to DependencyBlock relationship. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting) */ - addBlock(block: internals.AsyncDependenciesBlock): void; - addDependency(dependency: internals.Dependency): void; - removeDependency(dependency: internals.Dependency): void; + addBlock(block: webpack.AsyncDependenciesBlock): void; + addDependency(dependency: webpack.Dependency): void; + removeDependency(dependency: webpack.Dependency): void; /** * Removes all dependencies and blocks */ clearDependenciesAndBlocks(): void; - - /** - * Update the hash - */ - updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; + updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; serialize(__0: { write: any }): void; deserialize(__0: { read: any }): void; } export interface DependenciesBlockLike { - dependencies: Array; - blocks: Array; + dependencies: Array; + blocks: Array; } export class Dependency { constructor(); weak: boolean; optional: boolean; - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation; + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; readonly type: string; getResourceIdentifier(): string; - getReference(moduleGraph: internals.ModuleGraph): never; + getReference(moduleGraph: webpack.ModuleGraph): never; /** * Returns list of exports referenced by this dependency */ getReferencedExports( - moduleGraph: internals.ModuleGraph + moduleGraph: webpack.ModuleGraph ): Array>; - getCondition(moduleGraph: internals.ModuleGraph): () => boolean; + getCondition(moduleGraph: webpack.ModuleGraph): () => boolean; /** * Returns the exported names */ - getExports(moduleGraph: internals.ModuleGraph): internals.ExportsSpec; + getExports(moduleGraph: webpack.ModuleGraph): webpack.ExportsSpec; /** * Returns warnings */ - getWarnings( - moduleGraph: internals.ModuleGraph - ): Array; + getWarnings(moduleGraph: webpack.ModuleGraph): Array; /** * Returns errors */ - getErrors( - moduleGraph: internals.ModuleGraph - ): Array; - - /** - * Update the hash - */ - updateHash(hash: internals.Hash, chunkGraph: internals.ChunkGraph): void; + getErrors(moduleGraph: webpack.ModuleGraph): Array; + updateHash(hash: webpack.Hash, chunkGraph: webpack.ChunkGraph): void; /** * implement this method to allow the occurrence order plugin to count correctly @@ -1800,31 +1722,31 @@ declare namespace internals { } export abstract class DependencyTemplate { apply( - dependency: internals.Dependency, - source: internals.ReplaceSource, - templateContext: internals.DependencyTemplateContext + dependency: webpack.Dependency, + source: webpack.ReplaceSource, + templateContext: webpack.DependencyTemplateContext ): void; } export interface DependencyTemplateContext { /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the requirements for runtime @@ -1834,24 +1756,24 @@ declare namespace internals { /** * current module */ - module: internals.Module; + module: webpack.Module; /** * mutable array of init fragments for the current module */ - initFragments: Array; + initFragments: Array; } export abstract class DependencyTemplates { get(dependency: { - new (...args: Array): internals.Dependency; - }): internals.DependencyTemplate; + new (...args: Array): webpack.Dependency; + }): webpack.DependencyTemplate; set( - dependency: { new (...args: Array): internals.Dependency }, - dependencyTemplate: internals.DependencyTemplate + dependency: { new (...args: Array): webpack.Dependency }, + dependencyTemplate: webpack.DependencyTemplate ): void; updateHash(part: string): void; getHash(): string; - clone(): internals.DependencyTemplates; + clone(): webpack.DependencyTemplates; } export class DeterministicModuleIdsPlugin { constructor(options?: any); @@ -1860,7 +1782,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -1872,7 +1794,7 @@ declare namespace internals { export type DevTool = string | false; export type DevtoolFallbackModuleFilenameTemplate = string | Function; export class DllPlugin { - constructor(options: internals.DllPluginOptions); + constructor(options: webpack.DllPluginOptions); options: { entryOnly: boolean; /** @@ -1900,7 +1822,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -1954,7 +1876,7 @@ declare namespace internals { /** * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. */ - manifest: string | internals.DllReferencePluginOptionsManifest; + manifest: string | webpack.DllReferencePluginOptionsManifest; /** * The name where the dll is exposed (external name, defaults to manifest.name). */ @@ -1990,7 +1912,7 @@ declare namespace internals { /** * The mappings from request to module info. */ - content: internals.DllReferencePluginOptionsContent; + content: webpack.DllReferencePluginOptionsContent; /** * Context of requests in the manifest (or content property) as absolute path. */ @@ -2044,7 +1966,7 @@ declare namespace internals { /** * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. */ - manifest: string | internals.DllReferencePluginOptionsManifest; + manifest: string | webpack.DllReferencePluginOptionsManifest; /** * The name where the dll is exposed (external name, defaults to manifest.name). */ @@ -2080,7 +2002,7 @@ declare namespace internals { /** * The mappings from request to module info. */ - content: internals.DllReferencePluginOptionsContent; + content: webpack.DllReferencePluginOptionsContent; /** * Context of requests in the manifest (or content property) as absolute path. */ @@ -2135,7 +2057,7 @@ declare namespace internals { /** * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation. */ - manifest: string | internals.DllReferencePluginOptionsManifest; + manifest: string | webpack.DllReferencePluginOptionsManifest; /** * The name where the dll is exposed (external name, defaults to manifest.name). */ @@ -2171,7 +2093,7 @@ declare namespace internals { /** * The mappings from request to module info. */ - content: internals.DllReferencePluginOptionsContent; + content: webpack.DllReferencePluginOptionsContent; /** * Context of requests in the manifest (or content property) as absolute path. */ @@ -2239,7 +2161,7 @@ declare namespace internals { /** * The mappings from request to module info. */ - content: internals.DllReferencePluginOptionsContent; + content: webpack.DllReferencePluginOptionsContent; /** * The name where the dll is exposed (external name). @@ -2325,9 +2247,9 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static checkEnabled( - compiler: internals.Compiler, + compiler: webpack.Compiler, type: | "var" | "module" @@ -2351,26 +2273,26 @@ declare namespace internals { | string | (() => | string - | internals.EntryObject + | webpack.EntryObject | [string, string] - | Promise) - | internals.EntryObject + | Promise) + | webpack.EntryObject | [string, string]; export interface EntryData { /** * dependencies of the entrypoint */ - dependencies: Array; + dependencies: Array; /** * options of the entrypoint */ options: { name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >; } - export abstract class EntryDependency extends internals.ModuleDependency {} + export abstract class EntryDependency extends webpack.ModuleDependency {} /** * An object with entry point description. @@ -2386,10 +2308,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Module(s) that are loaded upon startup. @@ -2399,7 +2318,7 @@ declare namespace internals { /** * Options for library. */ - library?: internals.LibraryOptions; + library?: webpack.LibraryOptions; } /** @@ -2416,10 +2335,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Module(s) that are loaded upon startup. The last one is exported. @@ -2429,18 +2345,18 @@ declare namespace internals { /** * Options for library. */ - library?: internals.LibraryOptions; + library?: webpack.LibraryOptions; } export type EntryItem = string | [string, string]; export type EntryNormalized = - | (() => Promise) - | internals.EntryStaticNormalized; + | (() => Promise) + | webpack.EntryStaticNormalized; /** * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object. */ export interface EntryObject { - [index: string]: string | [string, string] | internals.EntryDescription; + [index: string]: string | [string, string] | webpack.EntryDescription; } export class EntryPlugin { /** @@ -2453,8 +2369,8 @@ declare namespace internals { options: | string | ({ name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >) ); context: string; @@ -2462,44 +2378,44 @@ declare namespace internals { options: | string | ({ name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >); /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static createDependency( entry: string, options: | string | ({ name: string } & Pick< - internals.EntryDescriptionNormalized, - "dependOn" | "filename" | "library" + webpack.EntryDescriptionNormalized, + "filename" | "dependOn" | "library" >) - ): internals.EntryDependency; + ): webpack.EntryDependency; } - export type EntryStatic = string | internals.EntryObject | [string, string]; + export type EntryStatic = string | webpack.EntryObject | [string, string]; /** * Multiple entry bundles are created. The key is the entry name. The value is an entry description object. */ export interface EntryStaticNormalized { - [index: string]: internals.EntryDescriptionNormalized; + [index: string]: webpack.EntryDescriptionNormalized; } - export abstract class Entrypoint extends internals.ChunkGroup { - runtimeChunk: internals.Chunk; + export abstract class Entrypoint extends webpack.ChunkGroup { + runtimeChunk: webpack.Chunk; /** * Sets the runtimeChunk for an entrypoint. */ - setRuntimeChunk(chunk: internals.Chunk): void; + setRuntimeChunk(chunk: webpack.Chunk): void; /** * Fetches the chunk reference containing the webpack bootstrap code */ - getRuntimeChunk(): internals.Chunk; + getRuntimeChunk(): webpack.Chunk; } export class EnvironmentPlugin { constructor(...keys: Array); @@ -2509,7 +2425,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface Etag { toString: () => string; @@ -2523,7 +2439,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class EvalSourceMapDevToolPlugin { constructor(options?: any); @@ -2535,7 +2451,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -2582,9 +2498,10 @@ declare namespace internals { */ topLevelAwait?: boolean; } - export abstract class ExportInfo { + export class ExportInfo { + constructor(name: string, initFrom?: webpack.ExportInfo); name: string; - usedName: string | typeof internals.SKIP_OVER_NAME; + usedName: string | typeof webpack.SKIP_OVER_NAME; used: 0 | 1 | 2 | 3 | 4; /** @@ -2609,11 +2526,11 @@ declare namespace internals { */ canMangleUse: boolean; exportsInfoOwned: boolean; - exportsInfo: internals.ExportsInfo; + exportsInfo: webpack.ExportsInfo; readonly canMangle: boolean; getUsedName(fallbackName?: any): any; - createNestedExportsInfo(): internals.ExportsInfo; - getNestedExportsInfo(): internals.ExportsInfo; + createNestedExportsInfo(): webpack.ExportsInfo; + getNestedExportsInfo(): webpack.ExportsInfo; getUsedInfo(): | "used" | "no usage info" @@ -2641,30 +2558,31 @@ declare namespace internals { /** * nested exports */ - exports?: Array; + exports?: Array; /** * when reexported: from which module */ - from?: internals.Module; + from?: webpack.Module; /** * when reexported: from which export */ export?: Array; } - export abstract class ExportsInfo { - readonly ownedExports: Iterable; - readonly exports: Iterable; - readonly orderedExports: Iterable; - readonly otherExportsInfo: internals.ExportInfo; + export class ExportsInfo { + constructor(); + readonly ownedExports: Iterable; + readonly exports: Iterable; + readonly orderedExports: Iterable; + readonly otherExportsInfo: webpack.ExportInfo; setRedirectNamedTo(exportsInfo?: any): void; setHasProvideInfo(): void; setHasUseInfo(): void; - getExportInfo(name: string): internals.ExportInfo; - getReadOnlyExportInfo(name: string): internals.ExportInfo; - getNestedExportsInfo(name: Array): internals.ExportsInfo; - setUnknownExportsProvided(canMangle: boolean): boolean; + getExportInfo(name: string): webpack.ExportInfo; + getReadOnlyExportInfo(name: string): webpack.ExportInfo; + getNestedExportsInfo(name?: Array): webpack.ExportsInfo; + setUnknownExportsProvided(canMangle?: boolean): boolean; setUsedInUnknownWay(): boolean; setAllKnownExportsUsed(): boolean; setUsedForSideEffectsOnly(): boolean; @@ -2685,7 +2603,7 @@ declare namespace internals { /** * exported names, true for unknown exports or null for no exports */ - exports: true | Array; + exports: true | Array; /** * can the export be renamed (defaults to true) @@ -2695,7 +2613,7 @@ declare namespace internals { /** * module on which the result depends on */ - dependencies?: Array; + dependencies?: Array; } export type Expression = | UnaryExpression @@ -2737,6 +2655,17 @@ declare namespace internals { request: string, callback: (err: Error, result: string) => void ) => void); + export class ExternalModule extends webpack.Module { + constructor(request?: any, type?: any, userRequest?: any); + request: string | Array | Record>; + externalType: string; + userRequest: string; + getSourceString( + runtimeTemplate?: any, + moduleGraph?: any, + chunkGraph?: any + ): string; + } export type Externals = | string | RegExp @@ -2776,7 +2705,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type ExternalsType = | "var" @@ -2796,10 +2725,10 @@ declare namespace internals { | "jsonp" | "system"; export interface FactorizeModuleOptions { - currentProfile: internals.ModuleProfile; - factory: internals.ModuleFactory; - dependencies: Array; - originModule: internals.Module; + currentProfile: webpack.ModuleProfile; + factory: webpack.ModuleFactory; + dependencies: Array; + originModule: webpack.Module; context?: string; } export interface FallbackCacheGroup { @@ -2815,7 +2744,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -2883,64 +2812,60 @@ declare namespace internals { version?: string; } export abstract class FileSystemInfo { - fs: internals.InputFileSystem; - logger: internals.WebpackLogger; - fileTimestampQueue: internals.AsyncQueue< + fs: webpack.InputFileSystem; + logger: webpack.WebpackLogger; + fileTimestampQueue: webpack.AsyncQueue< string, string, - internals.FileSystemInfoEntry + webpack.FileSystemInfoEntry >; - fileHashQueue: internals.AsyncQueue; - contextTimestampQueue: internals.AsyncQueue< + fileHashQueue: webpack.AsyncQueue; + contextTimestampQueue: webpack.AsyncQueue< string, string, - internals.FileSystemInfoEntry - >; - contextHashQueue: internals.AsyncQueue; - managedItemQueue: internals.AsyncQueue; - managedItemDirectoryQueue: internals.AsyncQueue< - string, - string, - Set + webpack.FileSystemInfoEntry >; + contextHashQueue: webpack.AsyncQueue; + managedItemQueue: webpack.AsyncQueue; + managedItemDirectoryQueue: webpack.AsyncQueue>; managedPaths: Array; managedPathsWithSlash: Array; immutablePaths: Array; immutablePathsWithSlash: Array; addFileTimestamps( - map: Map + map: Map ): void; addContextTimestamps( - map: Map + map: Map ): void; getFileTimestamp( path: string, callback: ( - arg0: internals.WebpackError, - arg1: internals.FileSystemInfoEntry | "ignore" + arg0: webpack.WebpackError, + arg1: webpack.FileSystemInfoEntry | "ignore" ) => void ): void; getContextTimestamp( path: string, callback: ( - arg0: internals.WebpackError, - arg1: internals.FileSystemInfoEntry | "ignore" + arg0: webpack.WebpackError, + arg1: webpack.FileSystemInfoEntry | "ignore" ) => void ): void; getFileHash( path: string, - callback: (arg0: internals.WebpackError, arg1: string) => void + callback: (arg0: webpack.WebpackError, arg1: string) => void ): void; getContextHash( path: string, - callback: (arg0: internals.WebpackError, arg1: string) => void + callback: (arg0: webpack.WebpackError, arg1: string) => void ): void; resolveBuildDependencies( context: string, deps: Iterable, callback: ( arg0: Error, - arg1: internals.ResolveBuildDependenciesResult + arg1: webpack.ResolveBuildDependenciesResult ) => void ): void; checkResolveResultsValid( @@ -2958,15 +2883,15 @@ declare namespace internals { */ hash?: boolean; }, - callback: (arg0: internals.WebpackError, arg1: internals.Snapshot) => void + callback: (arg0: webpack.WebpackError, arg1: webpack.Snapshot) => void ): void; mergeSnapshots( - snapshot1: internals.Snapshot, - snapshot2: internals.Snapshot - ): internals.Snapshot; + snapshot1: webpack.Snapshot, + snapshot2: webpack.Snapshot + ): webpack.Snapshot; checkSnapshotValid( - snapshot: internals.Snapshot, - callback: (arg0: internals.WebpackError, arg1: boolean) => void + snapshot: webpack.Snapshot, + callback: (arg0: webpack.WebpackError, arg1: boolean) => void ): void; getDeprecatedFileTimestamps(): Map; getDeprecatedContextTimestamps(): Map; @@ -2982,10 +2907,7 @@ declare namespace internals { } export type Filename = | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); export type FilterItemTypes = string | RegExp | ((value: string) => boolean); export type FilterTypes = | string @@ -2996,22 +2918,22 @@ declare namespace internals { /** * mapping from dependencies to templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the requirements for runtime @@ -3025,23 +2947,23 @@ declare namespace internals { } export class Generator { constructor(); - getTypes(module: internals.NormalModule): Set; - getSize(module: internals.NormalModule, type: string): number; + getTypes(module: webpack.NormalModule): Set; + getSize(module: webpack.NormalModule, type?: string): number; generate( - module: internals.NormalModule, - __1: internals.GenerateContext - ): internals.Source; - updateHash(hash: internals.Hash, __1: internals.UpdateHashContext): void; - static byType(map?: any): internals.ByTypeGenerator; + module: webpack.NormalModule, + __1: webpack.GenerateContext + ): webpack.Source; + updateHash(hash: webpack.Hash, __1: webpack.UpdateHashContext): void; + static byType(map?: any): webpack.ByTypeGenerator; } export interface HMRJavascriptParserHooks { hotAcceptCallback: SyncBailHook<[any, Array], void>; hotAcceptWithoutCallback: SyncBailHook<[any, Array], void>; } export interface HandleModuleCreationOptions { - factory: internals.ModuleFactory; - dependencies: Array; - originModule: internals.Module; + factory: webpack.ModuleFactory; + dependencies: Array; + originModule: webpack.Module; context?: string; /** @@ -3051,13 +2973,13 @@ declare namespace internals { } export class Hash { constructor(); - update(data: string | Buffer, inputEncoding: string): internals.Hash; - digest(encoding: string): string | Buffer; + update(data: string | Buffer, inputEncoding?: string): webpack.Hash; + digest(encoding?: string): string | Buffer; } - export type HashFunction = string | typeof internals.Hash; + export type HashFunction = string | typeof webpack.Hash; export class HashedModuleIdsPlugin { - constructor(options?: internals.HashedModuleIdsPluginOptions); - options: internals.HashedModuleIdsPluginOptions; + constructor(options?: webpack.HashedModuleIdsPluginOptions); + options: webpack.HashedModuleIdsPluginOptions; apply(compiler?: any): void; } @@ -3096,10 +3018,10 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static getParserHooks( - parser: internals.JavascriptParser - ): internals.HMRJavascriptParserHooks; + parser: webpack.JavascriptParser + ): webpack.HMRJavascriptParserHooks; } export class IgnorePlugin { constructor( @@ -3143,12 +3065,12 @@ declare namespace internals { * Note that if "contextRegExp" is given, both the "resourceRegExp" * and "contextRegExp" have to match. */ - checkIgnore(resolveData: internals.ResolveData): false; + checkIgnore(resolveData: webpack.ResolveData): false; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type IgnorePluginOptions = | { @@ -3188,17 +3110,17 @@ declare namespace internals { level?: "none" | "verbose" | "error" | "warn" | "info" | "log"; } export abstract class InitFragment { - content: string | internals.Source; + content: string | webpack.Source; stage: number; position: number; key: string; - endContent: string | internals.Source; + endContent: string | webpack.Source; getContent( - generateContext: internals.GenerateContext - ): string | internals.Source; + generateContext: webpack.GenerateContext + ): string | webpack.Source; getEndContent( - generateContext: internals.GenerateContext - ): string | internals.Source; + generateContext: webpack.GenerateContext + ): string | webpack.Source; merge: any; } export interface InputFileSystem { @@ -3239,46 +3161,46 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; renderModule( - module: internals.Module, - renderContext: internals.RenderContextJavascriptModulesPlugin, - hooks: internals.CompilationHooksJavascriptModulesPlugin, + module: webpack.Module, + renderContext: webpack.RenderContextJavascriptModulesPlugin, + hooks: webpack.CompilationHooksJavascriptModulesPlugin, factory: boolean | "strict" - ): internals.Source; + ): webpack.Source; renderChunk( - renderContext: internals.RenderContextJavascriptModulesPlugin, - hooks: internals.CompilationHooksJavascriptModulesPlugin - ): internals.Source; + renderContext: webpack.RenderContextJavascriptModulesPlugin, + hooks: webpack.CompilationHooksJavascriptModulesPlugin + ): webpack.Source; renderMain( - renderContext: internals.MainRenderContext, - hooks: internals.CompilationHooksJavascriptModulesPlugin - ): internals.Source; + renderContext: webpack.MainRenderContext, + hooks: webpack.CompilationHooksJavascriptModulesPlugin + ): webpack.Source; renderBootstrap( - renderContext: internals.RenderBootstrapContext, - hooks: internals.CompilationHooksJavascriptModulesPlugin + renderContext: webpack.RenderBootstrapContext, + hooks: webpack.CompilationHooksJavascriptModulesPlugin ): { header: Array; startup: Array; allowInlineStartup: boolean; }; renderRequire( - renderContext: internals.RenderBootstrapContext, - hooks: internals.CompilationHooksJavascriptModulesPlugin + renderContext: webpack.RenderBootstrapContext, + hooks: webpack.CompilationHooksJavascriptModulesPlugin ): string; static getCompilationHooks( - compilation: internals.Compilation - ): internals.CompilationHooksJavascriptModulesPlugin; + compilation: webpack.Compilation + ): webpack.CompilationHooksJavascriptModulesPlugin; static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any; static chunkHasJs: ( - chunk: internals.Chunk, - chunkGraph: internals.ChunkGraph + chunk: webpack.Chunk, + chunkGraph: webpack.ChunkGraph ) => boolean; } - export abstract class JavascriptParser extends internals.Parser { + export abstract class JavascriptParser extends webpack.Parser { hooks: Readonly<{ evaluateTypeof: HookMap< - SyncBailHook<[UnaryExpression], internals.BasicEvaluatedExpression> + SyncBailHook<[UnaryExpression], webpack.BasicEvaluatedExpression> >; evaluate: HookMap< SyncBailHook< @@ -3308,28 +3230,28 @@ declare namespace internals { | Identifier | AwaitExpression ], - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression > >; evaluateIdentifier: HookMap< SyncBailHook< [ThisExpression | MemberExpression | Identifier], - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression > >; evaluateDefinedIdentifier: HookMap< SyncBailHook< [ThisExpression | MemberExpression | Identifier], - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression > >; evaluateCallExpressionMember: HookMap< SyncBailHook< [ SimpleCallExpression | NewExpression, - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression ], - internals.BasicEvaluatedExpression + webpack.BasicEvaluatedExpression > >; preStatement: SyncBailHook< @@ -4230,8 +4152,8 @@ declare namespace internals { }>; options: any; sourceType: "module" | "script" | "auto"; - scope: internals.ScopeInfo; - state: Record & internals.ParserStateBase; + scope: webpack.ScopeInfo; + state: Record & webpack.ParserStateBase; comments: any; semicolons: any; statementEndPos: any; @@ -4335,7 +4257,7 @@ declare namespace internals { expr: MemberExpression, fallback: ( arg0: string, - arg1: string | internals.ScopeInfo | internals.VariableInfo, + arg1: string | webpack.ScopeInfo | webpack.VariableInfo, arg2: () => Array ) => any, defined: (arg0: string) => any, @@ -4348,12 +4270,12 @@ declare namespace internals { ): R; callHooksForInfo( hookMap: HookMap>, - info: string | internals.ScopeInfo | internals.VariableInfo, + info: string | webpack.ScopeInfo | webpack.VariableInfo, ...args: AsArray ): R; callHooksForInfoWithFallback( hookMap: HookMap>, - info: string | internals.ScopeInfo | internals.VariableInfo, + info: string | webpack.ScopeInfo | webpack.VariableInfo, fallback: (arg0: string) => any, defined: () => any, ...args: AsArray @@ -4402,10 +4324,10 @@ declare namespace internals { | MetaProperty | Identifier | AwaitExpression - ): internals.BasicEvaluatedExpression; + ): webpack.BasicEvaluatedExpression; parseString(expression?: any): any; parseCalculatedString(expression?: any): any; - evaluate(source?: any): internals.BasicEvaluatedExpression; + evaluate(source?: any): webpack.BasicEvaluatedExpression; getComments(range?: any): any; isAsiPosition(pos?: any): any; getTagData(name?: any, tag?: any): any; @@ -4415,10 +4337,10 @@ declare namespace internals { isVariableDefined(name?: any): boolean; getVariableInfo( name: string - ): string | internals.ScopeInfo | internals.VariableInfo; + ): string | webpack.ScopeInfo | webpack.VariableInfo; setVariable( name: string, - variableInfo: string | internals.ScopeInfo | internals.VariableInfo + variableInfo: string | webpack.ScopeInfo | webpack.VariableInfo ): void; parseCommentOptions(range?: any): { options: any; errors: any }; extractMemberExpressionChain( @@ -4454,7 +4376,7 @@ declare namespace internals { }; getFreeInfoFromVariable( varName: string - ): { name: string; info: string | internals.VariableInfo }; + ): { name: string; info: string | webpack.VariableInfo }; getMemberExpressionInfo( expression: MemberExpression, allowedTypes: Array<"expression" | "call"> @@ -4463,14 +4385,14 @@ declare namespace internals { type: "call"; call: SimpleCallExpression | NewExpression; calleeName: string; - rootInfo: string | internals.VariableInfo; + rootInfo: string | webpack.VariableInfo; getCalleeMembers: () => Array; name: string; getMembers: () => Array; } | { type: "expression"; - rootInfo: string | internals.VariableInfo; + rootInfo: string | webpack.VariableInfo; name: string; getMembers: () => Array; }; @@ -4478,14 +4400,14 @@ declare namespace internals { expression: MemberExpression ): { name: string; - rootInfo: string | internals.ScopeInfo | internals.VariableInfo; + rootInfo: string | webpack.ScopeInfo | webpack.VariableInfo; getMembers: () => Array; }; } export interface JsonpCompilationPluginHooks { - jsonpScript: SyncWaterfallHook<[string, internals.Chunk, string]>; - linkPreload: SyncWaterfallHook<[string, internals.Chunk, string]>; - linkPrefetch: SyncWaterfallHook<[string, internals.Chunk, string]>; + jsonpScript: SyncWaterfallHook<[string, webpack.Chunk, string]>; + linkPreload: SyncWaterfallHook<[string, webpack.Chunk, string]>; + linkPrefetch: SyncWaterfallHook<[string, webpack.Chunk, string]>; } export type JsonpScriptType = false | "module" | "text/javascript"; export class JsonpTemplatePlugin { @@ -4494,10 +4416,10 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static getCompilationHooks( - compilation: internals.Compilation - ): internals.JsonpCompilationPluginHooks; + compilation: webpack.Compilation + ): webpack.JsonpCompilationPluginHooks; } export interface KnownBuildMeta { moduleArgument?: string; @@ -4511,8 +4433,8 @@ declare namespace internals { } export abstract class LazySet { readonly size: number; - add(item: T): internals.LazySet; - addAll(iterable: internals.LazySet | Iterable): internals.LazySet; + add(item: T): webpack.LazySet; + addAll(iterable: webpack.LazySet | Iterable): webpack.LazySet; clear(): void; delete(value: T): boolean; entries(): IterableIterator<[T, T]>; @@ -4523,6 +4445,8 @@ declare namespace internals { has(item: T): boolean; keys(): IterableIterator; values(): IterableIterator; + [Symbol.iterator](): IterableIterator; + readonly [Symbol.toStringTag]: string; serialize(__0: { write: any }): void; } export interface LibIdentOptions { @@ -4543,15 +4467,15 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type Library = | string | Array - | internals.LibraryCustomUmdObject - | internals.LibraryOptions; + | webpack.LibraryCustomUmdObject + | webpack.LibraryOptions; export interface LibraryContext { - compilation: internals.Compilation; + compilation: webpack.Compilation; options: T; } @@ -4603,7 +4527,7 @@ declare namespace internals { export type LibraryName = | string | Array - | internals.LibraryCustomUmdObject; + | webpack.LibraryCustomUmdObject; /** * Options for library. @@ -4612,7 +4536,7 @@ declare namespace internals { /** * Add a comment in the UMD wrapper. */ - auxiliaryComment?: string | internals.LibraryCustomUmdCommentObject; + auxiliaryComment?: string | webpack.LibraryCustomUmdCommentObject; /** * Specify which export should be exposed as library. @@ -4622,7 +4546,7 @@ declare namespace internals { /** * The name of the library (some types allow unnamed libraries too). */ - name?: string | Array | internals.LibraryCustomUmdObject; + name?: string | Array | webpack.LibraryCustomUmdObject; /** * Type of library. @@ -4652,7 +4576,7 @@ declare namespace internals { } export class LibraryTemplatePlugin { constructor( - name: string | Array | internals.LibraryCustomUmdObject, + name: string | Array | webpack.LibraryCustomUmdObject, target: | "var" | "module" @@ -4671,7 +4595,7 @@ declare namespace internals { | "jsonp" | "system", umdNamedDefine: boolean, - auxiliaryComment: string | internals.LibraryCustomUmdCommentObject, + auxiliaryComment: string | webpack.LibraryCustomUmdCommentObject, exportProperty: string | Array ); library: { @@ -4692,25 +4616,25 @@ declare namespace internals { | "umd2" | "jsonp" | "system"; - name: string | Array | internals.LibraryCustomUmdObject; + name: string | Array | webpack.LibraryCustomUmdObject; umdNamedDefine: boolean; - auxiliaryComment: string | internals.LibraryCustomUmdCommentObject; + auxiliaryComment: string | webpack.LibraryCustomUmdCommentObject; export: string | Array; }; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class LimitChunkCountPlugin { - constructor(options: internals.LimitChunkCountPluginOptions); - options: internals.LimitChunkCountPluginOptions; + constructor(options?: webpack.LimitChunkCountPluginOptions); + options: webpack.LimitChunkCountPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -4747,13 +4671,13 @@ declare namespace internals { ident: string; } export class LoaderOptionsPlugin { - constructor(options?: internals.LoaderOptionsPluginOptions); - options: internals.LoaderOptionsPluginOptions; + constructor(options?: webpack.LoaderOptionsPluginOptions); + options: webpack.LoaderOptionsPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -4792,7 +4716,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface LogEntry { type: string; @@ -4806,35 +4730,32 @@ declare namespace internals { /** * the chunk */ - chunk: internals.Chunk; + chunk: webpack.Chunk; /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * results of code generation */ - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; + codeGenerationResults: Map; /** * hash to be used for render call @@ -4864,25 +4785,23 @@ declare namespace internals { bootstrap: SyncWaterfallHook< [ string, - internals.Chunk, + webpack.Chunk, string, - internals.ModuleTemplate, - internals.DependencyTemplates + webpack.ModuleTemplate, + webpack.DependencyTemplates ] >; - localVars: SyncWaterfallHook<[string, internals.Chunk, string]>; - requireExtensions: SyncWaterfallHook<[string, internals.Chunk, string]>; - requireEnsure: SyncWaterfallHook< - [string, internals.Chunk, string, string] - >; + localVars: SyncWaterfallHook<[string, webpack.Chunk, string]>; + requireExtensions: SyncWaterfallHook<[string, webpack.Chunk, string]>; + requireEnsure: SyncWaterfallHook<[string, webpack.Chunk, string, string]>; }>; - renderCurrentHashCode: (hash: string, length: number) => string; + renderCurrentHashCode: (hash: string, length?: number) => string; getPublicPath: (options?: any) => string; getAssetPath: (path?: any, options?: any) => string; getAssetPathWithInfo: ( path?: any, options?: any - ) => { path: string; info: internals.AssetInfo }; + ) => { path: string; info: webpack.AssetInfo }; readonly requireFn: string; readonly outputOptions: any; } @@ -4916,16 +4835,16 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class MinChunkSizePlugin { - constructor(options: internals.MinChunkSizePluginOptions); - options: internals.MinChunkSizePluginOptions; + constructor(options: webpack.MinChunkSizePluginOptions); + options: webpack.MinChunkSizePluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -4950,7 +4869,7 @@ declare namespace internals { minChunkSize: number; } export type Mode = "development" | "production" | "none"; - export class Module extends internals.DependenciesBlock { + export class Module extends webpack.DependenciesBlock { constructor(type: string, context?: string); type: string; context: string; @@ -4958,29 +4877,29 @@ declare namespace internals { debugId: number; resolveOptions: any; factoryMeta: any; - buildMeta: internals.KnownBuildMeta & Record; + buildMeta: webpack.KnownBuildMeta & Record; buildInfo: any; - presentationalDependencies: Array; + presentationalDependencies: Array; id: string | number; readonly hash: string; readonly renderedHash: string; - profile: internals.ModuleProfile; + profile: webpack.ModuleProfile; index: number; index2: number; depth: number; - issuer: internals.Module; - readonly usedExports: boolean | internals.SortableSet; + issuer: webpack.Module; + readonly usedExports: boolean | webpack.SortableSet; readonly optimizationBailout: Array< - string | ((requestShortener: internals.RequestShortener) => string) + string | ((requestShortener: webpack.RequestShortener) => string) >; readonly optional: boolean; addChunk(chunk?: any): boolean; removeChunk(chunk?: any): void; isInChunk(chunk?: any): boolean; isEntryModule(): boolean; - getChunks(): Array; + getChunks(): Array; getNumberOfChunks(): number; - readonly chunksIterable: Iterable; + readonly chunksIterable: Iterable; isProvided(exportName: string): boolean; readonly exportsArgument: string; readonly moduleArgument: string; @@ -4993,72 +4912,70 @@ declare namespace internals { | "default-only" | "default-with-named"; addPresentationalDependency( - presentationalDependency: internals.Dependency + presentationalDependency: webpack.Dependency ): void; - addWarning(warning: internals.WebpackError): void; - getWarnings(): Iterable; - addError(error: internals.WebpackError): void; - getErrors(): Iterable; + addWarning(warning: webpack.WebpackError): void; + getWarnings(): Iterable; + addError(error: webpack.WebpackError): void; + getErrors(): Iterable; /** * removes all warnings and errors */ clearWarningsAndErrors(): void; - isOptional(moduleGraph: internals.ModuleGraph): boolean; + isOptional(moduleGraph: webpack.ModuleGraph): boolean; isAccessibleInChunk( - chunkGraph: internals.ChunkGraph, - chunk: internals.Chunk, - ignoreChunk: internals.Chunk + chunkGraph: webpack.ChunkGraph, + chunk: webpack.Chunk, + ignoreChunk?: webpack.Chunk ): boolean; isAccessibleInChunkGroup( - chunkGraph: internals.ChunkGraph, - chunkGroup: internals.ChunkGroup, - ignoreChunk: internals.Chunk + chunkGraph: webpack.ChunkGraph, + chunkGroup: webpack.ChunkGroup, + ignoreChunk?: webpack.Chunk ): boolean; hasReasonForChunk( - chunk: internals.Chunk, - moduleGraph: internals.ModuleGraph, - chunkGraph: internals.ChunkGraph + chunk: webpack.Chunk, + moduleGraph: webpack.ModuleGraph, + chunkGraph: webpack.ChunkGraph ): boolean; - hasReasons(moduleGraph: internals.ModuleGraph): boolean; - isModuleUsed(moduleGraph: internals.ModuleGraph): boolean; + hasReasons(moduleGraph: webpack.ModuleGraph): boolean; + isModuleUsed(moduleGraph: webpack.ModuleGraph): boolean; isExportUsed( - moduleGraph: internals.ModuleGraph, + moduleGraph: webpack.ModuleGraph, exportName: string | Array ): 0 | 1 | 2 | 3 | 4; getUsedName( - moduleGraph: internals.ModuleGraph, + moduleGraph: webpack.ModuleGraph, exportName: string | Array ): string | false | Array; needBuild( - context: internals.NeedBuildContext, - callback: (arg0: internals.WebpackError, arg1: boolean) => void + context: webpack.NeedBuildContext, + callback: (arg0: webpack.WebpackError, arg1: boolean) => void ): void; needRebuild(fileTimestamps?: any, contextTimestamps?: any): boolean; invalidateBuild(): void; identifier(): string; - readableIdentifier(requestShortener: internals.RequestShortener): string; + readableIdentifier(requestShortener: webpack.RequestShortener): string; build( - options: internals.WebpackOptionsNormalized, - compilation: internals.Compilation, - resolver: internals.Resolver & internals.WithOptions, - fs: internals.InputFileSystem, - callback: (arg0: internals.WebpackError) => void + options: webpack.WebpackOptionsNormalized, + compilation: webpack.Compilation, + resolver: webpack.Resolver & webpack.WithOptions, + fs: webpack.InputFileSystem, + callback: (arg0: webpack.WebpackError) => void ): void; getSourceTypes(): Set; - source(sourceContext: internals.SourceContext): internals.Source; - size(type: string): number; - libIdent(options: internals.LibIdentOptions): string; + source(sourceContext: webpack.SourceContext): webpack.Source; + size(type?: string): number; + libIdent(options: webpack.LibIdentOptions): string; nameForCondition(): string; - getRuntimeRequirements( - context: internals.SourceContext - ): ReadonlySet; + getRuntimeRequirements(context: webpack.SourceContext): ReadonlySet; codeGeneration( - context: internals.CodeGenerationContext - ): internals.CodeGenerationResult; + context: webpack.CodeGenerationContext + ): webpack.CodeGenerationResult; chunkCondition( - chunk: internals.Chunk, - compilation: internals.Compilation + chunk: webpack.Chunk, + compilation: webpack.Compilation ): boolean; /** @@ -5066,8 +4983,8 @@ declare namespace internals { * the fresh module from the factory. Usually updates internal references * and properties. */ - updateCacheModule(module: internals.Module): void; - originalSource(): internals.Source; + updateCacheModule(module: webpack.Module): void; + originalSource(): webpack.Source; useSourceMap: any; readonly hasEqualsChunks: any; readonly isUsed: any; @@ -5082,24 +4999,24 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export abstract class ModuleDependency extends internals.Dependency { + export abstract class ModuleDependency extends webpack.Dependency { request: string; userRequest: string; range: any; } export abstract class ModuleFactory { create( - data: internals.ModuleFactoryCreateData, - callback: (arg0: Error, arg1: internals.ModuleFactoryResult) => void + data: webpack.ModuleFactoryCreateData, + callback: (arg0: Error, arg1: webpack.ModuleFactoryResult) => void ): void; } export interface ModuleFactoryCreateData { - contextInfo: internals.ModuleFactoryCreateDataContextInfo; + contextInfo: webpack.ModuleFactoryCreateDataContextInfo; resolveOptions?: any; context: string; - dependencies: Array; + dependencies: Array; } export interface ModuleFactoryCreateDataContextInfo { issuer: string; @@ -5109,7 +5026,7 @@ declare namespace internals { /** * the created module or unset if no module was created */ - module?: internals.Module; + module?: webpack.Module; fileDependencies?: Set; contextDependencies?: Set; missingDependencies?: Set; @@ -5150,108 +5067,127 @@ declare namespace internals { export let matchPart: (str?: any, test?: any) => any; export let matchObject: (obj?: any, str?: any) => boolean; } - export abstract class ModuleGraph { + export class ModuleGraph { + constructor(); setParents( - dependency: internals.Dependency, - block: internals.DependenciesBlock, - module: internals.Module + dependency: webpack.Dependency, + block: webpack.DependenciesBlock, + module: webpack.Module ): void; - getParentModule(dependency: internals.Dependency): internals.Module; - getParentBlock( - dependency: internals.Dependency - ): internals.DependenciesBlock; + getParentModule(dependency: webpack.Dependency): webpack.Module; + getParentBlock(dependency: webpack.Dependency): webpack.DependenciesBlock; setResolvedModule( - originModule: internals.Module, - dependency: internals.Dependency, - module: internals.Module + originModule: webpack.Module, + dependency: webpack.Dependency, + module: webpack.Module ): void; - updateModule( - dependency: internals.Dependency, - module: internals.Module - ): void; - removeConnection(dependency: internals.Dependency): void; - addExplanation(dependency: internals.Dependency, explanation: string): void; + updateModule(dependency: webpack.Dependency, module: webpack.Module): void; + removeConnection(dependency: webpack.Dependency): void; + addExplanation(dependency: webpack.Dependency, explanation: string): void; cloneModuleAttributes( - sourceModule: internals.Module, - targetModule: internals.Module + sourceModule: webpack.Module, + targetModule: webpack.Module ): void; - removeModuleAttributes(module: internals.Module): void; + removeModuleAttributes(module: webpack.Module): void; removeAllModuleAttributes(): void; moveModuleConnections( - oldModule: internals.Module, - newModule: internals.Module, - filterConnection: (arg0: internals.ModuleGraphConnection) => boolean + oldModule: webpack.Module, + newModule: webpack.Module, + filterConnection: (arg0: webpack.ModuleGraphConnection) => boolean ): void; - addExtraReason(module: internals.Module, explanation: string): void; - getResolvedModule(dependency: internals.Dependency): internals.Module; - finishModule(module: internals.Module): void; + addExtraReason(module: webpack.Module, explanation: string): void; + getResolvedModule(dependency: webpack.Dependency): webpack.Module; + finishModule(module: webpack.Module): void; getConnection( - dependency: internals.Dependency - ): internals.ModuleGraphConnection; - getModule(dependency: internals.Dependency): internals.Module; - getOrigin(dependency: internals.Dependency): internals.Module; - getResolvedOrigin(dependency: internals.Dependency): internals.Module; + dependency: webpack.Dependency + ): webpack.ModuleGraphConnection; + getModule(dependency: webpack.Dependency): webpack.Module; + getOrigin(dependency: webpack.Dependency): webpack.Module; + getResolvedOrigin(dependency: webpack.Dependency): webpack.Module; getIncomingConnections( - module: internals.Module - ): Iterable; + module: webpack.Module + ): Iterable; getOutgoingConnections( - module: internals.Module - ): Iterable; - getProfile(module: internals.Module): internals.ModuleProfile; - setProfile( - module: internals.Module, - profile: internals.ModuleProfile - ): void; - getIssuer(module: internals.Module): internals.Module; - setIssuer(module: internals.Module, issuer: internals.Module): void; - setIssuerIfUnset(module: internals.Module, issuer: internals.Module): void; + module: webpack.Module + ): Iterable; + getProfile(module: webpack.Module): webpack.ModuleProfile; + setProfile(module: webpack.Module, profile: webpack.ModuleProfile): void; + getIssuer(module: webpack.Module): webpack.Module; + setIssuer(module: webpack.Module, issuer: webpack.Module): void; + setIssuerIfUnset(module: webpack.Module, issuer: webpack.Module): void; getOptimizationBailout( - module: internals.Module - ): Array< - string | ((requestShortener: internals.RequestShortener) => string) - >; - getProvidedExports(module: internals.Module): true | Array; + module: webpack.Module + ): Array string)>; + getProvidedExports(module: webpack.Module): true | Array; isExportProvided( - module: internals.Module, + module: webpack.Module, exportName: string | Array ): boolean; - getExportsInfo(module: internals.Module): internals.ExportsInfo; + getExportsInfo(module: webpack.Module): webpack.ExportsInfo; getExportInfo( - module: internals.Module, + module: webpack.Module, exportName: string - ): internals.ExportInfo; + ): webpack.ExportInfo; getReadOnlyExportInfo( - module: internals.Module, + module: webpack.Module, exportName: string - ): internals.ExportInfo; + ): webpack.ExportInfo; getUsedExports( - module: internals.Module - ): boolean | internals.SortableSet; - getPreOrderIndex(module: internals.Module): number; - getPostOrderIndex(module: internals.Module): number; - setPreOrderIndex(module: internals.Module, index: number): void; - setPreOrderIndexIfUnset(module: internals.Module, index: number): boolean; - setPostOrderIndex(module: internals.Module, index: number): void; - setPostOrderIndexIfUnset(module: internals.Module, index: number): boolean; - getDepth(module: internals.Module): number; - setDepth(module: internals.Module, depth: number): void; - setDepthIfLower(module: internals.Module, depth: number): boolean; - isAsync(module: internals.Module): boolean; - setAsync(module: internals.Module): void; + module: webpack.Module + ): boolean | webpack.SortableSet; + getPreOrderIndex(module: webpack.Module): number; + getPostOrderIndex(module: webpack.Module): number; + setPreOrderIndex(module: webpack.Module, index: number): void; + setPreOrderIndexIfUnset(module: webpack.Module, index: number): boolean; + setPostOrderIndex(module: webpack.Module, index: number): void; + setPostOrderIndexIfUnset(module: webpack.Module, index: number): boolean; + getDepth(module: webpack.Module): number; + setDepth(module: webpack.Module, depth: number): void; + setDepthIfLower(module: webpack.Module, depth: number): boolean; + isAsync(module: webpack.Module): boolean; + setAsync(module: webpack.Module): void; getMeta(thing?: any): any; + static getModuleGraphForModule( + module: webpack.Module, + deprecateMessage: string, + deprecationCode: string + ): webpack.ModuleGraph; + static setModuleGraphForModule( + module: webpack.Module, + moduleGraph: webpack.ModuleGraph + ): void; + static ModuleGraphConnection: typeof webpack.ModuleGraphConnection; + static ExportsInfo: typeof webpack.ExportsInfo; + static ExportInfo: typeof webpack.ExportInfo; + static SKIP_OVER_NAME: typeof webpack.SKIP_OVER_NAME; + static UsageState: Readonly<{ + NoInfo: 0; + Unused: 1; + Unknown: 2; + OnlyPropertiesUsed: 3; + Used: 4; + }>; } - export abstract class ModuleGraphConnection { - originModule: internals.Module; - resolvedOriginModule: internals.Module; - dependency: internals.Dependency; - resolvedModule: internals.Module; - module: internals.Module; + export class ModuleGraphConnection { + constructor( + originModule: webpack.Module, + dependency: webpack.Dependency, + module: webpack.Module, + explanation?: string, + weak?: boolean, + condition?: (arg0: webpack.ModuleGraphConnection) => boolean + ); + originModule: webpack.Module; + resolvedOriginModule: webpack.Module; + dependency: webpack.Dependency; + resolvedModule: webpack.Module; + module: webpack.Module; weak: boolean; conditional: boolean; - condition: (arg0: internals.ModuleGraphConnection) => boolean; + condition: (arg0: webpack.ModuleGraphConnection) => boolean; explanations: Set; addCondition( - condition: (arg0: internals.ModuleGraphConnection) => boolean + condition: (arg0: webpack.ModuleGraphConnection) => boolean ): void; addExplanation(explanation: string): void; readonly explanation: string; @@ -5265,7 +5201,7 @@ declare namespace internals { /** * An array of rules applied by default for modules. */ - defaultRules?: Array; + defaultRules?: Array; /** * Enable warnings for full dynamic dependencies. @@ -5299,7 +5235,7 @@ declare namespace internals { /** * An array of rules applied for modules. */ - rules?: Array; + rules?: Array; /** * Emit errors instead of warnings when imported names don't exist in imported module. @@ -5389,7 +5325,7 @@ declare namespace internals { /** * Merge this profile into another one */ - mergeInto(realProfile: internals.ModuleProfile): void; + mergeInto(realProfile: webpack.ModuleProfile): void; } export abstract class ModuleTemplate { type: string; @@ -5404,54 +5340,54 @@ declare namespace internals { } export class MultiCompiler { constructor( - compilers: Array | Record + compilers: Array | Record ); hooks: Readonly<{ - done: SyncHook<[internals.MultiStats], void>; + done: SyncHook<[webpack.MultiStats], void>; invalid: MultiHook>; - run: MultiHook>; + run: MultiHook>; watchClose: SyncHook<[], void>; - watchRun: MultiHook>; + watchRun: MultiHook>; infrastructureLog: MultiHook< SyncBailHook<[string, string, Array], true> >; }>; - compilers: Array; - dependencies: WeakMap>; + compilers: Array; + dependencies: WeakMap>; running: boolean; - readonly options: Array; + readonly options: Array; readonly outputPath: string; - inputFileSystem: internals.InputFileSystem; - outputFileSystem: internals.OutputFileSystem; - intermediateFileSystem: internals.InputFileSystem & - internals.OutputFileSystem & - internals.IntermediateFileSystemExtras; - getInfrastructureLogger(name?: any): internals.WebpackLogger; + inputFileSystem: webpack.InputFileSystem; + outputFileSystem: webpack.OutputFileSystem; + intermediateFileSystem: webpack.InputFileSystem & + webpack.OutputFileSystem & + webpack.IntermediateFileSystemExtras; + getInfrastructureLogger(name?: any): webpack.WebpackLogger; setDependencies( - compiler: internals.Compiler, + compiler: webpack.Compiler, dependencies: Array ): void; validateDependencies( - callback: internals.CallbackCompiler + callback: webpack.CallbackCompiler ): boolean; runWithDependencies( - compilers: Array, + compilers: Array, fn: ( - compiler: internals.Compiler, - callback: internals.CallbackCompiler + compiler: webpack.Compiler, + callback: webpack.CallbackCompiler ) => any, - callback: internals.CallbackCompiler + callback: webpack.CallbackCompiler ): void; watch( - watchOptions: internals.WatchOptions | Array, - handler: internals.CallbackCompiler - ): internals.MultiWatching; - run(callback: internals.CallbackCompiler): void; + watchOptions: webpack.WatchOptions | Array, + handler: webpack.CallbackCompiler + ): webpack.MultiWatching; + run(callback: webpack.CallbackCompiler): void; purgeInputFileSystem(): void; - close(callback: internals.CallbackCompiler): void; + close(callback: webpack.CallbackCompiler): void; } export abstract class MultiStats { - stats: Array; + stats: Array; hash: string; hasErrors(): boolean; hasWarnings(): boolean; @@ -5467,12 +5403,12 @@ declare namespace internals { toString(options?: any): string; } export abstract class MultiWatching { - watchings: Array; - compiler: internals.MultiCompiler; + watchings: Array; + compiler: webpack.MultiCompiler; invalidate(): void; suspend(): void; resume(): void; - close(callback: internals.CallbackCompiler): void; + close(callback: webpack.CallbackCompiler): void; } export class NamedChunkIdsPlugin { constructor(options?: any); @@ -5482,7 +5418,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class NamedModuleIdsPlugin { constructor(options?: any); @@ -5491,7 +5427,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export class NaturalModuleIdsPlugin { constructor(); @@ -5499,10 +5435,10 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface NeedBuildContext { - fileSystemInfo: internals.FileSystemInfo; + fileSystemInfo: webpack.FileSystemInfo; } export class NoEmitOnErrorsPlugin { constructor(); @@ -5510,9 +5446,9 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export type Node = false | internals.NodeOptions; + export type Node = false | webpack.NodeOptions; export class NodeEnvironmentPlugin { constructor(options?: any); options: any; @@ -5520,7 +5456,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -5539,9 +5475,9 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } - export class NormalModule extends internals.Module { + export class NormalModule extends webpack.Module { constructor(__0: { /** * module type @@ -5562,7 +5498,7 @@ declare namespace internals { /** * list of loaders */ - loaders: Array; + loaders: Array; /** * path + query of the real resource */ @@ -5574,11 +5510,11 @@ declare namespace internals { /** * the parser used */ - parser: internals.Parser; + parser: webpack.Parser; /** * the generator used */ - generator: internals.Generator; + generator: webpack.Generator; /** * options used for resolving requests from this module */ @@ -5588,71 +5524,71 @@ declare namespace internals { userRequest: string; rawRequest: string; binary: boolean; - parser: internals.Parser; - generator: internals.Generator; + parser: webpack.Parser; + generator: webpack.Generator; resource: string; matchResource: string; - loaders: Array; - error: internals.WebpackError; + loaders: Array; + error: webpack.WebpackError; createSourceForAsset( context: string, name: string, content: string, sourceMap?: any, associatedObjectForCache?: any - ): internals.Source; + ): webpack.Source; createLoaderContext( - resolver: internals.Resolver & internals.WithOptions, - options: internals.WebpackOptionsNormalized, - compilation: internals.Compilation, - fs: internals.InputFileSystem + resolver: webpack.Resolver & webpack.WithOptions, + options: webpack.WebpackOptionsNormalized, + compilation: webpack.Compilation, + fs: webpack.InputFileSystem ): any; - getCurrentLoader(loaderContext?: any, index?: any): internals.LoaderItem; + getCurrentLoader(loaderContext?: any, index?: any): webpack.LoaderItem; createSource( context: string, content: string | Buffer, sourceMap?: any, associatedObjectForCache?: any - ): internals.Source; + ): webpack.Source; doBuild( - options: internals.WebpackOptionsNormalized, - compilation: internals.Compilation, - resolver: internals.Resolver & internals.WithOptions, - fs: internals.InputFileSystem, - callback: (arg0: internals.WebpackError) => void + options: webpack.WebpackOptionsNormalized, + compilation: webpack.Compilation, + resolver: webpack.Resolver & webpack.WithOptions, + fs: webpack.InputFileSystem, + callback: (arg0: webpack.WebpackError) => void ): void; - markModuleAsErrored(error: internals.WebpackError): void; + markModuleAsErrored(error: webpack.WebpackError): void; applyNoParseRule(rule?: any, content?: any): any; shouldPreventParsing(noParseRule?: any, request?: any): any; static getCompilationHooks( - compilation: internals.Compilation - ): internals.NormalModuleCompilationHooks; - static deserialize(context?: any): internals.NormalModule; + compilation: webpack.Compilation + ): webpack.NormalModuleCompilationHooks; + static deserialize(context?: any): webpack.NormalModule; } export interface NormalModuleCompilationHooks { - loader: SyncHook<[any, internals.NormalModule], void>; + loader: SyncHook<[any, webpack.NormalModule], void>; } - export abstract class NormalModuleFactory extends internals.ModuleFactory { + export abstract class NormalModuleFactory extends webpack.ModuleFactory { hooks: Readonly<{ - resolve: AsyncSeriesBailHook<[internals.ResolveData], any>; - factorize: AsyncSeriesBailHook<[internals.ResolveData], any>; - beforeResolve: AsyncSeriesBailHook<[internals.ResolveData], any>; - afterResolve: AsyncSeriesBailHook<[internals.ResolveData], any>; - createModule: SyncBailHook<[internals.ResolveData], any>; - module: SyncWaterfallHook<[internals.Module, any, internals.ResolveData]>; + resolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; + factorize: AsyncSeriesBailHook<[webpack.ResolveData], any>; + beforeResolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; + afterResolve: AsyncSeriesBailHook<[webpack.ResolveData], any>; + createModule: SyncBailHook<[webpack.ResolveData], any>; + module: SyncWaterfallHook<[webpack.Module, any, webpack.ResolveData]>; createParser: HookMap>; parser: HookMap>; createGenerator: HookMap>; generator: HookMap>; }>; resolverFactory: any; - ruleSet: internals.RuleSet; + ruleSet: webpack.RuleSet; unsafeCache: boolean; cachePredicate: any; context: any; fs: any; parserCache: Map>; - generatorCache: Map>; + generatorCache: Map>; resolveRequestArray( contextInfo?: any, context?: any, @@ -5663,7 +5599,7 @@ declare namespace internals { ): any; getParser(type?: any, parserOptions?: {}): any; createParser(type?: any, parserOptions?: {}): any; - getGenerator(type?: any, generatorOptions?: {}): internals.Generator; + getGenerator(type?: any, generatorOptions?: {}): webpack.Generator; createGenerator(type?: any, generatorOptions?: {}): any; getResolver(type?: any, resolveOptions?: any): any; } @@ -5681,26 +5617,26 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface ObjectDeserializerContext { read: () => any; } export interface ObjectSerializer { - serialize: (arg0: any, arg1: internals.ObjectSerializerContext) => void; - deserialize: (arg0: internals.ObjectDeserializerContext) => any; + serialize: (arg0: any, arg1: webpack.ObjectSerializerContext) => void; + deserialize: (arg0: webpack.ObjectDeserializerContext) => any; } export interface ObjectSerializerContext { write: (arg0?: any) => void; } export class OccurrenceChunkIdsPlugin { - constructor(options?: internals.OccurrenceChunkIdsPluginOptions); - options: internals.OccurrenceChunkIdsPluginOptions; + constructor(options?: webpack.OccurrenceChunkIdsPluginOptions); + options: webpack.OccurrenceChunkIdsPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -5715,13 +5651,13 @@ declare namespace internals { prioritiseInitial?: boolean; } export class OccurrenceModuleIdsPlugin { - constructor(options?: internals.OccurrenceModuleIdsPluginOptions); - options: internals.OccurrenceModuleIdsPluginOptions; + constructor(options?: webpack.OccurrenceModuleIdsPluginOptions); + options: webpack.OccurrenceModuleIdsPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -5795,7 +5731,8 @@ declare namespace internals { * Minimizer(s) to use for minimizing the output. */ minimizer?: Array< - internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) + | webpack.WebpackPluginInstance >; /** @@ -5861,7 +5798,7 @@ declare namespace internals { /** * Optimize duplication and caching by splitting chunks by shared modules and cache group. */ - splitChunks?: false | internals.OptimizationSplitChunksOptions; + splitChunks?: false | webpack.OptimizationSplitChunksOptions; /** * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code. @@ -5896,11 +5833,11 @@ declare namespace internals { | "async" | "all" | (( - module: internals.Module + module: webpack.Module ) => | void - | internals.OptimizationSplitChunksCacheGroup - | Array); + | webpack.OptimizationSplitChunksCacheGroup + | Array); /** * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group. @@ -5912,10 +5849,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Sets the hint for chunk id. @@ -6006,7 +5940,7 @@ declare namespace internals { | false | Function | RegExp - | internals.OptimizationSplitChunksCacheGroup; + | webpack.OptimizationSplitChunksCacheGroup; }; /** @@ -6045,10 +5979,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Prevents exposing path info when creating names for parts splitted by maxSize. @@ -6116,15 +6047,12 @@ declare namespace internals { */ assetModuleFilename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * Add a comment in the UMD wrapper. */ - auxiliaryComment?: string | internals.LibraryCustomUmdCommentObject; + auxiliaryComment?: string | webpack.LibraryCustomUmdCommentObject; /** * The callback function name used by webpack for loading of chunks in WebWorkers. @@ -6198,10 +6126,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * An expression which is used to address the global object/scope in runtime code. @@ -6221,7 +6146,7 @@ declare namespace internals { /** * Algorithm used for generation the hash (see node.js crypto package). */ - hashFunction?: string | typeof internals.Hash; + hashFunction?: string | typeof webpack.Hash; /** * Any string which is added to the hash to salt it. @@ -6264,8 +6189,8 @@ declare namespace internals { library?: | string | Array - | internals.LibraryCustomUmdObject - | internals.LibraryOptions; + | webpack.LibraryCustomUmdObject + | webpack.LibraryOptions; /** * Specify which export should be exposed as library. @@ -6313,10 +6238,7 @@ declare namespace internals { */ publicPath?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. @@ -6377,10 +6299,7 @@ declare namespace internals { */ assetModuleFilename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * The callback function name used by webpack for loading of chunks in WebWorkers. @@ -6454,10 +6373,7 @@ declare namespace internals { */ filename?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * An expression which is used to address the global object/scope in runtime code. @@ -6477,7 +6393,7 @@ declare namespace internals { /** * Algorithm used for generation the hash (see node.js crypto package). */ - hashFunction?: string | typeof internals.Hash; + hashFunction?: string | typeof webpack.Hash; /** * Any string which is added to the hash to salt it. @@ -6517,7 +6433,7 @@ declare namespace internals { /** * Options for library. */ - library?: internals.LibraryOptions; + library?: webpack.LibraryOptions; /** * Output javascript files as module source type. @@ -6539,10 +6455,7 @@ declare namespace internals { */ publicPath?: | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); /** * The filename of the SourceMaps for the JavaScript files. They are inside the `output.path` directory. @@ -6572,22 +6485,22 @@ declare namespace internals { export class Parser { constructor(); parse( - source: string | Buffer | Record, - state: Record & internals.ParserStateBase - ): Record & internals.ParserStateBase; + source: string | Record | Buffer, + state: Record & webpack.ParserStateBase + ): Record & webpack.ParserStateBase; } export interface ParserStateBase { - current: internals.NormalModule; - module: internals.NormalModule; - compilation: internals.Compilation; + current: webpack.NormalModule; + module: webpack.NormalModule; + compilation: webpack.Compilation; options: any; } export interface PathData { - chunkGraph?: internals.ChunkGraph; + chunkGraph?: webpack.ChunkGraph; hash?: string; hashWithLength?: (arg0: number) => string; - chunk?: internals.Chunk | internals.ChunkPathData; - module?: internals.Module | internals.ModulePathData; + chunk?: webpack.Chunk | webpack.ChunkPathData; + module?: webpack.Module | webpack.ModulePathData; filename?: string; basename?: string; query?: string; @@ -6597,7 +6510,7 @@ declare namespace internals { noChunkHash?: boolean; url?: string; } - export type Performance = false | internals.PerformanceOptions; + export type Performance = false | webpack.PerformanceOptions; /** * Configuration object for web performance recommendations. @@ -6634,7 +6547,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface PrintedElement { element: string; @@ -6664,10 +6577,10 @@ declare namespace internals { stopProfiling(): Promise; } export class ProfilingPlugin { - constructor(options?: internals.ProfilingPluginOptions); + constructor(options?: webpack.ProfilingPluginOptions); outputPath: string; apply(compiler?: any): void; - static Profiler: typeof internals.Profiler; + static Profiler: typeof webpack.Profiler; } /** @@ -6684,7 +6597,7 @@ declare namespace internals { export class ProgressPlugin { constructor( options: - | internals.ProgressPluginOptions + | webpack.ProgressPluginOptions | ((percentage: number, msg: string, ...args: Array) => void) ); profile: boolean; @@ -6695,11 +6608,11 @@ declare namespace internals { showModules: boolean; showDependencies: boolean; showActiveModules: boolean; - percentBy: "dependencies" | "modules" | "entries"; - apply(compiler: internals.Compiler | internals.MultiCompiler): void; + percentBy: "modules" | "dependencies" | "entries"; + apply(compiler: webpack.Compiler | webpack.MultiCompiler): void; static getReporter( - compiler: internals.Compiler - ): (p: number, args: Array) => void; + compiler: webpack.Compiler + ): (p: number, ...args: Array) => void; static defaultOptions: { profile: boolean; modulesCount: number; @@ -6711,7 +6624,7 @@ declare namespace internals { }; } export type ProgressPluginArgument = - | internals.ProgressPluginOptions + | webpack.ProgressPluginOptions | ((percentage: number, msg: string, ...args: Array) => void); /** @@ -6756,7 +6669,7 @@ declare namespace internals { /** * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent. */ - percentBy?: "dependencies" | "modules" | "entries"; + percentBy?: "modules" | "dependencies" | "entries"; /** * Collect profile data for progress steps. Default: false. @@ -6770,14 +6683,11 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export type PublicPath = | string - | (( - pathData: internals.PathData, - assetInfo: internals.AssetInfo - ) => string); + | ((pathData: webpack.PathData, assetInfo: webpack.AssetInfo) => string); export interface RawChunkGroupOptions { preloadOrder?: number; prefetchOrder?: number; @@ -6789,11 +6699,11 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface RealDependencyLocation { - start: internals.SourcePosition; - end?: internals.SourcePosition; + start: webpack.SourcePosition; + end?: webpack.SourcePosition; index?: number; } export type RecursiveArrayOrRecord = @@ -6803,7 +6713,7 @@ declare namespace internals { | boolean | Function | RegExp - | internals.RuntimeValue + | webpack.RuntimeValue | { [index: string]: RecursiveArrayOrRecordDeclarations } | Array; type RecursiveArrayOrRecordDeclarations = @@ -6813,29 +6723,29 @@ declare namespace internals { | boolean | Function | RegExp - | internals.RuntimeValue + | webpack.RuntimeValue | { [index: string]: RecursiveArrayOrRecordDeclarations } | Array; export interface RenderBootstrapContext { /** * the chunk */ - chunk: internals.Chunk; + chunk: webpack.Chunk; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * hash to be used for render call @@ -6871,77 +6781,71 @@ declare namespace internals { /** * results of code generation */ - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; + codeGenerationResults: Map; } export interface RenderContextJavascriptModulesPlugin { /** * the chunk */ - chunk: internals.Chunk; + chunk: webpack.Chunk; /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * results of code generation */ - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; + codeGenerationResults: Map; } export interface RenderContextModuleTemplate { /** * the chunk */ - chunk: internals.Chunk; + chunk: webpack.Chunk; /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; } export interface RenderManifestEntry { - render: () => internals.Source; + render: () => webpack.Source; filenameTemplate: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); - pathOptions?: internals.PathData; + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); + pathOptions?: webpack.PathData; identifier: string; hash?: string; auxiliary?: boolean; @@ -6950,21 +6854,18 @@ declare namespace internals { /** * the chunk used to render */ - chunk: internals.Chunk; + chunk: webpack.Chunk; hash: string; fullHash: string; outputOptions: any; - codeGenerationResults: Map< - internals.Module, - internals.CodeGenerationResult - >; - moduleTemplates: { javascript: internals.ModuleTemplate }; - dependencyTemplates: internals.DependencyTemplates; - runtimeTemplate: internals.RuntimeTemplate; - moduleGraph: internals.ModuleGraph; - chunkGraph: internals.ChunkGraph; + codeGenerationResults: Map; + moduleTemplates: { javascript: webpack.ModuleTemplate }; + dependencyTemplates: webpack.DependencyTemplates; + runtimeTemplate: webpack.RuntimeTemplate; + moduleGraph: webpack.ModuleGraph; + chunkGraph: webpack.ChunkGraph; } - export abstract class ReplaceSource extends internals.Source { + export abstract class ReplaceSource extends webpack.Source { replace(start: number, end: number, newValue: string, name: string): void; insert(pos: number, newValue: string, name: string): void; getName(): string; @@ -7026,21 +6927,21 @@ declare namespace internals { } export interface ResolveContext { log?: (message: string) => void; - fileDependencies?: internals.WriteOnlySet; - contextDependencies?: internals.WriteOnlySet; - missingDependencies?: internals.WriteOnlySet; + fileDependencies?: webpack.WriteOnlySet; + contextDependencies?: webpack.WriteOnlySet; + missingDependencies?: webpack.WriteOnlySet; stack?: Set; } export interface ResolveData { - contextInfo: internals.ModuleFactoryCreateDataContextInfo; + contextInfo: webpack.ModuleFactoryCreateDataContextInfo; resolveOptions: any; context: string; request: string; - dependencies: Array; + dependencies: Array; createData: any; - fileDependencies: internals.LazySet; - missingDependencies: internals.LazySet; - contextDependencies: internals.LazySet; + fileDependencies: webpack.LazySet; + missingDependencies: webpack.LazySet; + contextDependencies: webpack.LazySet; } /** @@ -7125,7 +7026,7 @@ declare namespace internals { /** * Plugins for the resolver. */ - plugins?: Array; + plugins?: Array; /** * Custom resolver. @@ -7164,7 +7065,7 @@ declare namespace internals { context: Object, path: string, request: string, - resolveContext: internals.ResolveContext, + resolveContext: webpack.ResolveContext, callback: ( err: NodeJS.ErrnoException, result: string, @@ -7173,19 +7074,19 @@ declare namespace internals { ): void; } export interface ResolverCache { - direct: WeakMap; - stringified: Map; + direct: WeakMap; + stringified: Map; } export abstract class ResolverFactory { hooks: Readonly<{ resolveOptions: HookMap>; - resolver: HookMap>; + resolver: HookMap>; }>; - cache: Map; + cache: Map; get( type: string, resolveOptions?: any - ): internals.Resolver & internals.WithOptions; + ): webpack.Resolver & webpack.WithOptions; } export interface RuleSet { /** @@ -7196,7 +7097,7 @@ declare namespace internals { /** * execute the rule set */ - exec: (arg0?: any) => Array; + exec: (arg0?: any) => Array; } export type RuleSetCondition = | string @@ -7354,7 +7255,7 @@ declare namespace internals { /** * Only execute the first matching rule in this array. */ - oneOf?: Array; + oneOf?: Array; /** * Shortcut for use.options. @@ -7374,7 +7275,7 @@ declare namespace internals { /** * Options for the resolver. */ - resolve?: internals.ResolveOptions; + resolve?: webpack.ResolveOptions; /** * Match the resource path of the module. @@ -7389,7 +7290,7 @@ declare namespace internals { /** * Match and execute these rules when this rule is matched. */ - rules?: Array; + rules?: Array; /** * Flags a module as with or without side effects. @@ -7446,7 +7347,13 @@ declare namespace internals { | __TypeWebpackOptions | Array) > - | ((data: {}) => Array) + | ((data: { + resource: string; + realResource: string; + resourceQuery: string; + issuer: string; + compiler: string; + }) => Array) | { /** * Unique loader options identifier. @@ -7500,7 +7407,13 @@ declare namespace internals { | __TypeWebpackOptions | Array) > - | ((data: {}) => Array) + | ((data: { + resource: string; + realResource: string; + resourceQuery: string; + issuer: string; + compiler: string; + }) => Array) | { /** * Unique loader options identifier. @@ -7579,7 +7492,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export namespace RuntimeGlobals { export let require: string; @@ -7631,19 +7544,19 @@ declare namespace internals { export let hasOwnProperty: string; export let systemContext: string; } - export class RuntimeModule extends internals.Module { + export class RuntimeModule extends webpack.Module { constructor(name: string, stage?: number); name: string; stage: number; - compilation: internals.Compilation; - chunk: internals.Chunk; - attach(compilation: internals.Compilation, chunk: internals.Chunk): void; + compilation: webpack.Compilation; + chunk: webpack.Chunk; + attach(compilation: webpack.Compilation, chunk: webpack.Chunk): void; generate(): string; getGeneratedCode(): string; } export abstract class RuntimeTemplate { - outputOptions: internals.Output; - requestShortener: internals.RequestShortener; + outputOptions: webpack.Output; + requestShortener: webpack.RequestShortener; isIIFE(): boolean; supportsConst(): boolean; supportsArrowFunction(): boolean; @@ -7712,11 +7625,11 @@ declare namespace internals { /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the request that should be printed as comment */ @@ -7734,11 +7647,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7752,11 +7665,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7774,11 +7687,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7796,11 +7709,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7822,15 +7735,15 @@ declare namespace internals { /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the current dependencies block */ - block?: internals.AsyncDependenciesBlock; + block?: webpack.AsyncDependenciesBlock; /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the request that should be printed as comment */ @@ -7860,11 +7773,11 @@ declare namespace internals { /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the request that should be printed as comment */ @@ -7876,7 +7789,7 @@ declare namespace internals { /** * module in which the statement is emitted */ - originModule: internals.Module; + originModule: webpack.Module; /** * true, if this is a weak dependency */ @@ -7890,11 +7803,11 @@ declare namespace internals { /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the module */ - module: internals.Module; + module: webpack.Module; /** * the request */ @@ -7906,7 +7819,7 @@ declare namespace internals { /** * the origin module */ - originModule: internals.Module; + originModule: webpack.Module; /** * true, if location is safe for ASI, a bracket can be emitted */ @@ -7930,7 +7843,7 @@ declare namespace internals { /** * init fragments will be added here */ - initFragments: Array; + initFragments: Array; /** * if set, will be filled with runtime requirements */ @@ -7940,7 +7853,7 @@ declare namespace internals { /** * the async block */ - block: internals.AsyncDependenciesBlock; + block: webpack.AsyncDependenciesBlock; /** * the message */ @@ -7948,7 +7861,7 @@ declare namespace internals { /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * if set, will be filled with runtime requirements */ @@ -7972,9 +7885,9 @@ declare namespace internals { } export const SKIP_OVER_NAME: unique symbol; export interface ScopeInfo { - definitions: internals.StackedMap< + definitions: webpack.StackedMap< string, - internals.ScopeInfo | internals.VariableInfo + webpack.ScopeInfo | webpack.VariableInfo >; topLevelScope: boolean | "arrow"; inShorthand: boolean; @@ -7995,7 +7908,7 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; static moduleHasSideEffects( moduleName?: any, flagValue?: any, @@ -8008,13 +7921,13 @@ declare namespace internals { */ export interface Snapshot { startTime?: number; - fileTimestamps?: Map; + fileTimestamps?: Map; fileHashes?: Map; - contextTimestamps?: Map; + contextTimestamps?: Map; contextHashes?: Map; missingExistence?: Map; managedItemInfo?: Map; - children?: Set; + children?: Set; } export abstract class SortableSet extends Set { /** @@ -8026,21 +7939,27 @@ declare namespace internals { /** * Get data from cache */ - getFromCache(fn: (arg0: internals.SortableSet) => R): R; + getFromCache(fn: (arg0: webpack.SortableSet) => R): R; /** * Get data from cache (ignoring sorting) */ - getFromUnorderedCache(fn: (arg0: internals.SortableSet) => R): R; + getFromUnorderedCache(fn: (arg0: webpack.SortableSet) => R): R; toJSON(): Array; + + /** + * Iterates over values in the set. + */ + [Symbol.iterator](): IterableIterator; + readonly [Symbol.toStringTag]: string; } export abstract class Source { size(): number; - map(options: internals.MapOptions): Object; + map(options: webpack.MapOptions): Object; sourceAndMap( - options: internals.MapOptions + options: webpack.MapOptions ): { source: string | Buffer; map: Object }; - updateHash(hash: internals.Hash): void; + updateHash(hash: webpack.Hash): void; source(): string | Buffer; buffer(): Buffer; } @@ -8048,22 +7967,22 @@ declare namespace internals { /** * the dependency templates */ - dependencyTemplates: internals.DependencyTemplates; + dependencyTemplates: webpack.DependencyTemplates; /** * the runtime template */ - runtimeTemplate: internals.RuntimeTemplate; + runtimeTemplate: webpack.RuntimeTemplate; /** * the module graph */ - moduleGraph: internals.ModuleGraph; + moduleGraph: webpack.ModuleGraph; /** * the chunk graph */ - chunkGraph: internals.ChunkGraph; + chunkGraph: webpack.ChunkGraph; /** * the type of source that should be generated @@ -8071,18 +7990,18 @@ declare namespace internals { type?: string; } export class SourceMapDevToolPlugin { - constructor(options?: internals.SourceMapDevToolPluginOptions); + constructor(options?: webpack.SourceMapDevToolPluginOptions); sourceMapFilename: string | false; sourceMappingURLComment: string | false; moduleFilenameTemplate: string | Function; fallbackModuleFilenameTemplate: string | Function; namespace: string; - options: internals.SourceMapDevToolPluginOptions; + options: webpack.SourceMapDevToolPluginOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface SourceMapDevToolPluginOptions { /** @@ -8160,7 +8079,7 @@ declare namespace internals { column?: number; } export interface SplitChunksOptions { - chunksFilter: (chunk: internals.Chunk) => boolean; + chunksFilter: (chunk: webpack.Chunk) => boolean; minSize: Record; minRemainingSize: Record; maxInitialSize: Record; @@ -8171,35 +8090,32 @@ declare namespace internals { hidePathInfo: boolean; filename: | string - | ((arg0: internals.PathData, arg1: internals.AssetInfo) => string); + | ((arg0: webpack.PathData, arg1: webpack.AssetInfo) => string); automaticNameDelimiter: string; getCacheGroups: ( - module: internals.Module, - context: internals.CacheGroupsContext - ) => Array; + module: webpack.Module, + context: webpack.CacheGroupsContext + ) => Array; getName: ( - module?: internals.Module, - chunks?: Array, + module?: webpack.Module, + chunks?: Array, key?: string ) => string; - fallbackCacheGroup: internals.FallbackCacheGroup; + fallbackCacheGroup: webpack.FallbackCacheGroup; } export class SplitChunksPlugin { - constructor(options?: internals.OptimizationSplitChunksOptions); - options: internals.SplitChunksOptions; + constructor(options?: webpack.OptimizationSplitChunksOptions); + options: webpack.SplitChunksOptions; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export abstract class StackedMap { - map: Map< - K, - V | typeof internals.TOMBSTONE | typeof internals.UNDEFINED_MARKER - >; + map: Map; stack: Array< - Map + Map >; set(item: K, value: V): void; delete(item: K): void; @@ -8210,7 +8126,7 @@ declare namespace internals { asPairArray(): Array<[K, V]>; asMap(): Map; readonly size: number; - createChild(): internals.StackedMap; + createChild(): webpack.StackedMap; } export type Statement = | ExpressionStatement @@ -8235,8 +8151,8 @@ declare namespace internals { | VariableDeclaration | ClassDeclaration; export class Stats { - constructor(compilation: internals.Compilation); - compilation: internals.Compilation; + constructor(compilation: webpack.Compilation); + compilation: webpack.Compilation; hash: string; startTime: any; endTime: any; @@ -8578,7 +8494,7 @@ declare namespace internals { hooks: Readonly<{ sortElements: HookMap, any], any>>; printElements: HookMap< - SyncBailHook<[Array, any], any> + SyncBailHook<[Array, any], any> >; sortItems: HookMap, any], any>>; getItemName: HookMap>; @@ -8597,7 +8513,7 @@ declare namespace internals { | "detailed" | "verbose" | "errors-warnings" - | internals.StatsOptions; + | webpack.StatsOptions; export interface SyntheticDependencyLocation { name: string; index?: number; @@ -8606,7 +8522,7 @@ declare namespace internals { export interface TagInfo { tag: any; data: any; - next: internals.TagInfo; + next: webpack.TagInfo; } export type Target = | "web" @@ -8617,7 +8533,7 @@ declare namespace internals { | "electron-main" | "electron-renderer" | "electron-preload" - | ((compiler: internals.Compiler) => void); + | ((compiler: webpack.Compiler) => void); export class Template { constructor(); static getFunctionContent(fn: Function): string; @@ -8631,22 +8547,22 @@ declare namespace internals { static prefix(s: string | Array, prefix: string): string; static asString(str: string | Array): string; static getModulesArrayBounds( - modules: Array + modules: Array ): false | [number, number]; static renderChunkModules( - renderContext: internals.RenderContextModuleTemplate, - modules: Array, - renderModule: (arg0: internals.Module) => internals.Source, + renderContext: webpack.RenderContextModuleTemplate, + modules: Array, + renderModule: (arg0: webpack.Module) => webpack.Source, prefix?: string - ): internals.Source; + ): webpack.Source; static renderRuntimeModules( - runtimeModules: Array, - renderContext: internals.RenderContextModuleTemplate - ): internals.Source; + runtimeModules: Array, + renderContext: webpack.RenderContextModuleTemplate + ): webpack.Source; static renderChunkRuntimeModules( - runtimeModules: Array, - renderContext: internals.RenderContextModuleTemplate - ): internals.Source; + runtimeModules: Array, + renderContext: webpack.RenderContextModuleTemplate + ): webpack.Source; static NUMBER_OF_IDENTIFIER_START_CHARS: number; static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number; } @@ -8655,26 +8571,26 @@ declare namespace internals { /** * the module */ - module: internals.NormalModule; + module: webpack.NormalModule; /** * the compilation */ - compilation: internals.Compilation; + compilation: webpack.Compilation; } export abstract class VariableInfo { - declaredScope: internals.ScopeInfo; + declaredScope: webpack.ScopeInfo; freeName: string | true; - tagInfo: internals.TagInfo; + tagInfo: webpack.TagInfo; } export class WatchIgnorePlugin { - constructor(options: internals.WatchIgnorePluginOptions); + constructor(options: webpack.WatchIgnorePluginOptions); paths: [string | RegExp, string | RegExp]; /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } /** @@ -8716,8 +8632,8 @@ declare namespace internals { export abstract class Watching { startTime: number; invalid: boolean; - handler: internals.CallbackCompiler; - callbacks: Array>; + handler: webpack.CallbackCompiler; + callbacks: Array>; closed: boolean; suspended: boolean; watchOptions: { @@ -8738,7 +8654,7 @@ declare namespace internals { */ stdin?: boolean; }; - compiler: internals.Compiler; + compiler: webpack.Compiler; running: boolean; watcher: any; pausedWatcher: any; @@ -8747,10 +8663,10 @@ declare namespace internals { dirs: Iterable, missing: Iterable ): void; - invalidate(callback: internals.CallbackCompiler): void; + invalidate(callback?: webpack.CallbackCompiler): void; suspend(): void; resume(): void; - close(callback: internals.CallbackCompiler): void; + close(callback: webpack.CallbackCompiler): void; } export class WebWorkerTemplatePlugin { constructor(); @@ -8758,22 +8674,20 @@ declare namespace internals { /** * Apply the plugin */ - apply(compiler: internals.Compiler): void; + apply(compiler: webpack.Compiler): void; } export interface WebpackError extends Error { details: any; - module: internals.Module; - loc: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation; + module: webpack.Module; + loc: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation; hideStack: boolean; - chunk: internals.Chunk; + chunk: webpack.Chunk; file: string; serialize(__0: { write: any }): void; deserialize(__0: { read: any }): void; } export abstract class WebpackLogger { - getChildLogger: (arg0: string | (() => string)) => internals.WebpackLogger; + getChildLogger: (arg0: string | (() => string)) => webpack.WebpackLogger; error(...args: Array): void; warn(...args: Array): void; info(...args: Array): void; @@ -8812,7 +8726,7 @@ declare namespace internals { /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ - cache?: boolean | internals.MemoryCacheOptions | internals.FileCacheOptions; + cache?: boolean | webpack.MemoryCacheOptions | webpack.FileCacheOptions; /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. @@ -8827,7 +8741,7 @@ declare namespace internals { /** * Options for the webpack-dev-server. */ - devServer?: internals.DevServer; + devServer?: webpack.DevServer; /** * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). @@ -8841,16 +8755,16 @@ declare namespace internals { | string | (() => | string - | internals.EntryObject + | webpack.EntryObject | [string, string] - | Promise) - | internals.EntryObject + | Promise) + | webpack.EntryObject | [string, string]; /** * Enables/Disables experiments (experimental features with relax SemVer compatibility). */ - experiments?: internals.Experiments; + experiments?: webpack.Experiments; /** * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. @@ -8911,12 +8825,12 @@ declare namespace internals { /** * Options for infrastructure level logging. */ - infrastructureLogging?: internals.InfrastructureLogging; + infrastructureLogging?: webpack.InfrastructureLogging; /** * Custom values available in the loader context. */ - loader?: internals.Loader; + loader?: webpack.Loader; /** * Enable production optimizations or development hints. @@ -8926,7 +8840,7 @@ declare namespace internals { /** * Options affecting the normal modules (`NormalModuleFactory`). */ - module?: internals.ModuleOptions; + module?: webpack.ModuleOptions; /** * Name of the configuration. Used when loading multiple configurations. @@ -8936,17 +8850,17 @@ declare namespace internals { /** * Include polyfills or mocks for various node stuff. */ - node?: false | internals.NodeOptions; + node?: false | webpack.NodeOptions; /** * Enables/Disables integrated optimizations. */ - optimization?: internals.Optimization; + optimization?: webpack.Optimization; /** * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. */ - output?: internals.Output; + output?: webpack.Output; /** * The number of parallel processed modules in the compilation. @@ -8956,13 +8870,14 @@ declare namespace internals { /** * Configuration for web performance recommendations. */ - performance?: false | internals.PerformanceOptions; + performance?: false | webpack.PerformanceOptions; /** * Add additional plugins to the compiler. */ plugins?: Array< - internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) + | webpack.WebpackPluginInstance >; /** @@ -8988,12 +8903,12 @@ declare namespace internals { /** * Options for the resolver. */ - resolve?: internals.ResolveOptions; + resolve?: webpack.ResolveOptions; /** * Options for the resolver when resolving loaders. */ - resolveLoader?: internals.ResolveOptions; + resolveLoader?: webpack.ResolveOptions; /** * Stats options object or preset name. @@ -9007,7 +8922,7 @@ declare namespace internals { | "detailed" | "verbose" | "errors-warnings" - | internals.StatsOptions; + | webpack.StatsOptions; /** * Environment to build for. @@ -9021,7 +8936,7 @@ declare namespace internals { | "electron-main" | "electron-renderer" | "electron-preload" - | ((compiler: internals.Compiler) => void); + | ((compiler: webpack.Compiler) => void); /** * Enter watch mode, which rebuilds on file change. @@ -9031,9 +8946,9 @@ declare namespace internals { /** * Options for the watcher. */ - watchOptions?: internals.WatchOptions; + watchOptions?: webpack.WatchOptions; } - export class WebpackOptionsApply extends internals.OptionsApply { + export class WebpackOptionsApply extends webpack.OptionsApply { constructor(); } export class WebpackOptionsDefaulter { @@ -9058,7 +8973,7 @@ declare namespace internals { /** * Cache generated modules and chunks to improve performance for multiple incremental builds. */ - cache: false | internals.MemoryCacheOptions | internals.FileCacheOptions; + cache: false | webpack.MemoryCacheOptions | webpack.FileCacheOptions; /** * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory. @@ -9073,7 +8988,7 @@ declare namespace internals { /** * Options for the webpack-dev-server. */ - devServer?: internals.DevServer; + devServer?: webpack.DevServer; /** * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map). @@ -9084,13 +8999,13 @@ declare namespace internals { * The entry point(s) of the compilation. */ entry: - | (() => Promise) - | internals.EntryStaticNormalized; + | (() => Promise) + | webpack.EntryStaticNormalized; /** * Enables/Disables experiments (experimental features with relax SemVer compatibility). */ - experiments: internals.Experiments; + experiments: webpack.Experiments; /** * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`. @@ -9151,12 +9066,12 @@ declare namespace internals { /** * Options for infrastructure level logging. */ - infrastructureLogging: internals.InfrastructureLogging; + infrastructureLogging: webpack.InfrastructureLogging; /** * Custom values available in the loader context. */ - loader?: internals.Loader; + loader?: webpack.Loader; /** * Enable production optimizations or development hints. @@ -9166,7 +9081,7 @@ declare namespace internals { /** * Options affecting the normal modules (`NormalModuleFactory`). */ - module: internals.ModuleOptions; + module: webpack.ModuleOptions; /** * Name of the configuration. Used when loading multiple configurations. @@ -9176,17 +9091,17 @@ declare namespace internals { /** * Include polyfills or mocks for various node stuff. */ - node: false | internals.NodeOptions; + node: false | webpack.NodeOptions; /** * Enables/Disables integrated optimizations. */ - optimization: internals.Optimization; + optimization: webpack.Optimization; /** * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk. */ - output: internals.OutputNormalized; + output: webpack.OutputNormalized; /** * The number of parallel processed modules in the compilation. @@ -9196,13 +9111,14 @@ declare namespace internals { /** * Configuration for web performance recommendations. */ - performance?: false | internals.PerformanceOptions; + performance?: false | webpack.PerformanceOptions; /** * Add additional plugins to the compiler. */ plugins: Array< - internals.WebpackPluginInstance | ((compiler: internals.Compiler) => void) + | ((this: webpack.Compiler, compiler: webpack.Compiler) => void) + | webpack.WebpackPluginInstance >; /** @@ -9223,12 +9139,12 @@ declare namespace internals { /** * Options for the resolver. */ - resolve: internals.ResolveOptions; + resolve: webpack.ResolveOptions; /** * Options for the resolver when resolving loaders. */ - resolveLoader: internals.ResolveOptions; + resolveLoader: webpack.ResolveOptions; /** * Stats options object or preset name. @@ -9242,7 +9158,7 @@ declare namespace internals { | "detailed" | "verbose" | "errors-warnings" - | internals.StatsOptions; + | webpack.StatsOptions; /** * Environment to build for. @@ -9256,7 +9172,7 @@ declare namespace internals { | "electron-main" | "electron-renderer" | "electron-preload" - | ((compiler: internals.Compiler) => void); + | ((compiler: webpack.Compiler) => void); /** * Enter watch mode, which rebuilds on file change. @@ -9266,7 +9182,7 @@ declare namespace internals { /** * Options for the watcher. */ - watchOptions: internals.WatchOptions; + watchOptions: webpack.WatchOptions; } /** @@ -9278,7 +9194,7 @@ declare namespace internals { /** * The run point of the plugin, required method. */ - apply: (compiler: internals.Compiler) => void; + apply: (compiler: webpack.Compiler) => void; } export interface WithId { id: string | number; @@ -9287,29 +9203,28 @@ declare namespace internals { /** * create a resolver with additional/different options */ - withOptions: (arg0?: any) => internals.Resolver & internals.WithOptions; + withOptions: (arg0?: any) => webpack.Resolver & webpack.WithOptions; } export interface WriteOnlySet { add(item: T): void; } export namespace __TypeLibIndex { - export let webpack: ( - options: internals.WebpackOptions | Array, - callback: internals.CallbackWebpack< - internals.Stats | internals.MultiStats - > - ) => internals.Compiler | internals.MultiCompiler; - export let validate: any; - export let validateSchema: (schema?: any, options?: any) => void; - export let version: any; + export const webpack: ( + options: webpack.WebpackOptions | Array, + callback?: webpack.CallbackWebpack + ) => webpack.Compiler | webpack.MultiCompiler; + export const validate: any; + export const validateSchema: (schema?: any, options?: any) => void; + export const version: any; export const WebpackOptionsValidationError: ValidationError; export const ValidationError: ValidationError; export { - WebpackOptionsApply, cli, AutomaticPrefetchPlugin, BannerPlugin, Cache, + Chunk, + ChunkGraph, Compilation, Compiler, ContextExclusionPlugin, @@ -9323,6 +9238,7 @@ declare namespace internals { EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, + ExternalModule, ExternalsPlugin, Generator, HotModuleReplacementPlugin, @@ -9334,6 +9250,7 @@ declare namespace internals { LoaderTargetPlugin, Module, ModuleFilenameHelpers, + ModuleGraph, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, @@ -9349,6 +9266,7 @@ declare namespace internals { Stats, Template, WatchIgnorePlugin, + WebpackOptionsApply, WebpackOptionsDefaulter, __TypeLiteral_12 as cache, __TypeLiteral_1 as config, @@ -9366,10 +9284,10 @@ declare namespace internals { } export namespace __TypeLiteral_1 { export const getNormalizedWebpackOptions: ( - config: internals.WebpackOptions - ) => internals.WebpackOptionsNormalized; + config: webpack.WebpackOptions + ) => webpack.WebpackOptionsNormalized; export const applyWebpackOptionsDefaults: ( - options: internals.WebpackOptionsNormalized + options: webpack.WebpackOptionsNormalized ) => void; } export namespace __TypeLiteral_10 { @@ -9377,8 +9295,8 @@ declare namespace internals { } export namespace __TypeLiteral_11 { export const createHash: ( - algorithm: string | typeof internals.Hash - ) => internals.Hash; + algorithm: string | typeof webpack.Hash + ) => webpack.Hash; export { comparators, serialization }; } export namespace __TypeLiteral_12 { @@ -9449,11 +9367,9 @@ declare namespace internals { | __TypeWebpackOptions | Array; export namespace cli { - export let getArguments: ( - schema?: any - ) => Record; + export let getArguments: (schema?: any) => Record; export let processArguments: ( - args: Record, + args: Record, config: any, values: Record< string, @@ -9463,41 +9379,41 @@ declare namespace internals { | RegExp | Array > - ) => Array; + ) => Array; } export namespace comparators { export let compareChunksById: ( - a: internals.Chunk, - b: internals.Chunk + a: webpack.Chunk, + b: webpack.Chunk ) => 0 | 1 | -1; export let compareModulesByIdentifier: ( - a: internals.Module, - b: internals.Module + a: webpack.Module, + b: webpack.Module ) => 0 | 1 | -1; export let compareModulesById: ( - arg0: internals.ChunkGraph - ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + arg0: webpack.ChunkGraph + ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; export let compareNumbers: (a: number, b: number) => 0 | 1 | -1; export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1; export let compareModulesByPostOrderIndexOrIdentifier: ( - arg0: internals.ModuleGraph - ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + arg0: webpack.ModuleGraph + ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; export let compareModulesByPreOrderIndexOrIdentifier: ( - arg0: internals.ModuleGraph - ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + arg0: webpack.ModuleGraph + ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; export let compareModulesByIdOrIdentifier: ( - arg0: internals.ChunkGraph - ) => (arg0: internals.Module, arg1: internals.Module) => 0 | 1 | -1; + arg0: webpack.ChunkGraph + ) => (arg0: webpack.Module, arg1: webpack.Module) => 0 | 1 | -1; export let compareChunks: ( - arg0: internals.ChunkGraph - ) => (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1; + arg0: webpack.ChunkGraph + ) => (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1; export let compareIds: ( a: string | number, b: string | number ) => 0 | 1 | -1; export let compareChunkGroupsByIndex: ( - a: internals.ChunkGroup, - b: internals.ChunkGroup + a: webpack.ChunkGroup, + b: webpack.ChunkGroup ) => 0 | 1 | -1; export let concatComparators: ( c1: (arg0: T, arg1: T) => 0 | 1 | -1, @@ -9515,39 +9431,39 @@ declare namespace internals { iterable: Iterable ) => (arg0: T, arg1: T) => 0 | 1 | -1; export let compareChunksNatural: ( - chunkGraph: internals.ChunkGraph - ) => (arg0: internals.Chunk, arg1: internals.Chunk) => 0 | 1 | -1; + chunkGraph: webpack.ChunkGraph + ) => (arg0: webpack.Chunk, arg1: webpack.Chunk) => 0 | 1 | -1; export let compareLocations: ( - a: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation, - b: - | internals.SyntheticDependencyLocation - | internals.RealDependencyLocation + a: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation, + b: webpack.SyntheticDependencyLocation | webpack.RealDependencyLocation ) => 0 | 1 | -1; } export function exports( - options: internals.WebpackOptions | Array, - callback: internals.CallbackWebpack - ): internals.Compiler | internals.MultiCompiler; + options: webpack.WebpackOptions | Array, + callback?: webpack.CallbackWebpack + ): webpack.Compiler | webpack.MultiCompiler; export namespace exports { - export let webpack: ( - options: internals.WebpackOptions | Array, - callback: internals.CallbackWebpack< - internals.Stats | internals.MultiStats - > - ) => internals.Compiler | internals.MultiCompiler; - export let validate: any; - export let validateSchema: (schema?: any, options?: any) => void; - export let version: any; + export const webpack: ( + options: webpack.WebpackOptions | Array, + callback?: webpack.CallbackWebpack + ) => webpack.Compiler | webpack.MultiCompiler; + export const validate: any; + export const validateSchema: (schema?: any, options?: any) => void; + export const version: any; export const WebpackOptionsValidationError: ValidationError; export const ValidationError: ValidationError; + export type WebpackPluginFunction = ( + this: webpack.Compiler, + compiler: webpack.Compiler + ) => void; + export type ParserState = Record & webpack.ParserStateBase; export { - WebpackOptionsApply, cli, AutomaticPrefetchPlugin, BannerPlugin, Cache, + Chunk, + ChunkGraph, Compilation, Compiler, ContextExclusionPlugin, @@ -9561,6 +9477,7 @@ declare namespace internals { EnvironmentPlugin, EvalDevToolModulePlugin, EvalSourceMapDevToolPlugin, + ExternalModule, ExternalsPlugin, Generator, HotModuleReplacementPlugin, @@ -9572,6 +9489,7 @@ declare namespace internals { LoaderTargetPlugin, Module, ModuleFilenameHelpers, + ModuleGraph, NoEmitOnErrorsPlugin, NormalModule, NormalModuleReplacementPlugin, @@ -9587,6 +9505,7 @@ declare namespace internals { Stats, Template, WatchIgnorePlugin, + WebpackOptionsApply, WebpackOptionsDefaulter, __TypeLiteral_12 as cache, __TypeLiteral_1 as config, @@ -9600,7 +9519,8 @@ declare namespace internals { __TypeLiteral_9 as library, __TypeLiteral_10 as debug, __TypeLiteral_11 as util, - WebpackOptions as Configuration + WebpackOptions as Configuration, + WebpackPluginInstance }; } export namespace serialization { @@ -9608,7 +9528,7 @@ declare namespace internals { Constructor: { new (...params: Array): any }, request: string, name: string, - serializer: internals.ObjectSerializer + serializer: webpack.ObjectSerializer ) => void; export let registerLoader: ( regExp: RegExp, @@ -9618,10 +9538,10 @@ declare namespace internals { new (...params: Array): any; }) => void; export let NOT_SERIALIZABLE: {}; - export let buffersSerializer: internals.Serializer; - export let createFileSerializer: (fs?: any) => internals.Serializer; + export let buffersSerializer: webpack.Serializer; + export let createFileSerializer: (fs?: any) => webpack.Serializer; export { MEASURE_START_OPERATION, MEASURE_END_OPERATION }; } } -export = internals.exports; +export = webpack.exports; diff --git a/yarn.lock b/yarn.lock index 2103623af..d633df1be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6765,9 +6765,9 @@ toml@^3.0.0: resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== -tooling@webpack/tooling: +tooling@webpack/tooling#v1.0.0: version "1.0.0" - resolved "https://codeload.github.com/webpack/tooling/tar.gz/c960d3590c197b9a68a17c5f0ca4896623c6c0d6" + resolved "https://codeload.github.com/webpack/tooling/tar.gz/275ad8a94cca2040934655c07ea70bcb6d92c7b9" dependencies: "@yarnpkg/lockfile" "^1.1.0" commondir "^1.0.1"