webpack 5.106.2 → 5.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/APIPlugin.js +1 -1
- package/lib/Cache.js +3 -6
- package/lib/CompatibilityPlugin.js +8 -7
- package/lib/Compilation.js +34 -26
- package/lib/Compiler.js +4 -13
- package/lib/ContextModule.js +2 -2
- package/lib/DefinePlugin.js +2 -2
- package/lib/Dependency.js +22 -1
- package/lib/DependencyTemplate.js +2 -1
- package/lib/EnvironmentPlugin.js +1 -1
- package/lib/EvalSourceMapDevToolPlugin.js +8 -9
- package/lib/ExternalModule.js +76 -15
- package/lib/ExternalModuleFactoryPlugin.js +5 -0
- package/lib/FileSystemInfo.js +187 -72
- package/lib/Generator.js +3 -3
- package/lib/HotModuleReplacementPlugin.js +26 -8
- package/lib/IgnorePlugin.js +2 -1
- package/lib/Module.js +19 -18
- package/lib/ModuleFactory.js +1 -1
- package/lib/ModuleSourceTypeConstants.js +31 -1
- package/lib/ModuleTypeConstants.js +12 -3
- package/lib/MultiCompiler.js +2 -2
- package/lib/NodeStuffPlugin.js +1 -1
- package/lib/NormalModule.js +13 -31
- package/lib/NormalModuleFactory.js +10 -2
- package/lib/Parser.js +1 -1
- package/lib/ProgressPlugin.js +129 -56
- package/lib/RuntimeGlobals.js +5 -5
- package/lib/RuntimeModule.js +9 -7
- package/lib/RuntimePlugin.js +11 -0
- package/lib/WarnCaseSensitiveModulesPlugin.js +70 -2
- package/lib/WarnDeprecatedOptionPlugin.js +1 -1
- package/lib/WarnNoModeSetPlugin.js +16 -1
- package/lib/Watching.js +2 -3
- package/lib/WebpackError.js +3 -77
- package/lib/WebpackIsIncludedPlugin.js +1 -1
- package/lib/WebpackOptionsApply.js +13 -1
- package/lib/asset/AssetBytesGenerator.js +6 -2
- package/lib/asset/AssetGenerator.js +22 -8
- package/lib/asset/AssetModulesPlugin.js +3 -1
- package/lib/asset/AssetSourceGenerator.js +6 -2
- package/lib/buildChunkGraph.js +4 -6
- package/lib/cache/PackFileCacheStrategy.js +4 -4
- package/lib/cli.js +3 -1
- package/lib/config/defaults.js +197 -10
- package/lib/config/normalization.js +3 -1
- package/lib/css/CssGenerator.js +320 -105
- package/lib/css/CssInjectStyleRuntimeModule.js +44 -42
- package/lib/css/CssLoadingRuntimeModule.js +22 -4
- package/lib/{CssModule.js → css/CssModule.js} +15 -15
- package/lib/css/CssModulesPlugin.js +166 -86
- package/lib/css/CssParser.js +566 -269
- package/lib/css/walkCssTokens.js +148 -2
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +1 -1
- package/lib/dependencies/CommonJsDependencyHelpers.js +63 -0
- package/lib/dependencies/CommonJsExportRequireDependency.js +54 -10
- package/lib/dependencies/CommonJsExportsParserPlugin.js +1 -1
- package/lib/dependencies/CommonJsFullRequireDependency.js +32 -9
- package/lib/dependencies/CommonJsImportsParserPlugin.js +4 -3
- package/lib/dependencies/CommonJsRequireDependency.js +67 -4
- package/lib/dependencies/ContextDependency.js +1 -1
- package/lib/dependencies/ContextDependencyHelpers.js +1 -1
- package/lib/dependencies/CreateRequireParserPlugin.js +1 -1
- package/lib/dependencies/CriticalDependencyWarning.js +1 -1
- package/lib/dependencies/CssIcssExportDependency.js +332 -67
- package/lib/dependencies/CssIcssImportDependency.js +49 -7
- package/lib/dependencies/CssIcssSymbolDependency.js +11 -3
- package/lib/dependencies/CssImportDependency.js +8 -0
- package/lib/dependencies/CssUrlDependency.js +25 -0
- package/lib/dependencies/HarmonyDetectionParserPlugin.js +1 -1
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +8 -7
- package/lib/dependencies/HarmonyExportExpressionDependency.js +22 -14
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +110 -3
- package/lib/dependencies/HarmonyImportDependency.js +10 -2
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +22 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +1 -1
- package/lib/{HarmonyLinkingError.js → dependencies/HarmonyLinkingError.js} +5 -3
- package/lib/dependencies/HtmlInlineScriptDependency.js +133 -0
- package/lib/dependencies/HtmlInlineStyleDependency.js +101 -0
- package/lib/dependencies/HtmlScriptSrcDependency.js +318 -0
- package/lib/dependencies/HtmlSourceDependency.js +127 -0
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -1
- package/lib/dependencies/ImportParserPlugin.js +2 -2
- package/lib/dependencies/ImportPhase.js +1 -1
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +1 -1
- package/lib/{RequireJsStuffPlugin.js → dependencies/RequireJsStuffPlugin.js} +7 -7
- package/lib/dependencies/SystemPlugin.js +1 -1
- package/lib/dependencies/WebAssemblyImportDependency.js +1 -1
- package/lib/dependencies/WorkerPlugin.js +2 -2
- package/lib/{DelegatedModule.js → dll/DelegatedModule.js} +31 -31
- package/lib/{DelegatedModuleFactoryPlugin.js → dll/DelegatedModuleFactoryPlugin.js} +4 -4
- package/lib/{DelegatedPlugin.js → dll/DelegatedPlugin.js} +2 -2
- package/lib/{DllEntryPlugin.js → dll/DllEntryPlugin.js} +4 -4
- package/lib/{DllModule.js → dll/DllModule.js} +24 -24
- package/lib/{DllModuleFactory.js → dll/DllModuleFactory.js} +4 -4
- package/lib/{DllPlugin.js → dll/DllPlugin.js} +6 -5
- package/lib/{DllReferencePlugin.js → dll/DllReferencePlugin.js} +14 -14
- package/lib/{LibManifestPlugin.js → dll/LibManifestPlugin.js} +9 -9
- package/lib/{AsyncDependencyToInitialChunkError.js → errors/AsyncDependencyToInitialChunkError.js} +2 -2
- package/lib/errors/BuildCycleError.js +1 -1
- package/lib/{ChunkRenderError.js → errors/ChunkRenderError.js} +1 -1
- package/lib/{CodeGenerationError.js → errors/CodeGenerationError.js} +1 -1
- package/lib/{CommentCompilationWarning.js → errors/CommentCompilationWarning.js} +3 -3
- package/lib/{ConcurrentCompilationError.js → errors/ConcurrentCompilationError.js} +4 -2
- package/lib/{EnvironmentNotSupportAsyncWarning.js → errors/EnvironmentNotSupportAsyncWarning.js} +4 -4
- package/lib/{HookWebpackError.js → errors/HookWebpackError.js} +5 -5
- package/lib/{IgnoreErrorModuleFactory.js → errors/IgnoreErrorModuleFactory.js} +4 -4
- package/lib/{InvalidDependenciesModuleWarning.js → errors/InvalidDependenciesModuleWarning.js} +3 -3
- package/lib/errors/JSONParseError.js +114 -0
- package/lib/{ModuleBuildError.js → errors/ModuleBuildError.js} +5 -5
- package/lib/{ModuleDependencyError.js → errors/ModuleDependencyError.js} +2 -2
- package/lib/{ModuleDependencyWarning.js → errors/ModuleDependencyWarning.js} +4 -4
- package/lib/{ModuleError.js → errors/ModuleError.js} +5 -5
- package/lib/{ModuleHashingError.js → errors/ModuleHashingError.js} +1 -1
- package/lib/{ModuleNotFoundError.js → errors/ModuleNotFoundError.js} +2 -2
- package/lib/{ModuleParseError.js → errors/ModuleParseError.js} +8 -6
- package/lib/{ModuleRestoreError.js → errors/ModuleRestoreError.js} +1 -1
- package/lib/{ModuleStoreError.js → errors/ModuleStoreError.js} +1 -1
- package/lib/{ModuleWarning.js → errors/ModuleWarning.js} +5 -5
- package/lib/{NodeStuffInWebError.js → errors/NodeStuffInWebError.js} +4 -4
- package/lib/errors/NonErrorEmittedError.js +28 -0
- package/lib/{UnhandledSchemeError.js → errors/UnhandledSchemeError.js} +2 -2
- package/lib/{UnsupportedFeatureWarning.js → errors/UnsupportedFeatureWarning.js} +3 -3
- package/lib/errors/WebpackError.js +84 -0
- package/lib/html/HtmlGenerator.js +379 -0
- package/lib/html/HtmlModulesPlugin.js +433 -0
- package/lib/html/HtmlParser.js +1489 -0
- package/lib/html/walkHtmlTokens.js +2733 -0
- package/lib/ids/IdHelpers.js +2 -1
- package/lib/index.js +34 -15
- package/lib/javascript/JavascriptModulesPlugin.js +89 -8
- package/lib/javascript/JavascriptParser.js +197 -16
- package/lib/javascript/JavascriptParserHelpers.js +1 -1
- package/lib/json/JsonParser.js +7 -16
- package/lib/library/AbstractLibraryPlugin.js +1 -1
- package/lib/library/EnableLibraryPlugin.js +1 -1
- package/lib/{FalseIIFEUmdWarning.js → library/FalseIIFEUmdWarning.js} +1 -1
- package/lib/library/ModuleLibraryPlugin.js +74 -0
- package/lib/node/NodeEnvironmentPlugin.js +4 -2
- package/lib/node/nodeConsole.js +113 -64
- package/lib/optimize/ConcatenatedModule.js +51 -6
- package/lib/optimize/InnerGraph.js +1 -1
- package/lib/optimize/InnerGraphPlugin.js +11 -1
- package/lib/optimize/MinMaxSizeWarning.js +4 -4
- package/lib/optimize/ModuleConcatenationPlugin.js +15 -7
- package/lib/optimize/RealContentHashPlugin.js +89 -26
- package/lib/optimize/SideEffectsFlagPlugin.js +111 -3
- package/lib/optimize/SplitChunksPlugin.js +1 -1
- package/lib/performance/AssetsOverSizeLimitWarning.js +2 -2
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +2 -2
- package/lib/performance/NoAsyncChunksWarning.js +5 -3
- package/lib/performance/SizeLimitsPlugin.js +1 -1
- package/lib/prefetch/ChunkPrefetchTriggerRuntimeModule.js +4 -1
- package/lib/rules/UseEffectRulePlugin.js +4 -3
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +119 -13
- package/lib/runtime/SetAnonymousDefaultNameRuntimeModule.js +35 -0
- package/lib/schemes/DataUriPlugin.js +13 -1
- package/lib/schemes/VirtualUrlPlugin.js +1 -1
- package/lib/serialization/SerializerMiddleware.js +2 -2
- package/lib/sharing/ConsumeSharedPlugin.js +2 -2
- package/lib/sharing/ConsumeSharedRuntimeModule.js +8 -4
- package/lib/sharing/ProvideSharedModule.js +1 -1
- package/lib/sharing/ProvideSharedPlugin.js +1 -1
- package/lib/sharing/resolveMatchedConfigs.js +1 -1
- package/lib/stats/DefaultStatsFactoryPlugin.js +2 -2
- package/lib/stats/DefaultStatsPresetPlugin.js +1 -1
- package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
- package/lib/stats/StatsFactory.js +1 -1
- package/lib/typescript/TypeScriptPlugin.js +210 -0
- package/lib/url/URLParserPlugin.js +2 -2
- package/lib/util/AsyncQueue.js +2 -2
- package/lib/util/Hash.js +2 -2
- package/lib/util/LocConverter.js +53 -0
- package/lib/util/SortableSet.js +1 -1
- package/lib/util/cleverMerge.js +2 -2
- package/lib/util/comparators.js +3 -3
- package/lib/util/concatenate.js +3 -3
- package/lib/util/conventions.js +42 -1
- package/lib/util/createMappings.js +118 -0
- package/lib/{formatLocation.js → util/formatLocation.js} +2 -2
- package/lib/{SizeFormatHelpers.js → util/formatSize.js} +3 -1
- package/lib/util/fs.js +8 -8
- package/lib/util/hash/md4.js +1 -1
- package/lib/util/hash/xxhash64.js +1 -1
- package/lib/util/identifier.js +48 -0
- package/lib/util/internalSerializables.js +35 -19
- package/lib/util/magicComment.js +10 -7
- package/lib/util/parseJson.js +2 -73
- package/lib/util/source.js +21 -0
- package/lib/util/topologicalSort.js +69 -0
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +2 -2
- package/lib/wasm-async/AsyncWebAssemblyParser.js +1 -1
- package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +5 -3
- package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +1 -1
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +5 -3
- package/lib/webpack.js +3 -1
- package/package.json +22 -20
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +118 -3
- package/schemas/plugins/{DllPlugin.check.d.ts → HtmlGeneratorOptions.check.d.ts} +1 -1
- package/schemas/plugins/HtmlGeneratorOptions.check.js +6 -0
- package/schemas/plugins/HtmlGeneratorOptions.json +3 -0
- package/schemas/plugins/ProgressPlugin.check.js +1 -1
- package/schemas/plugins/ProgressPlugin.json +22 -0
- package/schemas/plugins/{DllReferencePlugin.check.d.ts → css/CssAutoOrModuleParserOptions.check.d.ts} +1 -1
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.check.js +6 -0
- package/schemas/plugins/css/CssAutoOrModuleParserOptions.json +3 -0
- package/schemas/plugins/dll/DllPlugin.check.d.ts +7 -0
- package/schemas/plugins/dll/DllReferencePlugin.check.d.ts +7 -0
- package/types.d.ts +810 -101
- package/lib/CaseSensitiveModulesWarning.js +0 -80
- package/lib/GraphHelpers.js +0 -49
- package/lib/NoModeWarning.js +0 -23
- package/lib/css/CssMergeStyleSheetsRuntimeModule.js +0 -57
- /package/lib/{AbstractMethodError.js → errors/AbstractMethodError.js} +0 -0
- /package/schemas/plugins/{DllPlugin.check.js → dll/DllPlugin.check.js} +0 -0
- /package/schemas/plugins/{DllPlugin.json → dll/DllPlugin.json} +0 -0
- /package/schemas/plugins/{DllReferencePlugin.check.js → dll/DllReferencePlugin.check.js} +0 -0
- /package/schemas/plugins/{DllReferencePlugin.json → dll/DllReferencePlugin.json} +0 -0
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const { cutOffLoaderExecution } = require("
|
|
8
|
+
const { cutOffLoaderExecution } = require("../ErrorHelpers");
|
|
9
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
9
10
|
const WebpackError = require("./WebpackError");
|
|
10
|
-
const makeSerializable = require("./util/makeSerializable");
|
|
11
11
|
|
|
12
|
-
/** @typedef {import("
|
|
13
|
-
/** @typedef {import("
|
|
12
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
13
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
|
14
14
|
|
|
15
15
|
/** @typedef {Error & { hideStack?: boolean }} ErrorWithHideStack */
|
|
16
16
|
|
|
@@ -81,6 +81,6 @@ class ModuleBuildError extends WebpackError {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
makeSerializable(ModuleBuildError, "webpack/lib/ModuleBuildError");
|
|
84
|
+
makeSerializable(ModuleBuildError, "webpack/lib/errors/ModuleBuildError");
|
|
85
85
|
|
|
86
86
|
module.exports = ModuleBuildError;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
const WebpackError = require("./WebpackError");
|
|
9
9
|
|
|
10
|
-
/** @typedef {import("
|
|
11
|
-
/** @typedef {import("
|
|
10
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
|
11
|
+
/** @typedef {import("../Module")} Module */
|
|
12
12
|
/** @typedef {import("./ModuleBuildError").ErrorWithHideStack} ErrorWithHideStack */
|
|
13
13
|
|
|
14
14
|
class ModuleDependencyError extends WebpackError {
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
8
9
|
const WebpackError = require("./WebpackError");
|
|
9
|
-
const makeSerializable = require("./util/makeSerializable");
|
|
10
10
|
|
|
11
|
-
/** @typedef {import("
|
|
12
|
-
/** @typedef {import("
|
|
11
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
|
12
|
+
/** @typedef {import("../Module")} Module */
|
|
13
13
|
/** @typedef {import("./ModuleDependencyError").ErrorWithHideStack} ErrorWithHideStack */
|
|
14
14
|
|
|
15
15
|
class ModuleDependencyWarning extends WebpackError {
|
|
@@ -44,7 +44,7 @@ class ModuleDependencyWarning extends WebpackError {
|
|
|
44
44
|
|
|
45
45
|
makeSerializable(
|
|
46
46
|
ModuleDependencyWarning,
|
|
47
|
-
"webpack/lib/ModuleDependencyWarning"
|
|
47
|
+
"webpack/lib/errors/ModuleDependencyWarning"
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
module.exports = ModuleDependencyWarning;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const { cleanUp } = require("
|
|
8
|
+
const { cleanUp } = require("../ErrorHelpers");
|
|
9
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
9
10
|
const WebpackError = require("./WebpackError");
|
|
10
|
-
const makeSerializable = require("./util/makeSerializable");
|
|
11
11
|
|
|
12
|
-
/** @typedef {import("
|
|
13
|
-
/** @typedef {import("
|
|
12
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
13
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
|
14
14
|
|
|
15
15
|
class ModuleError extends WebpackError {
|
|
16
16
|
/**
|
|
@@ -66,6 +66,6 @@ class ModuleError extends WebpackError {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
makeSerializable(ModuleError, "webpack/lib/ModuleError");
|
|
69
|
+
makeSerializable(ModuleError, "webpack/lib/errors/ModuleError");
|
|
70
70
|
|
|
71
71
|
module.exports = ModuleError;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
const WebpackError = require("./WebpackError");
|
|
9
9
|
|
|
10
|
-
/** @typedef {import("
|
|
11
|
-
/** @typedef {import("
|
|
10
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
|
11
|
+
/** @typedef {import("../Module")} Module */
|
|
12
12
|
|
|
13
13
|
const previouslyPolyfilledBuiltinModules = {
|
|
14
14
|
assert: "assert/",
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
8
9
|
const WebpackError = require("./WebpackError");
|
|
9
|
-
const makeSerializable = require("./util/makeSerializable");
|
|
10
10
|
|
|
11
|
-
/** @typedef {import("
|
|
12
|
-
/** @typedef {import("
|
|
13
|
-
/** @typedef {import("
|
|
14
|
-
/** @typedef {import("
|
|
11
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
|
12
|
+
/** @typedef {import("../Dependency").SourcePosition} SourcePosition */
|
|
13
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
14
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
|
15
15
|
|
|
16
16
|
const WASM_HEADER = Buffer.from([0x00, 0x61, 0x73, 0x6d]);
|
|
17
17
|
|
|
@@ -94,7 +94,9 @@ class ModuleParseError extends WebpackError {
|
|
|
94
94
|
|
|
95
95
|
/** @type {string} */
|
|
96
96
|
this.name = "ModuleParseError";
|
|
97
|
+
/** @type {undefined | DependencyLocation} */
|
|
97
98
|
this.loc = loc;
|
|
99
|
+
/** @type {Error} */
|
|
98
100
|
this.error = err;
|
|
99
101
|
}
|
|
100
102
|
|
|
@@ -123,6 +125,6 @@ class ModuleParseError extends WebpackError {
|
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
|
|
126
|
-
makeSerializable(ModuleParseError, "webpack/lib/ModuleParseError");
|
|
128
|
+
makeSerializable(ModuleParseError, "webpack/lib/errors/ModuleParseError");
|
|
127
129
|
|
|
128
130
|
module.exports = ModuleParseError;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const { cleanUp } = require("
|
|
8
|
+
const { cleanUp } = require("../ErrorHelpers");
|
|
9
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
9
10
|
const WebpackError = require("./WebpackError");
|
|
10
|
-
const makeSerializable = require("./util/makeSerializable");
|
|
11
11
|
|
|
12
|
-
/** @typedef {import("
|
|
13
|
-
/** @typedef {import("
|
|
12
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
13
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
|
14
14
|
|
|
15
15
|
class ModuleWarning extends WebpackError {
|
|
16
16
|
/**
|
|
@@ -65,7 +65,7 @@ class ModuleWarning extends WebpackError {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
makeSerializable(ModuleWarning, "webpack/lib/ModuleWarning");
|
|
68
|
+
makeSerializable(ModuleWarning, "webpack/lib/errors/ModuleWarning");
|
|
69
69
|
|
|
70
70
|
/** @type {typeof ModuleWarning} */
|
|
71
71
|
module.exports = ModuleWarning;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
-
Author
|
|
3
|
+
Author Tobias Koppers @sokra
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const makeSerializable = require("./util/makeSerializable");
|
|
8
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
11
|
+
const WebpackError = require("./WebpackError");
|
|
12
12
|
|
|
13
13
|
class NodeStuffInWebError extends WebpackError {
|
|
14
14
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
+
Author Tobias Koppers @sokra
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
9
|
+
const WebpackError = require("./WebpackError");
|
|
10
|
+
|
|
11
|
+
class NonErrorEmittedError extends WebpackError {
|
|
12
|
+
/**
|
|
13
|
+
* @param {EXPECTED_ANY} error value which is not an instance of Error
|
|
14
|
+
*/
|
|
15
|
+
constructor(error) {
|
|
16
|
+
super();
|
|
17
|
+
|
|
18
|
+
this.name = "NonErrorEmittedError";
|
|
19
|
+
this.message = `(Emitted value instead of an instance of Error) ${error}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
makeSerializable(
|
|
24
|
+
NonErrorEmittedError,
|
|
25
|
+
"webpack/lib/errors/NonErrorEmittedError"
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
module.exports = NonErrorEmittedError;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
8
9
|
const WebpackError = require("./WebpackError");
|
|
9
|
-
const makeSerializable = require("./util/makeSerializable");
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Error raised when webpack encounters a resource URI scheme that no installed
|
|
@@ -33,7 +33,7 @@ class UnhandledSchemeError extends WebpackError {
|
|
|
33
33
|
|
|
34
34
|
makeSerializable(
|
|
35
35
|
UnhandledSchemeError,
|
|
36
|
-
"webpack/lib/UnhandledSchemeError",
|
|
36
|
+
"webpack/lib/errors/UnhandledSchemeError",
|
|
37
37
|
"UnhandledSchemeError"
|
|
38
38
|
);
|
|
39
39
|
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
8
9
|
const WebpackError = require("./WebpackError");
|
|
9
|
-
const makeSerializable = require("./util/makeSerializable");
|
|
10
10
|
|
|
11
|
-
/** @typedef {import("
|
|
11
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
|
12
12
|
|
|
13
13
|
class UnsupportedFeatureWarning extends WebpackError {
|
|
14
14
|
/**
|
|
@@ -30,7 +30,7 @@ class UnsupportedFeatureWarning extends WebpackError {
|
|
|
30
30
|
|
|
31
31
|
makeSerializable(
|
|
32
32
|
UnsupportedFeatureWarning,
|
|
33
|
-
"webpack/lib/UnsupportedFeatureWarning"
|
|
33
|
+
"webpack/lib/errors/UnsupportedFeatureWarning"
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
module.exports = UnsupportedFeatureWarning;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
+
Author Jarid Margolin @jaridmargolin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
const inspect = require("util").inspect.custom;
|
|
9
|
+
const makeSerializable = require("../util/makeSerializable");
|
|
10
|
+
|
|
11
|
+
/** @typedef {import("../Chunk")} Chunk */
|
|
12
|
+
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
|
13
|
+
/** @typedef {import("../Module")} Module */
|
|
14
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
|
|
15
|
+
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
|
|
16
|
+
|
|
17
|
+
class WebpackError extends Error {
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of WebpackError.
|
|
20
|
+
* @param {string=} message error message
|
|
21
|
+
* @param {{ cause?: unknown }} options error options
|
|
22
|
+
*/
|
|
23
|
+
constructor(message, options = {}) {
|
|
24
|
+
super(message, options);
|
|
25
|
+
|
|
26
|
+
/** @type {string=} */
|
|
27
|
+
this.details = undefined;
|
|
28
|
+
/** @type {(Module | null)=} */
|
|
29
|
+
this.module = undefined;
|
|
30
|
+
/** @type {DependencyLocation=} */
|
|
31
|
+
this.loc = undefined;
|
|
32
|
+
/** @type {boolean=} */
|
|
33
|
+
this.hideStack = undefined;
|
|
34
|
+
/** @type {Chunk=} */
|
|
35
|
+
this.chunk = undefined;
|
|
36
|
+
/** @type {string=} */
|
|
37
|
+
this.file = undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Returns inspect message.
|
|
42
|
+
* @returns {string} inspect message
|
|
43
|
+
*/
|
|
44
|
+
[inspect]() {
|
|
45
|
+
return (
|
|
46
|
+
this.stack +
|
|
47
|
+
(this.details ? `\n${this.details}` : "") +
|
|
48
|
+
(this.cause ? `\n${this.cause}` : "")
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Serializes this instance into the provided serializer context.
|
|
54
|
+
* @param {ObjectSerializerContext} context context
|
|
55
|
+
*/
|
|
56
|
+
serialize({ write }) {
|
|
57
|
+
write(this.name);
|
|
58
|
+
write(this.message);
|
|
59
|
+
write(this.stack);
|
|
60
|
+
write(this.cause);
|
|
61
|
+
write(this.details);
|
|
62
|
+
write(this.loc);
|
|
63
|
+
write(this.hideStack);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Restores this instance from the provided deserializer context.
|
|
68
|
+
* @param {ObjectDeserializerContext} context context
|
|
69
|
+
*/
|
|
70
|
+
deserialize({ read }) {
|
|
71
|
+
this.name = read();
|
|
72
|
+
this.message = read();
|
|
73
|
+
this.stack = read();
|
|
74
|
+
this.cause = read();
|
|
75
|
+
this.details = read();
|
|
76
|
+
this.loc = read();
|
|
77
|
+
this.hideStack = read();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
makeSerializable(WebpackError, "webpack/lib/errors/WebpackError");
|
|
82
|
+
|
|
83
|
+
/** @type {typeof WebpackError} */
|
|
84
|
+
module.exports = WebpackError;
|