webpack 5.37.1 → 5.39.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.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/bin/webpack.js +20 -5
- package/lib/AsyncDependencyToInitialChunkError.js +0 -2
- package/lib/CaseSensitiveModulesWarning.js +0 -2
- package/lib/Chunk.js +6 -2
- package/lib/ChunkRenderError.js +0 -2
- package/lib/CodeGenerationError.js +0 -2
- package/lib/CommentCompilationWarning.js +0 -2
- package/lib/Compilation.js +43 -28
- package/lib/Compiler.js +3 -0
- package/lib/ConcurrentCompilationError.js +0 -2
- package/lib/ContextModule.js +2 -1
- package/lib/ContextModuleFactory.js +3 -1
- package/lib/DllReferencePlugin.js +0 -2
- package/lib/EntryPlugin.js +3 -3
- package/lib/ExportsInfo.js +20 -13
- package/lib/HarmonyLinkingError.js +0 -2
- package/lib/HookWebpackError.js +0 -1
- package/lib/HotModuleReplacementPlugin.js +7 -2
- package/lib/InvalidDependenciesModuleWarning.js +0 -2
- package/lib/ModuleBuildError.js +0 -2
- package/lib/ModuleDependencyError.js +0 -2
- package/lib/ModuleDependencyWarning.js +0 -2
- package/lib/ModuleError.js +0 -2
- package/lib/ModuleNotFoundError.js +0 -2
- package/lib/ModuleParseError.js +0 -2
- package/lib/ModuleRestoreError.js +0 -2
- package/lib/ModuleStoreError.js +0 -2
- package/lib/ModuleWarning.js +0 -2
- package/lib/NoModeWarning.js +0 -2
- package/lib/NormalModule.js +4 -3
- package/lib/NormalModuleFactory.js +2 -0
- package/lib/UnsupportedFeatureWarning.js +0 -2
- package/lib/WarnDeprecatedOptionPlugin.js +0 -2
- package/lib/Watching.js +21 -14
- package/lib/WebpackError.js +0 -2
- package/lib/asset/AssetGenerator.js +27 -6
- package/lib/asset/AssetModulesPlugin.js +1 -1
- package/lib/cache/PackFileCacheStrategy.js +3 -0
- package/lib/config/defaults.js +9 -1
- package/lib/config/normalization.js +1 -0
- package/lib/config/target.js +7 -2
- package/lib/dependencies/ContextElementDependency.js +6 -1
- package/lib/dependencies/CriticalDependencyWarning.js +0 -2
- package/lib/dependencies/ImportParserPlugin.js +1 -0
- package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +0 -2
- package/lib/dependencies/SystemPlugin.js +0 -2
- package/lib/errors/BuildCycleError.js +0 -1
- package/lib/hmr/LazyCompilationPlugin.js +3 -1
- package/lib/node/NodeEnvironmentPlugin.js +1 -0
- package/lib/optimize/ConcatenatedModule.js +9 -0
- package/lib/performance/AssetsOverSizeLimitWarning.js +0 -2
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +0 -2
- package/lib/performance/NoAsyncChunksWarning.js +0 -2
- package/lib/schemes/DataUriPlugin.js +21 -2
- package/lib/serialization/BinaryMiddleware.js +3 -0
- package/lib/serialization/SerializerMiddleware.js +19 -0
- package/lib/stats/DefaultStatsFactoryPlugin.js +5 -4
- package/lib/util/ArrayQueue.js +8 -0
- package/lib/util/AsyncQueue.js +9 -0
- package/lib/util/createHash.js +5 -4
- package/lib/util/serialization.js +108 -59
- package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +0 -2
- package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +0 -2
- package/package.json +4 -4
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +8 -0
- package/types.d.ts +24 -5
- package/lib/util/DataURI.js +0 -32
package/bin/webpack.js
CHANGED
@@ -32,13 +32,28 @@ const runCommand = (command, args) => {
|
|
32
32
|
* @returns {boolean} is the package installed?
|
33
33
|
*/
|
34
34
|
const isInstalled = packageName => {
|
35
|
-
|
36
|
-
require.resolve(packageName);
|
37
|
-
|
35
|
+
if (process.versions.pnp) {
|
38
36
|
return true;
|
39
|
-
} catch (err) {
|
40
|
-
return false;
|
41
37
|
}
|
38
|
+
|
39
|
+
const path = require("path");
|
40
|
+
const fs = require("graceful-fs");
|
41
|
+
|
42
|
+
let dir = __dirname;
|
43
|
+
|
44
|
+
do {
|
45
|
+
try {
|
46
|
+
if (
|
47
|
+
fs.statSync(path.join(dir, "node_modules", packageName)).isDirectory()
|
48
|
+
) {
|
49
|
+
return true;
|
50
|
+
}
|
51
|
+
} catch (_error) {
|
52
|
+
// Nothing
|
53
|
+
}
|
54
|
+
} while (dir !== (dir = path.dirname(dir)));
|
55
|
+
|
56
|
+
return false;
|
42
57
|
};
|
43
58
|
|
44
59
|
/**
|
package/lib/Chunk.js
CHANGED
@@ -598,8 +598,12 @@ class Chunk {
|
|
598
598
|
*/
|
599
599
|
getAllInitialChunks() {
|
600
600
|
const chunks = new Set();
|
601
|
-
|
602
|
-
|
601
|
+
const queue = new Set(this.groupsIterable);
|
602
|
+
for (const group of queue) {
|
603
|
+
if (group.isInitial()) {
|
604
|
+
for (const c of group.chunks) chunks.add(c);
|
605
|
+
for (const g of group.childrenIterable) queue.add(g);
|
606
|
+
}
|
603
607
|
}
|
604
608
|
return chunks;
|
605
609
|
}
|
package/lib/ChunkRenderError.js
CHANGED
package/lib/Compilation.js
CHANGED
@@ -337,6 +337,31 @@ const deprecatedNormalModuleLoaderHook = util.deprecate(
|
|
337
337
|
"DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK"
|
338
338
|
);
|
339
339
|
|
340
|
+
// TODO webpack 6: remove
|
341
|
+
const defineRemovedModuleTemplates = moduleTemplates => {
|
342
|
+
Object.defineProperties(moduleTemplates, {
|
343
|
+
asset: {
|
344
|
+
enumerable: false,
|
345
|
+
configurable: false,
|
346
|
+
get: () => {
|
347
|
+
throw new WebpackError(
|
348
|
+
"Compilation.moduleTemplates.asset has been removed"
|
349
|
+
);
|
350
|
+
}
|
351
|
+
},
|
352
|
+
webassembly: {
|
353
|
+
enumerable: false,
|
354
|
+
configurable: false,
|
355
|
+
get: () => {
|
356
|
+
throw new WebpackError(
|
357
|
+
"Compilation.moduleTemplates.webassembly has been removed"
|
358
|
+
);
|
359
|
+
}
|
360
|
+
}
|
361
|
+
});
|
362
|
+
moduleTemplates = undefined;
|
363
|
+
};
|
364
|
+
|
340
365
|
const byId = compareSelect(
|
341
366
|
/**
|
342
367
|
* @param {Chunk} c chunk
|
@@ -861,26 +886,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
861
886
|
this.moduleTemplates = {
|
862
887
|
javascript: new ModuleTemplate(this.runtimeTemplate, this)
|
863
888
|
};
|
864
|
-
|
865
|
-
asset: {
|
866
|
-
enumerable: false,
|
867
|
-
configurable: false,
|
868
|
-
get() {
|
869
|
-
throw new WebpackError(
|
870
|
-
"Compilation.moduleTemplates.asset has been removed"
|
871
|
-
);
|
872
|
-
}
|
873
|
-
},
|
874
|
-
webassembly: {
|
875
|
-
enumerable: false,
|
876
|
-
configurable: false,
|
877
|
-
get() {
|
878
|
-
throw new WebpackError(
|
879
|
-
"Compilation.moduleTemplates.webassembly has been removed"
|
880
|
-
);
|
881
|
-
}
|
882
|
-
}
|
883
|
-
});
|
889
|
+
defineRemovedModuleTemplates(this.moduleTemplates);
|
884
890
|
|
885
891
|
this.moduleGraph = new ModuleGraph();
|
886
892
|
/** @type {ChunkGraph} */
|
@@ -1999,6 +2005,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
1999
2005
|
}
|
2000
2006
|
|
2001
2007
|
finish(callback) {
|
2008
|
+
this.factorizeQueue.clear();
|
2002
2009
|
if (this.profile) {
|
2003
2010
|
this.logger.time("finish module profiles");
|
2004
2011
|
const ParallelismFactorCalculator = require("./util/ParallelismFactorCalculator");
|
@@ -2233,6 +2240,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
2233
2240
|
* @returns {void}
|
2234
2241
|
*/
|
2235
2242
|
seal(callback) {
|
2243
|
+
const finalCallback = err => {
|
2244
|
+
this.factorizeQueue.clear();
|
2245
|
+
this.buildQueue.clear();
|
2246
|
+
this.rebuildQueue.clear();
|
2247
|
+
this.processDependenciesQueue.clear();
|
2248
|
+
this.addModuleQueue.clear();
|
2249
|
+
return callback(err);
|
2250
|
+
};
|
2236
2251
|
const chunkGraph = new ChunkGraph(this.moduleGraph);
|
2237
2252
|
this.chunkGraph = chunkGraph;
|
2238
2253
|
|
@@ -2397,7 +2412,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
2397
2412
|
|
2398
2413
|
this.hooks.optimizeTree.callAsync(this.chunks, this.modules, err => {
|
2399
2414
|
if (err) {
|
2400
|
-
return
|
2415
|
+
return finalCallback(
|
2401
2416
|
makeWebpackError(err, "Compilation.hooks.optimizeTree")
|
2402
2417
|
);
|
2403
2418
|
}
|
@@ -2409,7 +2424,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
2409
2424
|
this.modules,
|
2410
2425
|
err => {
|
2411
2426
|
if (err) {
|
2412
|
-
return
|
2427
|
+
return finalCallback(
|
2413
2428
|
makeWebpackError(err, "Compilation.hooks.optimizeChunkModules")
|
2414
2429
|
);
|
2415
2430
|
}
|
@@ -2452,7 +2467,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
2452
2467
|
this.hooks.beforeCodeGeneration.call();
|
2453
2468
|
this.codeGeneration(err => {
|
2454
2469
|
if (err) {
|
2455
|
-
return
|
2470
|
+
return finalCallback(err);
|
2456
2471
|
}
|
2457
2472
|
this.hooks.afterCodeGeneration.call();
|
2458
2473
|
this.logger.timeEnd("code generation");
|
@@ -2471,7 +2486,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
2471
2486
|
|
2472
2487
|
this._runCodeGenerationJobs(codeGenerationJobs, err => {
|
2473
2488
|
if (err) {
|
2474
|
-
return
|
2489
|
+
return finalCallback(err);
|
2475
2490
|
}
|
2476
2491
|
|
2477
2492
|
if (shouldRecord) {
|
@@ -2491,7 +2506,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
2491
2506
|
this.logger.time("process assets");
|
2492
2507
|
this.hooks.processAssets.callAsync(this.assets, err => {
|
2493
2508
|
if (err) {
|
2494
|
-
return
|
2509
|
+
return finalCallback(
|
2495
2510
|
makeWebpackError(err, "Compilation.hooks.processAssets")
|
2496
2511
|
);
|
2497
2512
|
}
|
@@ -2517,12 +2532,12 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
2517
2532
|
}
|
2518
2533
|
return this.hooks.afterSeal.callAsync(err => {
|
2519
2534
|
if (err) {
|
2520
|
-
return
|
2535
|
+
return finalCallback(
|
2521
2536
|
makeWebpackError(err, "Compilation.hooks.afterSeal")
|
2522
2537
|
);
|
2523
2538
|
}
|
2524
2539
|
this.fileSystemInfo.logStatistics();
|
2525
|
-
|
2540
|
+
finalCallback();
|
2526
2541
|
});
|
2527
2542
|
});
|
2528
2543
|
};
|
@@ -2533,7 +2548,7 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
|
|
2533
2548
|
this.createChunkAssets(err => {
|
2534
2549
|
this.logger.timeEnd("create chunk assets");
|
2535
2550
|
if (err) {
|
2536
|
-
return
|
2551
|
+
return finalCallback(err);
|
2537
2552
|
}
|
2538
2553
|
cont();
|
2539
2554
|
});
|
package/lib/Compiler.js
CHANGED
@@ -230,6 +230,8 @@ class Compiler {
|
|
230
230
|
this.fileTimestamps = undefined;
|
231
231
|
/** @type {Map<string, FileSystemInfoEntry | "ignore" | null>} */
|
232
232
|
this.contextTimestamps = undefined;
|
233
|
+
/** @type {number} */
|
234
|
+
this.fsStartTime = undefined;
|
233
235
|
|
234
236
|
/** @type {ResolverFactory} */
|
235
237
|
this.resolverFactory = new ResolverFactory();
|
@@ -952,6 +954,7 @@ ${other}`);
|
|
952
954
|
childCompiler.removedFiles = this.removedFiles;
|
953
955
|
childCompiler.fileTimestamps = this.fileTimestamps;
|
954
956
|
childCompiler.contextTimestamps = this.contextTimestamps;
|
957
|
+
childCompiler.fsStartTime = this.fsStartTime;
|
955
958
|
childCompiler.cache = this.cache;
|
956
959
|
childCompiler.compilerPath = `${this.compilerPath}${compilerName}|${compilerIndex}|`;
|
957
960
|
|
@@ -14,7 +14,5 @@ module.exports = class ConcurrentCompilationError extends WebpackError {
|
|
14
14
|
this.name = "ConcurrentCompilationError";
|
15
15
|
this.message =
|
16
16
|
"You ran Webpack twice. Each instance only supports a single concurrent compilation at a time.";
|
17
|
-
|
18
|
-
Error.captureStackTrace(this, this.constructor);
|
19
17
|
}
|
20
18
|
};
|
package/lib/ContextModule.js
CHANGED
@@ -54,6 +54,7 @@ const makeSerializable = require("./util/makeSerializable");
|
|
54
54
|
* @property {RegExp=} include
|
55
55
|
* @property {RegExp=} exclude
|
56
56
|
* @property {RawChunkGroupOptions=} groupOptions
|
57
|
+
* @property {string=} typePrefix
|
57
58
|
* @property {string=} category
|
58
59
|
* @property {string[][]=} referencedExports exports referenced from modules (won't be mangled)
|
59
60
|
*/
|
@@ -577,7 +578,7 @@ class ContextModule extends Module {
|
|
577
578
|
fakeMapDataExpression = "fakeMap[id]"
|
578
579
|
) {
|
579
580
|
if (typeof fakeMap === "number") {
|
580
|
-
return `return ${this.getReturn(fakeMap)};`;
|
581
|
+
return `return ${this.getReturn(fakeMap, asyncModule)};`;
|
581
582
|
}
|
582
583
|
return `return ${
|
583
584
|
RuntimeGlobals.createFakeNamespaceObject
|
@@ -273,7 +273,8 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
|
|
273
273
|
include,
|
274
274
|
exclude,
|
275
275
|
referencedExports,
|
276
|
-
category
|
276
|
+
category,
|
277
|
+
typePrefix
|
277
278
|
} = options;
|
278
279
|
if (!regExp || !resource) return callback(null, []);
|
279
280
|
|
@@ -346,6 +347,7 @@ module.exports = class ContextModuleFactory extends ModuleFactory {
|
|
346
347
|
const dep = new ContextElementDependency(
|
347
348
|
obj.request + resourceQuery + resourceFragment,
|
348
349
|
obj.request,
|
350
|
+
typePrefix,
|
349
351
|
category,
|
350
352
|
referencedExports
|
351
353
|
);
|
package/lib/EntryPlugin.js
CHANGED
@@ -41,10 +41,10 @@ class EntryPlugin {
|
|
41
41
|
}
|
42
42
|
);
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
const { entry, options, context } = this;
|
45
|
+
const dep = EntryPlugin.createDependency(entry, options);
|
46
46
|
|
47
|
-
|
47
|
+
compiler.hooks.make.tapAsync("EntryPlugin", (compilation, callback) => {
|
48
48
|
compilation.addEntry(context, dep, options, err => {
|
49
49
|
callback(err);
|
50
50
|
});
|
package/lib/ExportsInfo.js
CHANGED
@@ -137,18 +137,22 @@ class ExportsInfo {
|
|
137
137
|
|
138
138
|
_sortExportsMap(exports) {
|
139
139
|
if (exports.size > 1) {
|
140
|
-
const
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
)
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
140
|
+
const namesInOrder = [];
|
141
|
+
for (const entry of exports.values()) {
|
142
|
+
namesInOrder.push(entry.name);
|
143
|
+
}
|
144
|
+
namesInOrder.sort();
|
145
|
+
let i = 0;
|
146
|
+
for (const entry of exports.values()) {
|
147
|
+
const name = namesInOrder[i];
|
148
|
+
if (entry.name !== name) break;
|
149
|
+
i++;
|
150
|
+
}
|
151
|
+
for (; i < namesInOrder.length; i++) {
|
152
|
+
const name = namesInOrder[i];
|
153
|
+
const correctEntry = exports.get(name);
|
154
|
+
exports.delete(name);
|
155
|
+
exports.set(name, correctEntry);
|
152
156
|
}
|
153
157
|
}
|
154
158
|
}
|
@@ -722,7 +726,7 @@ class ExportsInfo {
|
|
722
726
|
const otherCanMangleProvide = this._otherExportsInfo.canMangleProvide;
|
723
727
|
const otherTerminalBinding = this._otherExportsInfo.terminalBinding;
|
724
728
|
const exports = [];
|
725
|
-
for (const exportInfo of this.
|
729
|
+
for (const exportInfo of this.orderedExports) {
|
726
730
|
if (
|
727
731
|
exportInfo.provided !== otherProvided ||
|
728
732
|
exportInfo.canMangleProvide !== otherCanMangleProvide ||
|
@@ -754,7 +758,9 @@ class ExportsInfo {
|
|
754
758
|
otherTerminalBinding,
|
755
759
|
exports
|
756
760
|
}) {
|
761
|
+
let wasEmpty = true;
|
757
762
|
for (const exportInfo of this._exports.values()) {
|
763
|
+
wasEmpty = false;
|
758
764
|
exportInfo.provided = otherProvided;
|
759
765
|
exportInfo.canMangleProvide = otherCanMangleProvide;
|
760
766
|
exportInfo.terminalBinding = otherTerminalBinding;
|
@@ -772,6 +778,7 @@ class ExportsInfo {
|
|
772
778
|
exportsInfo.restoreProvided(exp.exportsInfo);
|
773
779
|
}
|
774
780
|
}
|
781
|
+
if (wasEmpty) this._exportsAreOrdered = true;
|
775
782
|
}
|
776
783
|
}
|
777
784
|
|
package/lib/HookWebpackError.js
CHANGED
@@ -31,7 +31,8 @@ const {
|
|
31
31
|
keyToRuntime,
|
32
32
|
forEachRuntime,
|
33
33
|
mergeRuntimeOwned,
|
34
|
-
subtractRuntime
|
34
|
+
subtractRuntime,
|
35
|
+
intersectRuntime
|
35
36
|
} = require("./util/runtime");
|
36
37
|
|
37
38
|
/** @typedef {import("./Chunk")} Chunk */
|
@@ -502,7 +503,11 @@ class HotModuleReplacementPlugin {
|
|
502
503
|
);
|
503
504
|
if (currentChunk) {
|
504
505
|
chunkId = currentChunk.id;
|
505
|
-
newRuntime =
|
506
|
+
newRuntime = intersectRuntime(
|
507
|
+
currentChunk.runtime,
|
508
|
+
allOldRuntime
|
509
|
+
);
|
510
|
+
if (newRuntime === undefined) continue;
|
506
511
|
newModules = chunkGraph
|
507
512
|
.getChunkModules(currentChunk)
|
508
513
|
.filter(module => updatedModules.has(module, currentChunk));
|
package/lib/ModuleBuildError.js
CHANGED
@@ -30,8 +30,6 @@ class ModuleDependencyError extends WebpackError {
|
|
30
30
|
/** error is not (de)serialized, so it might be undefined after deserialization */
|
31
31
|
this.error = err;
|
32
32
|
|
33
|
-
Error.captureStackTrace(this, this.constructor);
|
34
|
-
|
35
33
|
if (err && /** @type {any} */ (err).hideStack) {
|
36
34
|
this.stack =
|
37
35
|
err.stack.split("\n").slice(1).join("\n") + "\n\n" + this.stack;
|
@@ -30,8 +30,6 @@ class ModuleDependencyWarning extends WebpackError {
|
|
30
30
|
/** error is not (de)serialized, so it might be undefined after deserialization */
|
31
31
|
this.error = err;
|
32
32
|
|
33
|
-
Error.captureStackTrace(this, this.constructor);
|
34
|
-
|
35
33
|
if (err && /** @type {any} */ (err).hideStack) {
|
36
34
|
this.stack =
|
37
35
|
err.stack.split("\n").slice(1).join("\n") + "\n\n" + this.stack;
|
package/lib/ModuleError.js
CHANGED
package/lib/ModuleParseError.js
CHANGED
package/lib/ModuleStoreError.js
CHANGED
package/lib/ModuleWarning.js
CHANGED
package/lib/NoModeWarning.js
CHANGED
@@ -18,7 +18,5 @@ module.exports = class NoModeWarning extends WebpackError {
|
|
18
18
|
"Set 'mode' option to 'development' or 'production' to enable defaults for each environment.\n" +
|
19
19
|
"You can also set it to 'none' to disable any default behavior. " +
|
20
20
|
"Learn more: https://webpack.js.org/configuration/mode/";
|
21
|
-
|
22
|
-
Error.captureStackTrace(this, this.constructor);
|
23
21
|
}
|
24
22
|
};
|
package/lib/NormalModule.js
CHANGED
@@ -164,8 +164,6 @@ class NonErrorEmittedError extends WebpackError {
|
|
164
164
|
|
165
165
|
this.name = "NonErrorEmittedError";
|
166
166
|
this.message = "(Emitted value instead of an instance of Error) " + error;
|
167
|
-
|
168
|
-
Error.captureStackTrace(this, this.constructor);
|
169
167
|
}
|
170
168
|
}
|
171
169
|
|
@@ -219,6 +217,7 @@ class NormalModule extends Module {
|
|
219
217
|
* @param {string} options.rawRequest request without resolving
|
220
218
|
* @param {LoaderItem[]} options.loaders list of loaders
|
221
219
|
* @param {string} options.resource path + query of the real resource
|
220
|
+
* @param {Record<string, any>=} options.resourceResolveData resource resolve data
|
222
221
|
* @param {string | undefined} options.matchResource path + query of the matched resource (virtual)
|
223
222
|
* @param {Parser} options.parser the parser used
|
224
223
|
* @param {object} options.parserOptions the options of the parser used
|
@@ -234,6 +233,7 @@ class NormalModule extends Module {
|
|
234
233
|
rawRequest,
|
235
234
|
loaders,
|
236
235
|
resource,
|
236
|
+
resourceResolveData,
|
237
237
|
matchResource,
|
238
238
|
parser,
|
239
239
|
parserOptions,
|
@@ -260,6 +260,7 @@ class NormalModule extends Module {
|
|
260
260
|
this.generatorOptions = generatorOptions;
|
261
261
|
/** @type {string} */
|
262
262
|
this.resource = resource;
|
263
|
+
this.resourceResolveData = resourceResolveData;
|
263
264
|
/** @type {string | undefined} */
|
264
265
|
this.matchResource = matchResource;
|
265
266
|
/** @type {LoaderItem[]} */
|
@@ -902,7 +903,7 @@ class NormalModule extends Module {
|
|
902
903
|
assetsInfo: undefined
|
903
904
|
};
|
904
905
|
|
905
|
-
const startTime = Date.now();
|
906
|
+
const startTime = compilation.compiler.fsStartTime || Date.now();
|
906
907
|
|
907
908
|
return this.doBuild(options, compilation, resolver, fs, err => {
|
908
909
|
// if we have an error mark module as failed and exit
|
@@ -168,6 +168,7 @@ const unsafeCacheData = new WeakMap();
|
|
168
168
|
|
169
169
|
const ruleSetCompiler = new RuleSetCompiler([
|
170
170
|
new BasicMatcherRulePlugin("test", "resource"),
|
171
|
+
new BasicMatcherRulePlugin("scheme"),
|
171
172
|
new BasicMatcherRulePlugin("mimetype"),
|
172
173
|
new BasicMatcherRulePlugin("dependency"),
|
173
174
|
new BasicMatcherRulePlugin("include", "resource"),
|
@@ -443,6 +444,7 @@ class NormalModuleFactory extends ModuleFactory {
|
|
443
444
|
realResource: resourceData.path,
|
444
445
|
resourceQuery: resourceDataForRules.query,
|
445
446
|
resourceFragment: resourceDataForRules.fragment,
|
447
|
+
scheme,
|
446
448
|
mimetype: matchResourceData ? "" : resourceData.data.mimetype || "",
|
447
449
|
dependency: dependencyType,
|
448
450
|
descriptionData: matchResourceData
|