webpack 5.99.9 → 5.100.1
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/bin/webpack.js +8 -2
- package/hot/log.js +15 -15
- package/hot/poll.js +1 -0
- package/lib/APIPlugin.js +3 -3
- package/lib/AbstractMethodError.js +1 -0
- package/lib/AutomaticPrefetchPlugin.js +1 -0
- package/lib/BannerPlugin.js +1 -1
- package/lib/CaseSensitiveModulesWarning.js +4 -4
- package/lib/Chunk.js +6 -6
- package/lib/ChunkGraph.js +37 -31
- package/lib/ChunkGroup.js +4 -4
- package/lib/ChunkTemplate.js +1 -1
- package/lib/CleanPlugin.js +94 -17
- package/lib/CodeGenerationResults.js +1 -1
- package/lib/CompatibilityPlugin.js +5 -2
- package/lib/Compilation.js +67 -45
- package/lib/Compiler.js +46 -16
- package/lib/ConcatenationScope.js +15 -6
- package/lib/ConstPlugin.js +5 -3
- package/lib/ContextModule.js +16 -12
- package/lib/ContextModuleFactory.js +4 -3
- package/lib/ContextReplacementPlugin.js +4 -2
- package/lib/CssModule.js +2 -2
- package/lib/DefinePlugin.js +111 -3
- package/lib/DelegatedModuleFactoryPlugin.js +18 -18
- package/lib/Dependency.js +11 -4
- package/lib/DependencyTemplate.js +1 -0
- package/lib/DllEntryPlugin.js +3 -1
- package/lib/DllPlugin.js +4 -3
- package/lib/DllReferencePlugin.js +2 -2
- package/lib/DynamicEntryPlugin.js +1 -1
- package/lib/EntryOptionPlugin.js +5 -0
- package/lib/ErrorHelpers.js +4 -4
- package/lib/EvalDevToolModulePlugin.js +3 -3
- package/lib/EvalSourceMapDevToolPlugin.js +7 -7
- package/lib/ExportsInfo.js +48 -39
- package/lib/ExternalModule.js +15 -11
- package/lib/ExternalModuleFactoryPlugin.js +5 -2
- package/lib/FileSystemInfo.js +51 -36
- package/lib/FlagDependencyExportsPlugin.js +14 -7
- package/lib/FlagDependencyUsagePlugin.js +1 -1
- package/lib/Generator.js +14 -1
- package/lib/HookWebpackError.js +1 -0
- package/lib/HotModuleReplacementPlugin.js +77 -50
- package/lib/IgnorePlugin.js +5 -2
- package/lib/InvalidDependenciesModuleWarning.js +1 -1
- package/lib/JavascriptMetaInfoPlugin.js +0 -1
- package/lib/LibManifestPlugin.js +4 -2
- package/lib/LoaderOptionsPlugin.js +6 -4
- package/lib/MainTemplate.js +2 -2
- package/lib/Module.js +21 -6
- package/lib/ModuleFactory.js +1 -0
- package/lib/ModuleGraph.js +24 -2
- package/lib/ModuleGraphConnection.js +5 -5
- package/lib/ModuleInfoHeaderPlugin.js +2 -1
- package/lib/ModuleParseError.js +1 -0
- package/lib/ModuleSourceTypesConstants.js +12 -12
- package/lib/ModuleTemplate.js +1 -1
- package/lib/ModuleTypeConstants.js +21 -21
- package/lib/MultiCompiler.js +6 -6
- package/lib/NormalModule.js +31 -44
- package/lib/NormalModuleFactory.js +34 -20
- package/lib/NormalModuleReplacementPlugin.js +1 -1
- package/lib/NullFactory.js +1 -0
- package/lib/OptimizationStages.js +1 -1
- package/lib/Parser.js +1 -0
- package/lib/ProgressPlugin.js +12 -5
- package/lib/ProvidePlugin.js +5 -1
- package/lib/RawModule.js +14 -0
- package/lib/RecordIdsPlugin.js +3 -3
- package/lib/RuntimeGlobals.js +175 -155
- package/lib/RuntimeModule.js +1 -0
- package/lib/RuntimePlugin.js +33 -7
- package/lib/RuntimeTemplate.js +111 -11
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +15 -25
- package/lib/SourceMapDevToolPlugin.js +19 -17
- package/lib/Template.js +2 -2
- package/lib/TemplatedPathPlugin.js +1 -1
- package/lib/WarnDeprecatedOptionPlugin.js +7 -8
- package/lib/WatchIgnorePlugin.js +4 -3
- package/lib/WebpackIsIncludedPlugin.js +2 -1
- package/lib/WebpackOptionsApply.js +115 -27
- package/lib/asset/AssetGenerator.js +15 -11
- package/lib/asset/AssetModulesPlugin.js +19 -17
- package/lib/asset/AssetSourceGenerator.js +4 -4
- package/lib/asset/RawDataUrlModule.js +4 -2
- package/lib/async-modules/AwaitDependenciesInitFragment.js +1 -1
- package/lib/buildChunkGraph.js +6 -3
- package/lib/cache/AddBuildDependenciesPlugin.js +5 -6
- package/lib/cache/IdleFileCachePlugin.js +7 -4
- package/lib/cache/MemoryCachePlugin.js +1 -0
- package/lib/cache/MemoryWithGcCachePlugin.js +1 -0
- package/lib/cache/PackFileCacheStrategy.js +26 -20
- package/lib/cache/ResolverCachePlugin.js +16 -8
- package/lib/cli.js +15 -10
- package/lib/config/browserslistTargetHandler.js +3 -3
- package/lib/config/defaults.js +25 -17
- package/lib/config/normalization.js +2 -1
- package/lib/config/target.js +6 -5
- package/lib/container/ContainerPlugin.js +1 -1
- package/lib/container/ContainerReferencePlugin.js +1 -1
- package/lib/container/FallbackModule.js +2 -1
- package/lib/container/HoistContainerReferencesPlugin.js +1 -1
- package/lib/container/ModuleFederationPlugin.js +2 -2
- package/lib/container/RemoteModule.js +1 -1
- package/lib/css/CssGenerator.js +9 -6
- package/lib/css/CssModulesPlugin.js +44 -31
- package/lib/css/CssParser.js +6 -4
- package/lib/css/walkCssTokens.js +33 -37
- package/lib/debug/ProfilingPlugin.js +6 -6
- package/lib/dependencies/AMDDefineDependencyParserPlugin.js +8 -8
- package/lib/dependencies/AMDPlugin.js +12 -8
- package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +28 -26
- package/lib/dependencies/CachedConstDependency.js +1 -5
- package/lib/dependencies/CommonJsExportRequireDependency.js +6 -4
- package/lib/dependencies/CommonJsExportsParserPlugin.js +22 -25
- package/lib/dependencies/CommonJsFullRequireDependency.js +1 -9
- package/lib/dependencies/CommonJsImportsParserPlugin.js +100 -114
- package/lib/dependencies/CommonJsPlugin.js +15 -16
- package/lib/dependencies/ContextDependencyHelpers.js +2 -1
- package/lib/dependencies/ContextDependencyTemplateAsId.js +1 -0
- package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +1 -0
- package/lib/dependencies/CssIcssExportDependency.js +1 -1
- package/lib/dependencies/CssLocalIdentifierDependency.js +2 -2
- package/lib/dependencies/CssSelfLocalIdentifierDependency.js +2 -1
- package/lib/dependencies/DynamicExports.js +9 -9
- package/lib/dependencies/ExportsInfoDependency.js +1 -1
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +122 -101
- package/lib/dependencies/HarmonyExportExpressionDependency.js +1 -1
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +95 -19
- package/lib/dependencies/HarmonyExportInitFragment.js +1 -1
- package/lib/dependencies/HarmonyImportDependency.js +11 -5
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +238 -162
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +4 -1
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +20 -9
- package/lib/dependencies/HarmonyModulesPlugin.js +23 -12
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -0
- package/lib/dependencies/ImportMetaContextPlugin.js +2 -1
- package/lib/dependencies/ImportMetaPlugin.js +2 -2
- package/lib/dependencies/ImportParserPlugin.js +40 -9
- package/lib/dependencies/ImportPlugin.js +3 -1
- package/lib/dependencies/LoaderPlugin.js +1 -0
- package/lib/dependencies/ModuleDependency.js +3 -1
- package/lib/dependencies/ModuleDependencyTemplateAsRequireId.js +1 -0
- package/lib/dependencies/RequireContextPlugin.js +3 -1
- package/lib/dependencies/RequireEnsurePlugin.js +6 -6
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +33 -34
- package/lib/dependencies/RequireIncludePlugin.js +1 -0
- package/lib/dependencies/RuntimeRequirementsDependency.js +1 -1
- package/lib/dependencies/SystemPlugin.js +1 -1
- package/lib/dependencies/URLContextDependency.js +65 -0
- package/lib/dependencies/URLPlugin.js +17 -157
- package/lib/dependencies/WorkerPlugin.js +23 -10
- package/lib/dependencies/processExportInfo.js +2 -1
- package/lib/esm/ModuleChunkFormatPlugin.js +269 -185
- package/lib/esm/ModuleChunkLoadingPlugin.js +39 -1
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +70 -3
- package/lib/hmr/HotModuleReplacement.runtime.js +0 -1
- package/lib/hmr/HotModuleReplacementRuntimeModule.js +1 -1
- package/lib/hmr/JavascriptHotModuleReplacementHelper.js +37 -0
- package/lib/hmr/LazyCompilationPlugin.js +4 -2
- package/lib/hmr/lazyCompilationBackend.js +4 -2
- package/lib/ids/ChunkModuleIdRangePlugin.js +6 -3
- package/lib/ids/DeterministicChunkIdsPlugin.js +30 -35
- package/lib/ids/DeterministicModuleIdsPlugin.js +4 -3
- package/lib/ids/HashedModuleIdsPlugin.js +5 -4
- package/lib/ids/IdHelpers.js +21 -17
- package/lib/ids/NamedChunkIdsPlugin.js +5 -5
- package/lib/ids/NamedModuleIdsPlugin.js +4 -4
- package/lib/ids/NaturalChunkIdsPlugin.js +2 -1
- package/lib/ids/NaturalModuleIdsPlugin.js +1 -1
- package/lib/ids/OccurrenceChunkIdsPlugin.js +3 -2
- package/lib/ids/OccurrenceModuleIdsPlugin.js +1 -1
- package/lib/ids/SyncModuleIdsPlugin.js +1 -1
- package/lib/index.js +13 -3
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +113 -119
- package/lib/javascript/BasicEvaluatedExpression.js +2 -1
- package/lib/javascript/ChunkHelpers.js +1 -0
- package/lib/javascript/CommonJsChunkFormatPlugin.js +121 -136
- package/lib/javascript/EnableChunkLoadingPlugin.js +6 -3
- package/lib/javascript/JavascriptGenerator.js +14 -2
- package/lib/javascript/JavascriptModulesPlugin.js +68 -27
- package/lib/javascript/JavascriptParser.js +117 -76
- package/lib/javascript/JavascriptParserHelpers.js +41 -41
- package/lib/javascript/StartupHelpers.js +17 -17
- package/lib/json/JsonGenerator.js +4 -2
- package/lib/json/JsonModulesPlugin.js +2 -2
- package/lib/json/JsonParser.js +1 -1
- package/lib/library/AbstractLibraryPlugin.js +6 -2
- package/lib/library/AssignLibraryPlugin.js +21 -6
- package/lib/library/EnableLibraryPlugin.js +23 -3
- package/lib/library/UmdLibraryPlugin.js +15 -6
- package/lib/logging/createConsoleLogger.js +3 -3
- package/lib/logging/runtime.js +9 -9
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +4 -22
- package/lib/node/RequireChunkLoadingRuntimeModule.js +4 -22
- package/lib/node/nodeConsole.js +4 -2
- package/lib/optimize/AggressiveMergingPlugin.js +45 -46
- package/lib/optimize/AggressiveSplittingPlugin.js +13 -12
- package/lib/optimize/ConcatenatedModule.js +227 -57
- package/lib/optimize/EnsureChunkConditionsPlugin.js +58 -58
- package/lib/optimize/FlagIncludedChunksPlugin.js +3 -1
- package/lib/optimize/InnerGraph.js +115 -112
- package/lib/optimize/InnerGraphPlugin.js +2 -2
- package/lib/optimize/LimitChunkCountPlugin.js +4 -2
- package/lib/optimize/MangleExportsPlugin.js +4 -3
- package/lib/optimize/MergeDuplicateChunksPlugin.js +80 -81
- package/lib/optimize/MinChunkSizePlugin.js +6 -3
- package/lib/optimize/ModuleConcatenationPlugin.js +31 -22
- package/lib/optimize/RealContentHashPlugin.js +26 -20
- package/lib/optimize/RemoveEmptyChunksPlugin.js +2 -1
- package/lib/optimize/RemoveParentModulesPlugin.js +1 -0
- package/lib/optimize/SideEffectsFlagPlugin.js +3 -2
- package/lib/optimize/SplitChunksPlugin.js +16 -13
- package/lib/rules/BasicEffectRulePlugin.js +4 -2
- package/lib/rules/BasicMatcherRulePlugin.js +3 -1
- package/lib/rules/ObjectMatcherRulePlugin.js +3 -1
- package/lib/rules/RuleSetCompiler.js +19 -5
- package/lib/rules/UseEffectRulePlugin.js +17 -9
- package/lib/runtime/AsyncModuleRuntimeModule.js +64 -9
- package/lib/runtime/CreateFakeNamespaceObjectRuntimeModule.js +1 -1
- package/lib/runtime/MakeDeferredNamespaceObjectRuntime.js +214 -0
- package/lib/runtime/RuntimeIdRuntimeModule.js +2 -1
- package/lib/runtime/StartupChunkDependenciesRuntimeModule.js +8 -7
- package/lib/schemes/FileUriPlugin.js +1 -1
- package/lib/schemes/HttpUriPlugin.js +27 -19
- package/lib/schemes/VirtualUrlPlugin.js +222 -0
- package/lib/serialization/AggregateErrorSerializer.js +1 -1
- package/lib/serialization/BinaryMiddleware.js +5 -4
- package/lib/serialization/FileMiddleware.js +7 -4
- package/lib/serialization/ObjectMiddleware.js +14 -8
- package/lib/serialization/Serializer.js +5 -3
- package/lib/serialization/SerializerMiddleware.js +2 -0
- package/lib/sharing/ConsumeSharedModule.js +1 -1
- package/lib/sharing/ConsumeSharedPlugin.js +3 -3
- package/lib/sharing/ConsumeSharedRuntimeModule.js +2 -2
- package/lib/sharing/ProvideSharedModule.js +1 -1
- package/lib/sharing/ProvideSharedPlugin.js +3 -2
- package/lib/sharing/SharePlugin.js +2 -1
- package/lib/sharing/ShareRuntimeModule.js +3 -5
- package/lib/sharing/utils.js +34 -34
- package/lib/stats/DefaultStatsFactoryPlugin.js +49 -46
- package/lib/stats/DefaultStatsPresetPlugin.js +13 -13
- package/lib/stats/DefaultStatsPrinterPlugin.js +15 -9
- package/lib/stats/StatsFactory.js +6 -3
- package/lib/stats/StatsPrinter.js +6 -7
- package/lib/url/URLParserPlugin.js +266 -0
- package/lib/util/ArrayQueue.js +1 -1
- package/lib/util/AsyncQueue.js +1 -1
- package/lib/util/Hash.js +2 -0
- package/lib/util/IterableHelpers.js +1 -1
- package/lib/util/LazyBucketSortedSet.js +2 -1
- package/lib/util/LazySet.js +11 -6
- package/lib/util/ParallelismFactorCalculator.js +1 -1
- package/lib/util/SetHelpers.js +3 -3
- package/lib/util/SortableSet.js +2 -2
- package/lib/util/StackedCacheMap.js +3 -1
- package/lib/util/StackedMap.js +2 -2
- package/lib/util/StringXor.js +1 -0
- package/lib/util/TupleSet.js +1 -0
- package/lib/util/URLAbsoluteSpecifier.js +1 -1
- package/lib/util/cleverMerge.js +95 -58
- package/lib/util/comparators.js +154 -127
- package/lib/util/compileBooleanMatcher.js +8 -3
- package/lib/util/concatenate.js +8 -7
- package/lib/util/conventions.js +72 -73
- package/lib/util/create-schema-validation.js +2 -1
- package/lib/util/createHash.js +10 -4
- package/lib/util/deprecation.js +69 -66
- package/lib/util/deterministicGrouping.js +4 -2
- package/lib/util/extractUrlAndGlobal.js +1 -1
- package/lib/util/findGraphRoots.js +2 -2
- package/lib/util/fs.js +30 -23
- package/lib/util/hash/md4.js +2 -2
- package/lib/util/hash/wasm-hash.js +4 -2
- package/lib/util/identifier.js +13 -12
- package/lib/util/internalSerializables.js +2 -0
- package/lib/util/magicComment.js +5 -5
- package/lib/util/processAsyncTree.js +1 -1
- package/lib/util/propertyAccess.js +1 -1
- package/lib/util/propertyName.js +1 -1
- package/lib/util/registerExternalSerializer.js +1 -2
- package/lib/util/removeBOM.js +1 -1
- package/lib/util/runtime.js +29 -21
- package/lib/util/semver.js +1 -1
- package/lib/util/serialization.js +3 -0
- package/lib/util/source.js +3 -2
- package/lib/validateSchema.js +1 -0
- package/lib/wasm/EnableWasmLoadingPlugin.js +6 -3
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +4 -1
- package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +46 -49
- package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +2 -2
- package/lib/wasm-sync/WebAssemblyGenerator.js +2 -3
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +3 -2
- package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +3 -0
- package/lib/wasm-sync/WebAssemblyUtils.js +1 -1
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +4 -22
- package/lib/webpack.js +4 -5
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +1 -0
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +6 -24
- package/lib/webworker/WebWorkerTemplatePlugin.js +1 -0
- package/package.json +119 -113
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +17 -0
- package/schemas/plugins/schemes/VirtualUrlPlugin.check.d.ts +7 -0
- package/schemas/plugins/schemes/VirtualUrlPlugin.check.js +6 -0
- package/schemas/plugins/schemes/VirtualUrlPlugin.json +77 -0
- package/types.d.ts +1243 -409
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
+
Author Haijie Xie @hai-x
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
const RuntimeGlobals = require("../RuntimeGlobals");
|
|
9
|
+
|
|
10
|
+
const Template = require("../Template");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} type unique identifier used for HMR runtime properties
|
|
14
|
+
* @returns {string} HMR runtime code
|
|
15
|
+
*/
|
|
16
|
+
const generateJavascriptHMR = type =>
|
|
17
|
+
Template.getFunctionContent(
|
|
18
|
+
require("../hmr/JavascriptHotModuleReplacement.runtime")
|
|
19
|
+
)
|
|
20
|
+
.replace(/\$key\$/g, type)
|
|
21
|
+
.replace(/\$installedChunks\$/g, "installedChunks")
|
|
22
|
+
.replace(/\$loadUpdateChunk\$/g, "loadUpdateChunk")
|
|
23
|
+
.replace(/\$moduleCache\$/g, RuntimeGlobals.moduleCache)
|
|
24
|
+
.replace(/\$moduleFactories\$/g, RuntimeGlobals.moduleFactories)
|
|
25
|
+
.replace(/\$ensureChunkHandlers\$/g, RuntimeGlobals.ensureChunkHandlers)
|
|
26
|
+
.replace(/\$hasOwnProperty\$/g, RuntimeGlobals.hasOwnProperty)
|
|
27
|
+
.replace(/\$hmrModuleData\$/g, RuntimeGlobals.hmrModuleData)
|
|
28
|
+
.replace(
|
|
29
|
+
/\$hmrDownloadUpdateHandlers\$/g,
|
|
30
|
+
RuntimeGlobals.hmrDownloadUpdateHandlers
|
|
31
|
+
)
|
|
32
|
+
.replace(
|
|
33
|
+
/\$hmrInvalidateModuleHandlers\$/g,
|
|
34
|
+
RuntimeGlobals.hmrInvalidateModuleHandlers
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
module.exports.generateJavascriptHMR = generateJavascriptHMR;
|
|
@@ -424,15 +424,17 @@ class LazyCompilationPlugin {
|
|
|
424
424
|
dep.type === "import() context element")) ||
|
|
425
425
|
(this.entries && dep.type === "entry")
|
|
426
426
|
)
|
|
427
|
-
)
|
|
427
|
+
) {
|
|
428
428
|
return module;
|
|
429
|
+
}
|
|
429
430
|
if (
|
|
430
431
|
/webpack[/\\]hot[/\\]|webpack-dev-server[/\\]client|webpack-hot-middleware[/\\]client/.test(
|
|
431
432
|
resolveData.request
|
|
432
433
|
) ||
|
|
433
434
|
!checkTest(this.test, module)
|
|
434
|
-
)
|
|
435
|
+
) {
|
|
435
436
|
return module;
|
|
437
|
+
}
|
|
436
438
|
const moduleInfo = backend.module(module);
|
|
437
439
|
if (!moduleInfo) return module;
|
|
438
440
|
const { client, data, active } = moduleInfo;
|
|
@@ -49,8 +49,9 @@ module.exports = options => (compiler, callback) => {
|
|
|
49
49
|
? options.listen
|
|
50
50
|
: server => {
|
|
51
51
|
let listen = options.listen;
|
|
52
|
-
if (typeof listen === "object" && !("port" in listen))
|
|
52
|
+
if (typeof listen === "object" && !("port" in listen)) {
|
|
53
53
|
listen = { ...listen, port: undefined };
|
|
54
|
+
}
|
|
54
55
|
server.listen(listen);
|
|
55
56
|
};
|
|
56
57
|
|
|
@@ -119,8 +120,9 @@ module.exports = options => (compiler, callback) => {
|
|
|
119
120
|
err => {
|
|
120
121
|
if (err) return callback(err);
|
|
121
122
|
const _addr = server.address();
|
|
122
|
-
if (typeof _addr === "string")
|
|
123
|
+
if (typeof _addr === "string") {
|
|
123
124
|
throw new Error("addr must not be a string");
|
|
125
|
+
}
|
|
124
126
|
const addr = /** @type {AddressInfo} */ (_addr);
|
|
125
127
|
const urlBase =
|
|
126
128
|
addr.address === "::" || addr.address === "0.0.0.0"
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
const { find } = require("../util/SetHelpers");
|
|
9
9
|
const {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
compareModulesByPostOrderIndexOrIdentifier,
|
|
11
|
+
compareModulesByPreOrderIndexOrIdentifier
|
|
12
12
|
} = require("../util/comparators");
|
|
13
13
|
|
|
14
14
|
/** @typedef {import("../Compiler")} Compiler */
|
|
15
|
+
/** @typedef {import("../Module")} Module */
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* @typedef {object} ChunkModuleIdRangePluginOptions
|
|
@@ -52,6 +53,7 @@ class ChunkModuleIdRangePlugin {
|
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
/** @type {Module[]} */
|
|
55
57
|
let chunkModules;
|
|
56
58
|
if (options.order) {
|
|
57
59
|
let cmpFn;
|
|
@@ -69,7 +71,7 @@ class ChunkModuleIdRangePlugin {
|
|
|
69
71
|
}
|
|
70
72
|
chunkModules = chunkGraph.getOrderedChunkModules(chunk, cmpFn);
|
|
71
73
|
} else {
|
|
72
|
-
chunkModules =
|
|
74
|
+
chunkModules = [...modules]
|
|
73
75
|
.filter(m => chunkGraph.isModuleInChunk(m, chunk))
|
|
74
76
|
.sort(compareModulesByPreOrderIndexOrIdentifier(moduleGraph));
|
|
75
77
|
}
|
|
@@ -86,4 +88,5 @@ class ChunkModuleIdRangePlugin {
|
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
90
|
}
|
|
91
|
+
|
|
89
92
|
module.exports = ChunkModuleIdRangePlugin;
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
const { compareChunksNatural } = require("../util/comparators");
|
|
9
9
|
const {
|
|
10
|
+
assignDeterministicIds,
|
|
10
11
|
getFullChunkName,
|
|
11
|
-
getUsedChunkIds
|
|
12
|
-
assignDeterministicIds
|
|
12
|
+
getUsedChunkIds
|
|
13
13
|
} = require("./IdHelpers");
|
|
14
14
|
|
|
15
15
|
/** @typedef {import("../Compiler")} Compiler */
|
|
@@ -21,6 +21,8 @@ const {
|
|
|
21
21
|
* @property {number=} maxLength maximum length of ids
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
const PLUGIN_NAME = "DeterministicChunkIdsPlugin";
|
|
25
|
+
|
|
24
26
|
class DeterministicChunkIdsPlugin {
|
|
25
27
|
/**
|
|
26
28
|
* @param {DeterministicChunkIdsPluginOptions=} options options
|
|
@@ -35,42 +37,35 @@ class DeterministicChunkIdsPlugin {
|
|
|
35
37
|
* @returns {void}
|
|
36
38
|
*/
|
|
37
39
|
apply(compiler) {
|
|
38
|
-
compiler.hooks.compilation.tap(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const context = this.options.context
|
|
46
|
-
? this.options.context
|
|
47
|
-
: compiler.context;
|
|
48
|
-
const maxLength = this.options.maxLength || 3;
|
|
40
|
+
compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
|
|
41
|
+
compilation.hooks.chunkIds.tap(PLUGIN_NAME, chunks => {
|
|
42
|
+
const chunkGraph = compilation.chunkGraph;
|
|
43
|
+
const context = this.options.context
|
|
44
|
+
? this.options.context
|
|
45
|
+
: compiler.context;
|
|
46
|
+
const maxLength = this.options.maxLength || 3;
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
const compareNatural = compareChunksNatural(chunkGraph);
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
usedIds.size
|
|
69
|
-
);
|
|
70
|
-
}
|
|
50
|
+
const usedIds = getUsedChunkIds(compilation);
|
|
51
|
+
assignDeterministicIds(
|
|
52
|
+
[...chunks].filter(chunk => chunk.id === null),
|
|
53
|
+
chunk => getFullChunkName(chunk, chunkGraph, context, compiler.root),
|
|
54
|
+
compareNatural,
|
|
55
|
+
(chunk, id) => {
|
|
56
|
+
const size = usedIds.size;
|
|
57
|
+
usedIds.add(`${id}`);
|
|
58
|
+
if (size === usedIds.size) return false;
|
|
59
|
+
chunk.id = id;
|
|
60
|
+
chunk.ids = [id];
|
|
61
|
+
return true;
|
|
62
|
+
},
|
|
63
|
+
[10 ** maxLength],
|
|
64
|
+
10,
|
|
65
|
+
usedIds.size
|
|
71
66
|
);
|
|
72
|
-
}
|
|
73
|
-
);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
74
69
|
}
|
|
75
70
|
}
|
|
76
71
|
|
|
@@ -9,9 +9,9 @@ const {
|
|
|
9
9
|
compareModulesByPreOrderIndexOrIdentifier
|
|
10
10
|
} = require("../util/comparators");
|
|
11
11
|
const {
|
|
12
|
-
|
|
12
|
+
assignDeterministicIds,
|
|
13
13
|
getFullModuleName,
|
|
14
|
-
|
|
14
|
+
getUsedModuleIdsAndModules
|
|
15
15
|
} = require("./IdHelpers");
|
|
16
16
|
|
|
17
17
|
/** @typedef {import("../Compiler")} Compiler */
|
|
@@ -82,12 +82,13 @@ class DeterministicModuleIdsPlugin {
|
|
|
82
82
|
usedIds.size,
|
|
83
83
|
salt
|
|
84
84
|
);
|
|
85
|
-
if (failOnConflict && conflicts)
|
|
85
|
+
if (failOnConflict && conflicts) {
|
|
86
86
|
throw new Error(
|
|
87
87
|
`Assigning deterministic module ids has lead to ${conflicts} conflict${
|
|
88
88
|
conflicts > 1 ? "s" : ""
|
|
89
89
|
}.\nIncrease the 'maxLength' to increase the id space and make conflicts less likely (recommended when there are many conflicts or application is expected to grow), or add an 'salt' number to try another hash starting value in the same id space (recommended when there is only a single conflict).`
|
|
90
90
|
);
|
|
91
|
+
}
|
|
91
92
|
});
|
|
92
93
|
});
|
|
93
94
|
}
|
|
@@ -12,15 +12,15 @@ const {
|
|
|
12
12
|
const createSchemaValidation = require("../util/create-schema-validation");
|
|
13
13
|
const createHash = require("../util/createHash");
|
|
14
14
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
getFullModuleName,
|
|
16
|
+
getUsedModuleIdsAndModules
|
|
17
17
|
} = require("./IdHelpers");
|
|
18
18
|
|
|
19
19
|
/** @typedef {import("../../declarations/plugins/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions} HashedModuleIdsPluginOptions */
|
|
20
20
|
/** @typedef {import("../Compiler")} Compiler */
|
|
21
21
|
|
|
22
22
|
const validate = createSchemaValidation(
|
|
23
|
-
require("../../schemas/plugins/HashedModuleIdsPlugin.check
|
|
23
|
+
require("../../schemas/plugins/HashedModuleIdsPlugin.check"),
|
|
24
24
|
() => require("../../schemas/plugins/HashedModuleIdsPlugin.json"),
|
|
25
25
|
{
|
|
26
26
|
name: "Hashed Module Ids Plugin",
|
|
@@ -77,8 +77,9 @@ class HashedModuleIdsPlugin {
|
|
|
77
77
|
hash.digest(options.hashDigest)
|
|
78
78
|
);
|
|
79
79
|
let len = options.hashDigestLength;
|
|
80
|
-
while (usedIds.has(hashId.slice(0, len)))
|
|
80
|
+
while (usedIds.has(hashId.slice(0, len))) {
|
|
81
81
|
/** @type {number} */ (len)++;
|
|
82
|
+
}
|
|
82
83
|
const moduleId = hashId.slice(0, len);
|
|
83
84
|
chunkGraph.setModuleId(module, moduleId);
|
|
84
85
|
usedIds.add(moduleId);
|
package/lib/ids/IdHelpers.js
CHANGED
|
@@ -56,7 +56,6 @@ const avoidNumber = str => {
|
|
|
56
56
|
*/
|
|
57
57
|
const requestToId = request =>
|
|
58
58
|
request.replace(/^(\.\.?\/)+/, "").replace(/(^[.-]|[^a-zA-Z0-9_-])+/g, "_");
|
|
59
|
-
module.exports.requestToId = requestToId;
|
|
60
59
|
|
|
61
60
|
/**
|
|
62
61
|
* @param {string} string the string
|
|
@@ -83,13 +82,13 @@ const getShortModuleName = (module, context, associatedObjectForCache) => {
|
|
|
83
82
|
const libIdent = module.libIdent({ context, associatedObjectForCache });
|
|
84
83
|
if (libIdent) return avoidNumber(libIdent);
|
|
85
84
|
const nameForCondition = module.nameForCondition();
|
|
86
|
-
if (nameForCondition)
|
|
85
|
+
if (nameForCondition) {
|
|
87
86
|
return avoidNumber(
|
|
88
87
|
makePathsRelative(context, nameForCondition, associatedObjectForCache)
|
|
89
88
|
);
|
|
89
|
+
}
|
|
90
90
|
return "";
|
|
91
91
|
};
|
|
92
|
-
module.exports.getShortModuleName = getShortModuleName;
|
|
93
92
|
|
|
94
93
|
/**
|
|
95
94
|
* @param {string} shortName the short name
|
|
@@ -109,7 +108,6 @@ const getLongModuleName = (
|
|
|
109
108
|
const fullName = getFullModuleName(module, context, associatedObjectForCache);
|
|
110
109
|
return `${shortName}?${getHash(fullName, 4, hashFunction)}`;
|
|
111
110
|
};
|
|
112
|
-
module.exports.getLongModuleName = getLongModuleName;
|
|
113
111
|
|
|
114
112
|
/**
|
|
115
113
|
* @param {Module} module the module
|
|
@@ -119,7 +117,6 @@ module.exports.getLongModuleName = getLongModuleName;
|
|
|
119
117
|
*/
|
|
120
118
|
const getFullModuleName = (module, context, associatedObjectForCache) =>
|
|
121
119
|
makePathsRelative(context, module.identifier(), associatedObjectForCache);
|
|
122
|
-
module.exports.getFullModuleName = getFullModuleName;
|
|
123
120
|
|
|
124
121
|
/**
|
|
125
122
|
* @param {Chunk} chunk the chunk
|
|
@@ -143,13 +140,11 @@ const getShortChunkName = (
|
|
|
143
140
|
requestToId(getShortModuleName(m, context, associatedObjectForCache))
|
|
144
141
|
);
|
|
145
142
|
chunk.idNameHints.sort();
|
|
146
|
-
const chunkName =
|
|
147
|
-
.concat(shortModuleNames)
|
|
143
|
+
const chunkName = [...chunk.idNameHints, ...shortModuleNames]
|
|
148
144
|
.filter(Boolean)
|
|
149
145
|
.join(delimiter);
|
|
150
146
|
return shortenLongString(chunkName, delimiter, hashFunction);
|
|
151
147
|
};
|
|
152
|
-
module.exports.getShortChunkName = getShortChunkName;
|
|
153
148
|
|
|
154
149
|
/**
|
|
155
150
|
* @param {Chunk} chunk the chunk
|
|
@@ -178,13 +173,15 @@ const getLongChunkName = (
|
|
|
178
173
|
)
|
|
179
174
|
);
|
|
180
175
|
chunk.idNameHints.sort();
|
|
181
|
-
const chunkName =
|
|
182
|
-
.
|
|
176
|
+
const chunkName = [
|
|
177
|
+
...chunk.idNameHints,
|
|
178
|
+
...shortModuleNames,
|
|
179
|
+
...longModuleNames
|
|
180
|
+
]
|
|
183
181
|
.filter(Boolean)
|
|
184
182
|
.join(delimiter);
|
|
185
183
|
return shortenLongString(chunkName, delimiter, hashFunction);
|
|
186
184
|
};
|
|
187
|
-
module.exports.getLongChunkName = getLongChunkName;
|
|
188
185
|
|
|
189
186
|
/**
|
|
190
187
|
* @param {Chunk} chunk the chunk
|
|
@@ -206,7 +203,6 @@ const getFullChunkName = (
|
|
|
206
203
|
);
|
|
207
204
|
return fullModuleNames.join();
|
|
208
205
|
};
|
|
209
|
-
module.exports.getFullChunkName = getFullChunkName;
|
|
210
206
|
|
|
211
207
|
/**
|
|
212
208
|
* @template K
|
|
@@ -258,7 +254,6 @@ const getUsedModuleIdsAndModules = (compilation, filter) => {
|
|
|
258
254
|
|
|
259
255
|
return [usedIds, modules];
|
|
260
256
|
};
|
|
261
|
-
module.exports.getUsedModuleIdsAndModules = getUsedModuleIdsAndModules;
|
|
262
257
|
|
|
263
258
|
/**
|
|
264
259
|
* @param {Compilation} compilation the compilation
|
|
@@ -282,7 +277,6 @@ const getUsedChunkIds = compilation => {
|
|
|
282
277
|
|
|
283
278
|
return usedIds;
|
|
284
279
|
};
|
|
285
|
-
module.exports.getUsedChunkIds = getUsedChunkIds;
|
|
286
280
|
|
|
287
281
|
/**
|
|
288
282
|
* @template T
|
|
@@ -350,7 +344,6 @@ const assignNames = (
|
|
|
350
344
|
unnamedItems.sort(comparator);
|
|
351
345
|
return unnamedItems;
|
|
352
346
|
};
|
|
353
|
-
module.exports.assignNames = assignNames;
|
|
354
347
|
|
|
355
348
|
/**
|
|
356
349
|
* @template T
|
|
@@ -404,7 +397,6 @@ const assignDeterministicIds = (
|
|
|
404
397
|
} while (!assignId(item, id));
|
|
405
398
|
}
|
|
406
399
|
};
|
|
407
|
-
module.exports.assignDeterministicIds = assignDeterministicIds;
|
|
408
400
|
|
|
409
401
|
/**
|
|
410
402
|
* @param {Set<string>} usedIds used ids
|
|
@@ -441,7 +433,6 @@ const assignAscendingModuleIds = (usedIds, modules, compilation) => {
|
|
|
441
433
|
assignId(module);
|
|
442
434
|
}
|
|
443
435
|
};
|
|
444
|
-
module.exports.assignAscendingModuleIds = assignAscendingModuleIds;
|
|
445
436
|
|
|
446
437
|
/**
|
|
447
438
|
* @param {Iterable<Chunk>} chunks the chunks
|
|
@@ -471,4 +462,17 @@ const assignAscendingChunkIds = (chunks, compilation) => {
|
|
|
471
462
|
}
|
|
472
463
|
}
|
|
473
464
|
};
|
|
465
|
+
|
|
474
466
|
module.exports.assignAscendingChunkIds = assignAscendingChunkIds;
|
|
467
|
+
module.exports.assignAscendingModuleIds = assignAscendingModuleIds;
|
|
468
|
+
module.exports.assignDeterministicIds = assignDeterministicIds;
|
|
469
|
+
module.exports.assignNames = assignNames;
|
|
470
|
+
module.exports.getFullChunkName = getFullChunkName;
|
|
471
|
+
module.exports.getFullModuleName = getFullModuleName;
|
|
472
|
+
module.exports.getLongChunkName = getLongChunkName;
|
|
473
|
+
module.exports.getLongModuleName = getLongModuleName;
|
|
474
|
+
module.exports.getShortChunkName = getShortChunkName;
|
|
475
|
+
module.exports.getShortModuleName = getShortModuleName;
|
|
476
|
+
module.exports.getUsedChunkIds = getUsedChunkIds;
|
|
477
|
+
module.exports.getUsedModuleIdsAndModules = getUsedModuleIdsAndModules;
|
|
478
|
+
module.exports.requestToId = requestToId;
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
const { compareChunksNatural } = require("../util/comparators");
|
|
9
9
|
const {
|
|
10
|
-
|
|
11
|
-
getLongChunkName,
|
|
10
|
+
assignAscendingChunkIds,
|
|
12
11
|
assignNames,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
getLongChunkName,
|
|
13
|
+
getShortChunkName,
|
|
14
|
+
getUsedChunkIds
|
|
15
15
|
} = require("./IdHelpers");
|
|
16
16
|
|
|
17
17
|
/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} Output */
|
|
@@ -52,7 +52,7 @@ class NamedChunkIdsPlugin {
|
|
|
52
52
|
const delimiter = this.delimiter;
|
|
53
53
|
|
|
54
54
|
const unnamedChunks = assignNames(
|
|
55
|
-
|
|
55
|
+
[...chunks].filter(chunk => {
|
|
56
56
|
if (chunk.name) {
|
|
57
57
|
chunk.id = chunk.name;
|
|
58
58
|
chunk.ids = [chunk.name];
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
const { compareModulesByIdentifier } = require("../util/comparators");
|
|
9
9
|
const {
|
|
10
|
-
|
|
11
|
-
getLongModuleName,
|
|
10
|
+
assignAscendingModuleIds,
|
|
12
11
|
assignNames,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
getLongModuleName,
|
|
13
|
+
getShortModuleName,
|
|
14
|
+
getUsedModuleIdsAndModules
|
|
15
15
|
} = require("./IdHelpers");
|
|
16
16
|
|
|
17
17
|
/** @typedef {import("../../declarations/WebpackOptions").OutputNormalized} Output */
|
|
@@ -25,7 +25,8 @@ class NaturalChunkIdsPlugin {
|
|
|
25
25
|
compilation.hooks.chunkIds.tap(PLUGIN_NAME, chunks => {
|
|
26
26
|
const chunkGraph = compilation.chunkGraph;
|
|
27
27
|
const compareNatural = compareChunksNatural(chunkGraph);
|
|
28
|
-
|
|
28
|
+
/** @type {Chunk[]} */
|
|
29
|
+
const chunksInNaturalOrder = [...chunks].sort(compareNatural);
|
|
29
30
|
assignAscendingChunkIds(chunksInNaturalOrder, compilation);
|
|
30
31
|
});
|
|
31
32
|
});
|
|
@@ -26,7 +26,7 @@ class NaturalModuleIdsPlugin {
|
|
|
26
26
|
*/
|
|
27
27
|
apply(compiler) {
|
|
28
28
|
compiler.hooks.compilation.tap(PLUGIN_NAME, compilation => {
|
|
29
|
-
compilation.hooks.moduleIds.tap(PLUGIN_NAME,
|
|
29
|
+
compilation.hooks.moduleIds.tap(PLUGIN_NAME, () => {
|
|
30
30
|
const [usedIds, modulesInNaturalOrder] =
|
|
31
31
|
getUsedModuleIdsAndModules(compilation);
|
|
32
32
|
modulesInNaturalOrder.sort(
|
|
@@ -15,7 +15,7 @@ const { assignAscendingChunkIds } = require("./IdHelpers");
|
|
|
15
15
|
/** @typedef {import("../Module")} Module */
|
|
16
16
|
|
|
17
17
|
const validate = createSchemaValidation(
|
|
18
|
-
require("../../schemas/plugins/ids/OccurrenceChunkIdsPlugin.check
|
|
18
|
+
require("../../schemas/plugins/ids/OccurrenceChunkIdsPlugin.check"),
|
|
19
19
|
() => require("../../schemas/plugins/ids/OccurrenceChunkIdsPlugin.json"),
|
|
20
20
|
{
|
|
21
21
|
name: "Occurrence Order Chunk Ids Plugin",
|
|
@@ -60,7 +60,8 @@ class OccurrenceChunkIdsPlugin {
|
|
|
60
60
|
occursInInitialChunksMap.set(c, occurs);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
/** @type {Chunk[]} */
|
|
64
|
+
const chunksInOccurrenceOrder = [...chunks].sort((a, b) => {
|
|
64
65
|
if (prioritiseInitial) {
|
|
65
66
|
const aEntryOccurs =
|
|
66
67
|
/** @type {number} */
|
|
@@ -20,7 +20,7 @@ const {
|
|
|
20
20
|
/** @typedef {import("../ModuleGraphConnection")} ModuleGraphConnection */
|
|
21
21
|
|
|
22
22
|
const validate = createSchemaValidation(
|
|
23
|
-
require("../../schemas/plugins/ids/OccurrenceModuleIdsPlugin.check
|
|
23
|
+
require("../../schemas/plugins/ids/OccurrenceModuleIdsPlugin.check"),
|
|
24
24
|
() => require("../../schemas/plugins/ids/OccurrenceModuleIdsPlugin.json"),
|
|
25
25
|
{
|
|
26
26
|
name: "Occurrence Order Module Ids Plugin",
|
|
@@ -72,7 +72,7 @@ class SyncModuleIdsPlugin {
|
|
|
72
72
|
if (!data || !dataChanged) return callback();
|
|
73
73
|
/** @type {{[key: string]: string | number}} */
|
|
74
74
|
const json = {};
|
|
75
|
-
const sorted =
|
|
75
|
+
const sorted = [...data].sort(([a], [b]) => (a < b ? -1 : 1));
|
|
76
76
|
for (const [key, value] of sorted) {
|
|
77
77
|
json[key] = value;
|
|
78
78
|
}
|
package/lib/index.js
CHANGED
|
@@ -126,6 +126,7 @@ const mergeExports = (obj, exports) => {
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
const fn = lazyFunction(() => require("./webpack"));
|
|
129
|
+
|
|
129
130
|
module.exports = mergeExports(fn, {
|
|
130
131
|
get webpack() {
|
|
131
132
|
return require("./webpack");
|
|
@@ -134,7 +135,10 @@ module.exports = mergeExports(fn, {
|
|
|
134
135
|
* @returns {(configuration: Configuration | Configuration[]) => void} validate fn
|
|
135
136
|
*/
|
|
136
137
|
get validate() {
|
|
137
|
-
const webpackOptionsSchemaCheck =
|
|
138
|
+
const webpackOptionsSchemaCheck =
|
|
139
|
+
/** @type {(configuration: Configuration | Configuration[]) => boolean} */
|
|
140
|
+
(require("../schemas/WebpackOptions.check"));
|
|
141
|
+
|
|
138
142
|
const getRealValidate = memoize(
|
|
139
143
|
/**
|
|
140
144
|
* @returns {(configuration: Configuration | Configuration[]) => void} validate fn
|
|
@@ -142,16 +146,19 @@ module.exports = mergeExports(fn, {
|
|
|
142
146
|
() => {
|
|
143
147
|
const validateSchema = require("./validateSchema");
|
|
144
148
|
const webpackOptionsSchema = require("../schemas/WebpackOptions.json");
|
|
149
|
+
|
|
145
150
|
return options => validateSchema(webpackOptionsSchema, options);
|
|
146
151
|
}
|
|
147
152
|
);
|
|
148
153
|
return options => {
|
|
149
|
-
if (!webpackOptionsSchemaCheck(
|
|
154
|
+
if (!webpackOptionsSchemaCheck(options)) {
|
|
150
155
|
getRealValidate()(options);
|
|
156
|
+
}
|
|
151
157
|
};
|
|
152
158
|
},
|
|
153
159
|
get validateSchema() {
|
|
154
160
|
const validateSchema = require("./validateSchema");
|
|
161
|
+
|
|
155
162
|
return validateSchema;
|
|
156
163
|
},
|
|
157
164
|
get version() {
|
|
@@ -455,7 +462,7 @@ module.exports = mergeExports(fn, {
|
|
|
455
462
|
return require("./optimize/LimitChunkCountPlugin");
|
|
456
463
|
},
|
|
457
464
|
get MergeDuplicateChunksPlugin() {
|
|
458
|
-
return require("./optimize/MergeDuplicateChunksPlugin
|
|
465
|
+
return require("./optimize/MergeDuplicateChunksPlugin");
|
|
459
466
|
},
|
|
460
467
|
get MinChunkSizePlugin() {
|
|
461
468
|
return require("./optimize/MinChunkSizePlugin");
|
|
@@ -641,6 +648,9 @@ module.exports = mergeExports(fn, {
|
|
|
641
648
|
schemes: {
|
|
642
649
|
get HttpUriPlugin() {
|
|
643
650
|
return require("./schemes/HttpUriPlugin");
|
|
651
|
+
},
|
|
652
|
+
get VirtualUrlPlugin() {
|
|
653
|
+
return require("./schemes/VirtualUrlPlugin");
|
|
644
654
|
}
|
|
645
655
|
},
|
|
646
656
|
ids: {
|