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
|
@@ -17,6 +17,7 @@ const {
|
|
|
17
17
|
CSS_TYPE,
|
|
18
18
|
CSS_URL_TYPE,
|
|
19
19
|
CSS_URL_TYPES,
|
|
20
|
+
HTML_TYPE,
|
|
20
21
|
JAVASCRIPT_AND_CSS_URL_TYPES,
|
|
21
22
|
JAVASCRIPT_TYPE,
|
|
22
23
|
JAVASCRIPT_TYPES,
|
|
@@ -29,6 +30,7 @@ const createHash = require("../util/createHash");
|
|
|
29
30
|
const { makePathsRelative } = require("../util/identifier");
|
|
30
31
|
const memoize = require("../util/memoize");
|
|
31
32
|
const nonNumericOnlyHash = require("../util/nonNumericOnlyHash");
|
|
33
|
+
const { updateHashFromSource } = require("../util/source");
|
|
32
34
|
|
|
33
35
|
const getMimeTypes = memoize(() => require("../util/mimeTypes"));
|
|
34
36
|
|
|
@@ -259,7 +261,7 @@ class AssetGenerator extends Generator {
|
|
|
259
261
|
const source = module.originalSource();
|
|
260
262
|
|
|
261
263
|
if (source) {
|
|
262
|
-
hash
|
|
264
|
+
updateHashFromSource(hash, source);
|
|
263
265
|
}
|
|
264
266
|
|
|
265
267
|
if (module.error) {
|
|
@@ -398,7 +400,13 @@ class AssetGenerator extends Generator {
|
|
|
398
400
|
compilation.outputOptions.publicPath === "auto"
|
|
399
401
|
? CssUrlDependency.PUBLIC_PATH_AUTO
|
|
400
402
|
: compilation.getAssetPath(compilation.outputOptions.publicPath, {
|
|
401
|
-
hash:
|
|
403
|
+
hash:
|
|
404
|
+
compilation.hash ||
|
|
405
|
+
`${CssUrlDependency.PUBLIC_PATH_FULL_HASH}0__`,
|
|
406
|
+
hashWithLength: (length) =>
|
|
407
|
+
compilation.hash
|
|
408
|
+
? compilation.hash.slice(0, length)
|
|
409
|
+
: `${CssUrlDependency.PUBLIC_PATH_FULL_HASH}${length}__`
|
|
402
410
|
});
|
|
403
411
|
|
|
404
412
|
assetPath = path + filename;
|
|
@@ -567,7 +575,7 @@ class AssetGenerator extends Generator {
|
|
|
567
575
|
: encodedSource;
|
|
568
576
|
|
|
569
577
|
if (data) {
|
|
570
|
-
data.set("url", {
|
|
578
|
+
data.set("url", { ...data.get("url"), [type]: content });
|
|
571
579
|
}
|
|
572
580
|
} else {
|
|
573
581
|
const [fullContentHash, contentHash] = AssetGenerator.getFullContentHash(
|
|
@@ -606,7 +614,7 @@ class AssetGenerator extends Generator {
|
|
|
606
614
|
);
|
|
607
615
|
|
|
608
616
|
if (data && (type === JAVASCRIPT_TYPE || type === CSS_URL_TYPE)) {
|
|
609
|
-
data.set("url", {
|
|
617
|
+
data.set("url", { ...data.get("url"), [type]: assetPath });
|
|
610
618
|
}
|
|
611
619
|
|
|
612
620
|
if (data) {
|
|
@@ -698,9 +706,12 @@ class AssetGenerator extends Generator {
|
|
|
698
706
|
|
|
699
707
|
if ((module.buildInfo && module.buildInfo.dataUrl) || this.emit === false) {
|
|
700
708
|
if (sourceTypes.size > 0) {
|
|
701
|
-
if (
|
|
709
|
+
if (
|
|
710
|
+
sourceTypes.has(JAVASCRIPT_TYPE) &&
|
|
711
|
+
(sourceTypes.has(CSS_TYPE) || sourceTypes.has(HTML_TYPE))
|
|
712
|
+
) {
|
|
702
713
|
return JAVASCRIPT_AND_CSS_URL_TYPES;
|
|
703
|
-
} else if (sourceTypes.has(CSS_TYPE)) {
|
|
714
|
+
} else if (sourceTypes.has(CSS_TYPE) || sourceTypes.has(HTML_TYPE)) {
|
|
704
715
|
return CSS_URL_TYPES;
|
|
705
716
|
}
|
|
706
717
|
return JAVASCRIPT_TYPES;
|
|
@@ -710,9 +721,12 @@ class AssetGenerator extends Generator {
|
|
|
710
721
|
}
|
|
711
722
|
|
|
712
723
|
if (sourceTypes.size > 0) {
|
|
713
|
-
if (
|
|
724
|
+
if (
|
|
725
|
+
sourceTypes.has(JAVASCRIPT_TYPE) &&
|
|
726
|
+
(sourceTypes.has(CSS_TYPE) || sourceTypes.has(HTML_TYPE))
|
|
727
|
+
) {
|
|
714
728
|
return ASSET_AND_JAVASCRIPT_AND_CSS_URL_TYPES;
|
|
715
|
-
} else if (sourceTypes.has(CSS_TYPE)) {
|
|
729
|
+
} else if (sourceTypes.has(CSS_TYPE) || sourceTypes.has(HTML_TYPE)) {
|
|
716
730
|
return ASSET_AND_CSS_URL_TYPES;
|
|
717
731
|
}
|
|
718
732
|
return ASSET_AND_JAVASCRIPT_TYPES;
|
|
@@ -34,7 +34,9 @@ const memoize = require("../util/memoize");
|
|
|
34
34
|
* @returns {Schema} definition
|
|
35
35
|
*/
|
|
36
36
|
const getSchema = (name) => {
|
|
37
|
-
const { definitions } =
|
|
37
|
+
const { definitions } =
|
|
38
|
+
/** @type {EXPECTED_ANY} */
|
|
39
|
+
(require("../../schemas/WebpackOptions.json"));
|
|
38
40
|
|
|
39
41
|
return {
|
|
40
42
|
definitions,
|
|
@@ -12,6 +12,7 @@ const {
|
|
|
12
12
|
CSS_TYPE,
|
|
13
13
|
CSS_URL_TYPE,
|
|
14
14
|
CSS_URL_TYPES,
|
|
15
|
+
HTML_TYPE,
|
|
15
16
|
JAVASCRIPT_AND_CSS_URL_TYPES,
|
|
16
17
|
JAVASCRIPT_TYPE,
|
|
17
18
|
JAVASCRIPT_TYPES,
|
|
@@ -145,9 +146,12 @@ class AssetSourceGenerator extends Generator {
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
if (sourceTypes.size > 0) {
|
|
148
|
-
if (
|
|
149
|
+
if (
|
|
150
|
+
sourceTypes.has(JAVASCRIPT_TYPE) &&
|
|
151
|
+
(sourceTypes.has(CSS_TYPE) || sourceTypes.has(HTML_TYPE))
|
|
152
|
+
) {
|
|
149
153
|
return JAVASCRIPT_AND_CSS_URL_TYPES;
|
|
150
|
-
} else if (sourceTypes.has(CSS_TYPE)) {
|
|
154
|
+
} else if (sourceTypes.has(CSS_TYPE) || sourceTypes.has(HTML_TYPE)) {
|
|
151
155
|
return CSS_URL_TYPES;
|
|
152
156
|
}
|
|
153
157
|
return JAVASCRIPT_TYPES;
|
package/lib/buildChunkGraph.js
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
|
-
const AsyncDependencyToInitialChunkError = require("./AsyncDependencyToInitialChunkError");
|
|
9
|
-
const { connectChunkGroupParentAndChild } = require("./GraphHelpers");
|
|
10
8
|
const ModuleGraphConnection = require("./ModuleGraphConnection");
|
|
9
|
+
const AsyncDependencyToInitialChunkError = require("./errors/AsyncDependencyToInitialChunkError");
|
|
11
10
|
const { getEntryRuntime, mergeRuntime } = require("./util/runtime");
|
|
12
11
|
|
|
13
12
|
/** @typedef {import("./AsyncDependenciesBlock")} AsyncDependenciesBlock */
|
|
@@ -1311,10 +1310,9 @@ const connectChunkGroups = (
|
|
|
1311
1310
|
chunkGraph.connectBlockAndChunkGroup(block, chunkGroup);
|
|
1312
1311
|
|
|
1313
1312
|
// 4. Connect chunk with parent
|
|
1314
|
-
|
|
1315
|
-
originChunkGroupInfo.chunkGroup
|
|
1316
|
-
|
|
1317
|
-
);
|
|
1313
|
+
if (originChunkGroupInfo.chunkGroup.addChild(chunkGroup)) {
|
|
1314
|
+
chunkGroup.addParent(originChunkGroupInfo.chunkGroup);
|
|
1315
|
+
}
|
|
1318
1316
|
}
|
|
1319
1317
|
}
|
|
1320
1318
|
};
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
const FileSystemInfo = require("../FileSystemInfo");
|
|
9
9
|
const ProgressPlugin = require("../ProgressPlugin");
|
|
10
|
-
const { formatSize } = require("../SizeFormatHelpers");
|
|
11
10
|
const SerializerMiddleware = require("../serialization/SerializerMiddleware");
|
|
12
11
|
const LazySet = require("../util/LazySet");
|
|
12
|
+
const formatSize = require("../util/formatSize");
|
|
13
13
|
const makeSerializable = require("../util/makeSerializable");
|
|
14
14
|
const memoize = require("../util/memoize");
|
|
15
15
|
const {
|
|
@@ -105,7 +105,7 @@ const MIN_CONTENT_SIZE = 1024 * 1024; // 1 MB
|
|
|
105
105
|
const CONTENT_COUNT_TO_MERGE = 10;
|
|
106
106
|
const MIN_ITEMS_IN_FRESH_PACK = 100;
|
|
107
107
|
const MAX_ITEMS_IN_FRESH_PACK = 50000;
|
|
108
|
-
const MAX_TIME_IN_FRESH_PACK =
|
|
108
|
+
const MAX_TIME_IN_FRESH_PACK = 60 * 1000; // 1 min
|
|
109
109
|
|
|
110
110
|
class PackItemInfo {
|
|
111
111
|
/**
|
|
@@ -799,7 +799,7 @@ class PackContentItems {
|
|
|
799
799
|
if (read()) {
|
|
800
800
|
this.map = read();
|
|
801
801
|
} else if (profile) {
|
|
802
|
-
/** @type {
|
|
802
|
+
/** @type {Content} */
|
|
803
803
|
const map = new Map();
|
|
804
804
|
let key = read();
|
|
805
805
|
while (key !== null) {
|
|
@@ -825,7 +825,7 @@ class PackContentItems {
|
|
|
825
825
|
}
|
|
826
826
|
this.map = map;
|
|
827
827
|
} else {
|
|
828
|
-
/** @type {
|
|
828
|
+
/** @type {Content} */
|
|
829
829
|
const map = new Map();
|
|
830
830
|
let key = read();
|
|
831
831
|
while (key !== null) {
|
package/lib/cli.js
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
const path = require("path");
|
|
9
9
|
const tty = require("tty");
|
|
10
|
-
const webpackSchema =
|
|
10
|
+
const webpackSchema =
|
|
11
|
+
/** @type {EXPECTED_ANY} */
|
|
12
|
+
(require("../schemas/WebpackOptions.json"));
|
|
11
13
|
|
|
12
14
|
/** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */
|
|
13
15
|
/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */
|
package/lib/config/defaults.js
CHANGED
|
@@ -22,6 +22,7 @@ const {
|
|
|
22
22
|
CSS_MODULE_TYPE_AUTO,
|
|
23
23
|
CSS_MODULE_TYPE_GLOBAL,
|
|
24
24
|
CSS_MODULE_TYPE_MODULE,
|
|
25
|
+
HTML_MODULE_TYPE,
|
|
25
26
|
JAVASCRIPT_MODULE_TYPE_AUTO,
|
|
26
27
|
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
|
|
27
28
|
JAVASCRIPT_MODULE_TYPE_ESM,
|
|
@@ -431,6 +432,12 @@ const applyWebpackOptionsDefaults = (options, compilerIndex) => {
|
|
|
431
432
|
css:
|
|
432
433
|
/** @type {NonNullable<ExperimentsNormalized["css"]>} */
|
|
433
434
|
(options.experiments.css),
|
|
435
|
+
html:
|
|
436
|
+
/** @type {NonNullable<ExperimentsNormalized["html"]>} */
|
|
437
|
+
(options.experiments.html),
|
|
438
|
+
typescript:
|
|
439
|
+
/** @type {NonNullable<ExperimentsNormalized["typescript"]>} */
|
|
440
|
+
(options.experiments.typescript),
|
|
434
441
|
deferImport:
|
|
435
442
|
/** @type {NonNullable<ExperimentsNormalized["deferImport"]>} */
|
|
436
443
|
(options.experiments.deferImport),
|
|
@@ -444,7 +451,8 @@ const applyWebpackOptionsDefaults = (options, compilerIndex) => {
|
|
|
444
451
|
mode: options.mode,
|
|
445
452
|
outputModule:
|
|
446
453
|
/** @type {NonNullable<WebpackOptionsNormalized["output"]["module"]>} */
|
|
447
|
-
(options.output.module)
|
|
454
|
+
(options.output.module),
|
|
455
|
+
library: options.output.library
|
|
448
456
|
});
|
|
449
457
|
|
|
450
458
|
applyExternalsPresetsDefaults(options.externalsPresets, {
|
|
@@ -516,7 +524,10 @@ const applyWebpackOptionsDefaults = (options, compilerIndex) => {
|
|
|
516
524
|
mode: /** @type {Mode} */ (options.mode),
|
|
517
525
|
css:
|
|
518
526
|
/** @type {NonNullable<ExperimentsNormalized["css"]>} */
|
|
519
|
-
(options.experiments.css)
|
|
527
|
+
(options.experiments.css),
|
|
528
|
+
typescript:
|
|
529
|
+
/** @type {NonNullable<ExperimentsNormalized["typescript"]>} */
|
|
530
|
+
(options.experiments.typescript)
|
|
520
531
|
}),
|
|
521
532
|
options.resolve
|
|
522
533
|
);
|
|
@@ -566,6 +577,10 @@ const applyExperimentsDefaults = (
|
|
|
566
577
|
D(experiments, "deferImport", false);
|
|
567
578
|
D(experiments, "sourceImport", false);
|
|
568
579
|
F(experiments, "css", () => (experiments.futureDefaults ? true : undefined));
|
|
580
|
+
F(experiments, "html", () => (experiments.futureDefaults ? true : undefined));
|
|
581
|
+
F(experiments, "typescript", () =>
|
|
582
|
+
experiments.futureDefaults ? true : undefined
|
|
583
|
+
);
|
|
569
584
|
|
|
570
585
|
if (typeof experiments.buildHttp === "object") {
|
|
571
586
|
D(experiments.buildHttp, "frozen", production);
|
|
@@ -743,11 +758,21 @@ const applySnapshotDefaults = (snapshot, { production, futureDefaults }) => {
|
|
|
743
758
|
* @param {boolean} options.sourceImport is import source enabled
|
|
744
759
|
* @param {boolean} options.isNode is node target platform
|
|
745
760
|
* @param {boolean} options.outputModule is output.module enabled
|
|
761
|
+
* @param {WebpackOptionsNormalized["output"]["library"]} options.library library options
|
|
762
|
+
* @param {boolean} options.typescript is typescript enabled
|
|
746
763
|
* @returns {void}
|
|
747
764
|
*/
|
|
748
765
|
const applyJavascriptParserOptionsDefaults = (
|
|
749
766
|
parserOptions,
|
|
750
|
-
{
|
|
767
|
+
{
|
|
768
|
+
futureDefaults,
|
|
769
|
+
deferImport,
|
|
770
|
+
sourceImport,
|
|
771
|
+
isNode,
|
|
772
|
+
outputModule,
|
|
773
|
+
library,
|
|
774
|
+
typescript
|
|
775
|
+
}
|
|
751
776
|
) => {
|
|
752
777
|
D(parserOptions, "unknownContextRequest", ".");
|
|
753
778
|
D(parserOptions, "unknownContextRegExp", false);
|
|
@@ -770,7 +795,9 @@ const applyJavascriptParserOptionsDefaults = (
|
|
|
770
795
|
D(parserOptions, "dynamicUrl", true);
|
|
771
796
|
D(parserOptions, "deferImport", deferImport);
|
|
772
797
|
D(parserOptions, "sourceImport", sourceImport);
|
|
798
|
+
D(parserOptions, "typescript", typescript);
|
|
773
799
|
if (futureDefaults) D(parserOptions, "exportsPresence", "error");
|
|
800
|
+
D(parserOptions, "anonymousDefaultExportName", !library);
|
|
774
801
|
};
|
|
775
802
|
|
|
776
803
|
/**
|
|
@@ -808,7 +835,9 @@ const applyCssGeneratorOptionsDefaults = (
|
|
|
808
835
|
* @param {boolean} options.cache is caching enabled
|
|
809
836
|
* @param {boolean} options.syncWebAssembly is syncWebAssembly enabled
|
|
810
837
|
* @param {boolean} options.asyncWebAssembly is asyncWebAssembly enabled
|
|
838
|
+
* @param {boolean} options.typescript is typescript enabled
|
|
811
839
|
* @param {boolean} options.css is css enabled
|
|
840
|
+
* @param {boolean} options.html is html enabled
|
|
812
841
|
* @param {boolean} options.futureDefaults is future defaults enabled
|
|
813
842
|
* @param {string} options.uniqueName the unique name
|
|
814
843
|
* @param {boolean} options.isNode is node target platform
|
|
@@ -819,6 +848,7 @@ const applyCssGeneratorOptionsDefaults = (
|
|
|
819
848
|
* @param {HashSalt} options.hashSalt hash salt
|
|
820
849
|
* @param {HashFunction} options.hashFunction hash function
|
|
821
850
|
* @param {boolean} options.outputModule is output.module enabled
|
|
851
|
+
* @param {WebpackOptionsNormalized["output"]["library"]} options.library library options
|
|
822
852
|
* @returns {void}
|
|
823
853
|
*/
|
|
824
854
|
const applyModuleDefaults = (
|
|
@@ -830,6 +860,8 @@ const applyModuleDefaults = (
|
|
|
830
860
|
syncWebAssembly,
|
|
831
861
|
asyncWebAssembly,
|
|
832
862
|
css,
|
|
863
|
+
html,
|
|
864
|
+
typescript,
|
|
833
865
|
futureDefaults,
|
|
834
866
|
isNode,
|
|
835
867
|
uniqueName,
|
|
@@ -837,7 +869,8 @@ const applyModuleDefaults = (
|
|
|
837
869
|
mode,
|
|
838
870
|
deferImport,
|
|
839
871
|
sourceImport,
|
|
840
|
-
outputModule
|
|
872
|
+
outputModule,
|
|
873
|
+
library
|
|
841
874
|
}
|
|
842
875
|
) => {
|
|
843
876
|
if (cache) {
|
|
@@ -899,11 +932,14 @@ const applyModuleDefaults = (
|
|
|
899
932
|
deferImport,
|
|
900
933
|
sourceImport,
|
|
901
934
|
isNode,
|
|
902
|
-
outputModule
|
|
935
|
+
outputModule,
|
|
936
|
+
library,
|
|
937
|
+
typescript
|
|
903
938
|
}
|
|
904
939
|
);
|
|
905
940
|
|
|
906
941
|
F(module.generator, "json", () => ({}));
|
|
942
|
+
|
|
907
943
|
applyJsonGeneratorOptionsDefaults(
|
|
908
944
|
/** @type {NonNullable<GeneratorOptionsByModuleTypeKnown["json"]>} */
|
|
909
945
|
(module.generator.json)
|
|
@@ -1046,6 +1082,16 @@ const applyModuleDefaults = (
|
|
|
1046
1082
|
}
|
|
1047
1083
|
}
|
|
1048
1084
|
|
|
1085
|
+
if (html) {
|
|
1086
|
+
// `module.generator.html.extract` is intentionally left undefined by
|
|
1087
|
+
// default: HtmlGenerator treats undefined as "extract iff this HTML
|
|
1088
|
+
// module is a compilation entry", which is the HTML-entry-point
|
|
1089
|
+
// behaviour. Setting `extract: true` forces extraction for all HTML
|
|
1090
|
+
// modules (including imported ones); `extract: false` disables it
|
|
1091
|
+
// everywhere.
|
|
1092
|
+
F(module.generator, HTML_MODULE_TYPE, () => ({}));
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1049
1095
|
A(module, "defaultRules", () => {
|
|
1050
1096
|
const esm = {
|
|
1051
1097
|
type: JAVASCRIPT_MODULE_TYPE_ESM,
|
|
@@ -1103,6 +1149,7 @@ const applyModuleDefaults = (
|
|
|
1103
1149
|
...esm
|
|
1104
1150
|
}
|
|
1105
1151
|
];
|
|
1152
|
+
|
|
1106
1153
|
if (asyncWebAssembly) {
|
|
1107
1154
|
const wasm = {
|
|
1108
1155
|
type: WEBASSEMBLY_MODULE_TYPE_ASYNC,
|
|
@@ -1148,6 +1195,7 @@ const applyModuleDefaults = (
|
|
|
1148
1195
|
...wasm
|
|
1149
1196
|
});
|
|
1150
1197
|
}
|
|
1198
|
+
|
|
1151
1199
|
if (css) {
|
|
1152
1200
|
const resolve = {
|
|
1153
1201
|
fullySpecified: true,
|
|
@@ -1169,14 +1217,20 @@ const applyModuleDefaults = (
|
|
|
1169
1217
|
resolve
|
|
1170
1218
|
});
|
|
1171
1219
|
// For CSS modules, i.e. `.class { composes: className from "./style.css" }`
|
|
1172
|
-
// We inherit for such constructions
|
|
1220
|
+
// We inherit for such constructions, but skip files that are already
|
|
1221
|
+
// detected as CSS modules by extension (`.module.<ext>`) — they get
|
|
1222
|
+
// the same modules-mode behavior from the auto rule, and forcing a
|
|
1223
|
+
// different type stamp here would create a duplicate module instance.
|
|
1224
|
+
const moduleExtension = /\.module\.\w+$/i;
|
|
1173
1225
|
rules.push({
|
|
1174
1226
|
dependency: /css-import-local-module/,
|
|
1227
|
+
exclude: moduleExtension,
|
|
1175
1228
|
type: CSS_MODULE_TYPE_MODULE,
|
|
1176
1229
|
resolve
|
|
1177
1230
|
});
|
|
1178
1231
|
rules.push({
|
|
1179
1232
|
dependency: /css-import-global-module/,
|
|
1233
|
+
exclude: moduleExtension,
|
|
1180
1234
|
type: CSS_MODULE_TYPE_GLOBAL,
|
|
1181
1235
|
resolve
|
|
1182
1236
|
});
|
|
@@ -1198,6 +1252,72 @@ const applyModuleDefaults = (
|
|
|
1198
1252
|
}
|
|
1199
1253
|
);
|
|
1200
1254
|
}
|
|
1255
|
+
if (html) {
|
|
1256
|
+
const resolve = {
|
|
1257
|
+
fullySpecified: true,
|
|
1258
|
+
preferRelative: true
|
|
1259
|
+
};
|
|
1260
|
+
|
|
1261
|
+
rules.push({
|
|
1262
|
+
test: /\.html$/i,
|
|
1263
|
+
type: HTML_MODULE_TYPE,
|
|
1264
|
+
resolve
|
|
1265
|
+
});
|
|
1266
|
+
rules.push({
|
|
1267
|
+
mimetype: "text/html",
|
|
1268
|
+
type: HTML_MODULE_TYPE,
|
|
1269
|
+
resolve
|
|
1270
|
+
});
|
|
1271
|
+
if (css) {
|
|
1272
|
+
// Inline `<style>` content in an HTML module is fed into the
|
|
1273
|
+
// CSS pipeline as a `data:text/css` virtual module. We force
|
|
1274
|
+
// `exportType: "text"` so the CSS module exposes the
|
|
1275
|
+
// processed CSS text on the `css-text` codegen channel that
|
|
1276
|
+
// `HtmlInlineStyleDependency.Template` reads back into the
|
|
1277
|
+
// `<style>` tag.
|
|
1278
|
+
rules.push({
|
|
1279
|
+
dependency: "html-style",
|
|
1280
|
+
parser: {
|
|
1281
|
+
exportType: "text"
|
|
1282
|
+
},
|
|
1283
|
+
resolve
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
if (typescript) {
|
|
1289
|
+
rules.push(
|
|
1290
|
+
{
|
|
1291
|
+
test: /\.mts$/i,
|
|
1292
|
+
...esm
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
test: /\.ts$/i,
|
|
1296
|
+
descriptionData: {
|
|
1297
|
+
type: "module"
|
|
1298
|
+
},
|
|
1299
|
+
...esm
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
test: /\.cts$/i,
|
|
1303
|
+
...commonjs
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
test: /\.ts$/i,
|
|
1307
|
+
descriptionData: {
|
|
1308
|
+
type: "commonjs"
|
|
1309
|
+
},
|
|
1310
|
+
...commonjs
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
mimetype: {
|
|
1314
|
+
or: ["text/typescript", "application/typescript"]
|
|
1315
|
+
},
|
|
1316
|
+
...esm
|
|
1317
|
+
}
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1201
1321
|
rules.push(
|
|
1202
1322
|
{
|
|
1203
1323
|
dependency: "url",
|
|
@@ -1462,6 +1582,43 @@ const applyOutputDefaults = (
|
|
|
1462
1582
|
}
|
|
1463
1583
|
return "[id].css";
|
|
1464
1584
|
});
|
|
1585
|
+
// Derive html filename defaults from `output.filename` / `output.chunkFilename`
|
|
1586
|
+
// (the same shape the CSS pipeline uses), but if the derived template lacks
|
|
1587
|
+
// any per-module differentiator, fall back to `[name].html` so multiple
|
|
1588
|
+
// extracted HTML modules in one compilation don't collide on the same
|
|
1589
|
+
// emitted file. For example: `output.filename: "bundle.js"` would derive
|
|
1590
|
+
// `bundle.html` — two `.html` modules extracted in the same build would
|
|
1591
|
+
// both want that name and conflict at emit time.
|
|
1592
|
+
const HAS_PATH_PLACEHOLDER_REGEXP =
|
|
1593
|
+
/\[(name|id|chunkhash|contenthash|fullhash|hash)/;
|
|
1594
|
+
/**
|
|
1595
|
+
* @param {string} template html filename template derived from `output.filename`
|
|
1596
|
+
* @returns {string} same template, or `[name].html` if it has no per-module placeholder
|
|
1597
|
+
*/
|
|
1598
|
+
const ensureUniqueHtmlTemplate = (template) =>
|
|
1599
|
+
HAS_PATH_PLACEHOLDER_REGEXP.test(template) ? template : "[name].html";
|
|
1600
|
+
F(output, "htmlFilename", () => {
|
|
1601
|
+
const filename =
|
|
1602
|
+
/** @type {NonNullable<Output["htmlFilename"]>} */
|
|
1603
|
+
(output.filename);
|
|
1604
|
+
if (typeof filename !== "function") {
|
|
1605
|
+
return ensureUniqueHtmlTemplate(
|
|
1606
|
+
filename.replace(/\.[mc]?js(\?|$)/, ".html$1")
|
|
1607
|
+
);
|
|
1608
|
+
}
|
|
1609
|
+
return "[name].html";
|
|
1610
|
+
});
|
|
1611
|
+
F(output, "htmlChunkFilename", () => {
|
|
1612
|
+
const chunkFilename =
|
|
1613
|
+
/** @type {NonNullable<Output["htmlChunkFilename"]>} */
|
|
1614
|
+
(output.chunkFilename);
|
|
1615
|
+
if (typeof chunkFilename !== "function") {
|
|
1616
|
+
return ensureUniqueHtmlTemplate(
|
|
1617
|
+
chunkFilename.replace(/\.[mc]?js(\?|$)/, ".html$1")
|
|
1618
|
+
);
|
|
1619
|
+
}
|
|
1620
|
+
return "[name].html";
|
|
1621
|
+
});
|
|
1465
1622
|
D(output, "assetModuleFilename", "[hash][ext][query][fragment]");
|
|
1466
1623
|
D(output, "webassemblyModuleFilename", "[hash].module.wasm");
|
|
1467
1624
|
D(output, "compareBeforeEmit", true);
|
|
@@ -1968,6 +2125,7 @@ const applyOptimizationDefaults = (
|
|
|
1968
2125
|
* @param {TargetProperties | false} options.targetProperties target properties
|
|
1969
2126
|
* @param {Mode} options.mode mode
|
|
1970
2127
|
* @param {boolean} options.css is css enabled
|
|
2128
|
+
* @param {boolean} options.typescript is typescript enabled
|
|
1971
2129
|
* @returns {ResolveOptions} resolve options
|
|
1972
2130
|
*/
|
|
1973
2131
|
const getResolveDefaults = ({
|
|
@@ -1975,7 +2133,8 @@ const getResolveDefaults = ({
|
|
|
1975
2133
|
context,
|
|
1976
2134
|
targetProperties,
|
|
1977
2135
|
mode,
|
|
1978
|
-
css
|
|
2136
|
+
css,
|
|
2137
|
+
typescript
|
|
1979
2138
|
}) => {
|
|
1980
2139
|
/** @type {string[]} */
|
|
1981
2140
|
const conditions = ["webpack"];
|
|
@@ -1990,24 +2149,43 @@ const getResolveDefaults = ({
|
|
|
1990
2149
|
if (targetProperties.nwjs) conditions.push("nwjs");
|
|
1991
2150
|
}
|
|
1992
2151
|
|
|
1993
|
-
const jsExtensions =
|
|
2152
|
+
const jsExtensions = typescript
|
|
2153
|
+
? [".ts", ".js", ".json", ".wasm"]
|
|
2154
|
+
: [".js", ".json", ".wasm"];
|
|
1994
2155
|
|
|
1995
2156
|
const tp = targetProperties;
|
|
1996
2157
|
const browserField =
|
|
1997
2158
|
tp && tp.web && (!tp.node || (tp.electron && tp.electronRenderer));
|
|
1998
2159
|
|
|
2160
|
+
// When `experiments.typescript` is on, also honor the `typescript`
|
|
2161
|
+
// conditional-exports key so monorepo packages can ship .ts sources via
|
|
2162
|
+
// `package.json#exports` — same convention Node.js's amaro uses.
|
|
2163
|
+
const tsConditionPrefix = typescript ? ["typescript"] : [];
|
|
2164
|
+
|
|
1999
2165
|
/** @type {() => ResolveOptions} */
|
|
2000
2166
|
const cjsDeps = () => ({
|
|
2001
2167
|
aliasFields: browserField ? ["browser"] : [],
|
|
2002
2168
|
mainFields: browserField ? ["browser", "module", "..."] : ["module", "..."],
|
|
2003
|
-
conditionNames: [
|
|
2169
|
+
conditionNames: [
|
|
2170
|
+
...tsConditionPrefix,
|
|
2171
|
+
"require",
|
|
2172
|
+
"module-sync",
|
|
2173
|
+
"module",
|
|
2174
|
+
"..."
|
|
2175
|
+
],
|
|
2004
2176
|
extensions: [...jsExtensions]
|
|
2005
2177
|
});
|
|
2006
2178
|
/** @type {() => ResolveOptions} */
|
|
2007
2179
|
const esmDeps = () => ({
|
|
2008
2180
|
aliasFields: browserField ? ["browser"] : [],
|
|
2009
2181
|
mainFields: browserField ? ["browser", "module", "..."] : ["module", "..."],
|
|
2010
|
-
conditionNames: [
|
|
2182
|
+
conditionNames: [
|
|
2183
|
+
...tsConditionPrefix,
|
|
2184
|
+
"import",
|
|
2185
|
+
"module-sync",
|
|
2186
|
+
"module",
|
|
2187
|
+
"..."
|
|
2188
|
+
],
|
|
2011
2189
|
extensions: [...jsExtensions]
|
|
2012
2190
|
});
|
|
2013
2191
|
|
|
@@ -2088,6 +2266,15 @@ const getResolveDefaults = ({
|
|
|
2088
2266
|
cssResolveOptions;
|
|
2089
2267
|
}
|
|
2090
2268
|
|
|
2269
|
+
if (typescript) {
|
|
2270
|
+
resolveOptions.tsconfig = true;
|
|
2271
|
+
resolveOptions.extensionAlias = {
|
|
2272
|
+
".js": [".js", ".ts"],
|
|
2273
|
+
".cjs": [".cjs", ".cts"],
|
|
2274
|
+
".mjs": [".mjs", ".mts"]
|
|
2275
|
+
};
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2091
2278
|
return resolveOptions;
|
|
2092
2279
|
};
|
|
2093
2280
|
|
|
@@ -22,7 +22,7 @@ const util = require("util");
|
|
|
22
22
|
/** @typedef {import("../../declarations/WebpackOptions").PluginsNormalized} PluginsNormalized */
|
|
23
23
|
/** @typedef {import("../../declarations/WebpackOptions").WebpackOptions} WebpackOptions */
|
|
24
24
|
/** @typedef {import("../../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptionsNormalized */
|
|
25
|
-
/** @typedef {import("../WebpackError")} WebpackError */
|
|
25
|
+
/** @typedef {import("../errors/WebpackError")} WebpackError */
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Defines the webpack options interception type used by this module.
|
|
@@ -368,6 +368,8 @@ const getNormalizedWebpackOptions = (config) => ({
|
|
|
368
368
|
hotUpdateChunkFilename: output.hotUpdateChunkFilename,
|
|
369
369
|
hotUpdateGlobal: output.hotUpdateGlobal,
|
|
370
370
|
hotUpdateMainFilename: output.hotUpdateMainFilename,
|
|
371
|
+
htmlChunkFilename: output.htmlChunkFilename,
|
|
372
|
+
htmlFilename: output.htmlFilename,
|
|
371
373
|
ignoreBrowserWarnings: output.ignoreBrowserWarnings,
|
|
372
374
|
iife: output.iife,
|
|
373
375
|
importFunctionName: output.importFunctionName,
|