webpack 5.51.0 → 5.52.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 CHANGED
File without changes
package/lib/ChunkGraph.js CHANGED
@@ -205,6 +205,8 @@ class ChunkGraphChunk {
205
205
  this.runtimeModules = new SortableSet();
206
206
  /** @type {Set<RuntimeModule> | undefined} */
207
207
  this.fullHashModules = undefined;
208
+ /** @type {Set<RuntimeModule> | undefined} */
209
+ this.dependentHashModules = undefined;
208
210
  /** @type {Set<string> | undefined} */
209
211
  this.runtimeRequirements = undefined;
210
212
  /** @type {Set<string>} */
@@ -389,6 +391,20 @@ class ChunkGraph {
389
391
  }
390
392
  }
391
393
 
394
+ /**
395
+ * @param {Chunk} chunk the chunk
396
+ * @param {Iterable<RuntimeModule>} modules the modules that require a full hash
397
+ * @returns {void}
398
+ */
399
+ attachDependentHashModules(chunk, modules) {
400
+ const cgc = this._getChunkGraphChunk(chunk);
401
+ if (cgc.dependentHashModules === undefined)
402
+ cgc.dependentHashModules = new Set();
403
+ for (const module of modules) {
404
+ cgc.dependentHashModules.add(module);
405
+ }
406
+ }
407
+
392
408
  /**
393
409
  * @param {Module} oldModule the replaced module
394
410
  * @param {Module} newModule the replacing module
@@ -444,6 +460,17 @@ class ChunkGraph {
444
460
  cgc.fullHashModules.delete(/** @type {RuntimeModule} */ (oldModule));
445
461
  cgc.fullHashModules.add(/** @type {RuntimeModule} */ (newModule));
446
462
  }
463
+ if (
464
+ cgc.dependentHashModules !== undefined &&
465
+ cgc.dependentHashModules.has(/** @type {RuntimeModule} */ (oldModule))
466
+ ) {
467
+ cgc.dependentHashModules.delete(
468
+ /** @type {RuntimeModule} */ (oldModule)
469
+ );
470
+ cgc.dependentHashModules.add(
471
+ /** @type {RuntimeModule} */ (newModule)
472
+ );
473
+ }
447
474
  }
448
475
  oldCgm.runtimeInChunks = undefined;
449
476
  }
@@ -529,13 +556,22 @@ class ChunkGraph {
529
556
 
530
557
  /**
531
558
  * @param {Chunk} chunk the chunk
532
- * @returns {number} the number of module which are contained in this chunk
559
+ * @returns {number} the number of modules which are contained in this chunk
533
560
  */
534
561
  getNumberOfChunkModules(chunk) {
535
562
  const cgc = this._getChunkGraphChunk(chunk);
536
563
  return cgc.modules.size;
537
564
  }
538
565
 
566
+ /**
567
+ * @param {Chunk} chunk the chunk
568
+ * @returns {number} the number of full hash modules which are contained in this chunk
569
+ */
570
+ getNumberOfChunkFullHashModules(chunk) {
571
+ const cgc = this._getChunkGraphChunk(chunk);
572
+ return cgc.fullHashModules === undefined ? 0 : cgc.fullHashModules.size;
573
+ }
574
+
539
575
  /**
540
576
  * @param {Chunk} chunk the chunk
541
577
  * @returns {Iterable<Module>} return the modules for this chunk
@@ -900,6 +936,23 @@ class ChunkGraph {
900
936
  ChunkGraph.clearChunkGraphForChunk(chunkB);
901
937
  }
902
938
 
939
+ /**
940
+ * @param {Chunk} chunk the chunk to upgrade
941
+ * @returns {void}
942
+ */
943
+ upgradeDependentToFullHashModules(chunk) {
944
+ const cgc = this._getChunkGraphChunk(chunk);
945
+ if (cgc.dependentHashModules === undefined) return;
946
+ if (cgc.fullHashModules === undefined) {
947
+ cgc.fullHashModules = cgc.dependentHashModules;
948
+ } else {
949
+ for (const m of cgc.dependentHashModules) {
950
+ cgc.fullHashModules.add(m);
951
+ }
952
+ cgc.dependentHashModules = undefined;
953
+ }
954
+ }
955
+
903
956
  /**
904
957
  * @param {Module} module the checked module
905
958
  * @param {Chunk} chunk the checked chunk
@@ -952,6 +1005,18 @@ class ChunkGraph {
952
1005
  cgc.fullHashModules.add(module);
953
1006
  }
954
1007
 
1008
+ /**
1009
+ * @param {Chunk} chunk the new chunk
1010
+ * @param {RuntimeModule} module the module that require a full hash
1011
+ * @returns {void}
1012
+ */
1013
+ addDependentHashModuleToChunk(chunk, module) {
1014
+ const cgc = this._getChunkGraphChunk(chunk);
1015
+ if (cgc.dependentHashModules === undefined)
1016
+ cgc.dependentHashModules = new Set();
1017
+ cgc.dependentHashModules.add(module);
1018
+ }
1019
+
955
1020
  /**
956
1021
  * @param {Chunk} chunk the new chunk
957
1022
  * @param {Module} module the entry module
@@ -1128,6 +1193,15 @@ class ChunkGraph {
1128
1193
  return cgc.fullHashModules;
1129
1194
  }
1130
1195
 
1196
+ /**
1197
+ * @param {Chunk} chunk the chunk
1198
+ * @returns {Iterable<RuntimeModule> | undefined} iterable of modules (do not modify)
1199
+ */
1200
+ getChunkDependentHashModulesIterable(chunk) {
1201
+ const cgc = this._getChunkGraphChunk(chunk);
1202
+ return cgc.dependentHashModules;
1203
+ }
1204
+
1131
1205
  /** @typedef {[Module, Entrypoint | undefined]} EntryModuleWithChunkGroup */
1132
1206
 
1133
1207
  /**
@@ -2879,6 +2879,8 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
2879
2879
  chunkGraph.connectChunkAndRuntimeModule(chunk, module);
2880
2880
  if (module.fullHash) {
2881
2881
  chunkGraph.addFullHashModuleToChunk(chunk, module);
2882
+ } else if (module.dependentHash) {
2883
+ chunkGraph.addDependentHashModuleToChunk(chunk, module);
2882
2884
  }
2883
2885
 
2884
2886
  // attach runtime module
@@ -3344,8 +3346,13 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
3344
3346
  if (remaining > 0) {
3345
3347
  const readyChunks = [];
3346
3348
  for (const chunk of runtimeChunks) {
3349
+ const hasFullHashModules =
3350
+ chunkGraph.getNumberOfChunkFullHashModules(chunk) !== 0;
3347
3351
  const info = runtimeChunksMap.get(chunk);
3348
3352
  for (const otherInfo of info.referencedBy) {
3353
+ if (hasFullHashModules) {
3354
+ chunkGraph.upgradeDependentToFullHashModules(otherInfo.chunk);
3355
+ }
3349
3356
  remaining--;
3350
3357
  if (--otherInfo.remaining === 0) {
3351
3358
  readyChunks.push(otherInfo.chunk);
package/lib/Compiler.js CHANGED
@@ -1130,6 +1130,13 @@ ${other}`);
1130
1130
  * @returns {void}
1131
1131
  */
1132
1132
  close(callback) {
1133
+ if (this.watching) {
1134
+ // When there is still an active watching, close this first
1135
+ this.watching.close(err => {
1136
+ this.close(callback);
1137
+ });
1138
+ return;
1139
+ }
1133
1140
  this.hooks.shutdown.callAsync(err => {
1134
1141
  if (err) return callback(err);
1135
1142
  // Get rid of reference to last compilation to avoid leaking memory
@@ -11,7 +11,7 @@ const NormalModule = require("./NormalModule");
11
11
  const SourceMapDevToolModuleOptionsPlugin = require("./SourceMapDevToolModuleOptionsPlugin");
12
12
  const JavascriptModulesPlugin = require("./javascript/JavascriptModulesPlugin");
13
13
  const ConcatenatedModule = require("./optimize/ConcatenatedModule");
14
- const { absolutify } = require("./util/identifier");
14
+ const { makePathsAbsolute } = require("./util/identifier");
15
15
 
16
16
  /** @typedef {import("webpack-sources").Source} Source */
17
17
  /** @typedef {import("../declarations/WebpackOptions").DevTool} DevToolOptions */
@@ -125,7 +125,7 @@ class EvalSourceMapDevToolPlugin {
125
125
  const root = compiler.root;
126
126
  const modules = sourceMap.sources.map(source => {
127
127
  if (!source.startsWith("webpack://")) return source;
128
- source = absolutify(context, source.slice(10), root);
128
+ source = makePathsAbsolute(context, source.slice(10), root);
129
129
  const module = compilation.findModule(source);
130
130
  return module || source;
131
131
  });
@@ -13,6 +13,7 @@ const Module = require("./Module");
13
13
  const RuntimeGlobals = require("./RuntimeGlobals");
14
14
  const Template = require("./Template");
15
15
  const StaticExportsDependency = require("./dependencies/StaticExportsDependency");
16
+ const createHash = require("./util/createHash");
16
17
  const extractUrlAndGlobal = require("./util/extractUrlAndGlobal");
17
18
  const makeSerializable = require("./util/makeSerializable");
18
19
  const propertyAccess = require("./util/propertyAccess");
@@ -159,18 +160,25 @@ const getSourceForImportExternal = (moduleAndSpecifiers, runtimeTemplate) => {
159
160
  };
160
161
 
161
162
  class ModuleExternalInitFragment extends InitFragment {
162
- constructor(id, request) {
163
- const identifier = `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(
164
- `${id}`
165
- )}__`;
163
+ constructor(request, ident) {
164
+ if (ident === undefined) {
165
+ ident = Template.toIdentifier(request);
166
+ if (ident !== request) {
167
+ ident += `_${createHash("md4")
168
+ .update(request)
169
+ .digest("hex")
170
+ .slice(0, 8)}`;
171
+ }
172
+ }
173
+ const identifier = `__WEBPACK_EXTERNAL_MODULE_${ident}__`;
166
174
  super(
167
175
  `import * as ${identifier} from ${JSON.stringify(request)};\n`,
168
176
  InitFragment.STAGE_HARMONY_IMPORTS,
169
177
  0,
170
- `external module import ${id}`
178
+ `external module import ${ident}`
171
179
  );
180
+ this._ident = ident;
172
181
  this._identifier = identifier;
173
- this._id = id;
174
182
  this._request = request;
175
183
  }
176
184
 
@@ -185,8 +193,8 @@ register(
185
193
  "ModuleExternalInitFragment",
186
194
  {
187
195
  serialize(obj, { write }) {
188
- write(obj._id);
189
196
  write(obj._request);
197
+ write(obj._ident);
190
198
  },
191
199
  deserialize({ read }) {
192
200
  return new ModuleExternalInitFragment(read(), read());
@@ -236,10 +244,7 @@ const getSourceForModuleExternal = (
236
244
  ) => {
237
245
  if (!Array.isArray(moduleAndSpecifiers))
238
246
  moduleAndSpecifiers = [moduleAndSpecifiers];
239
- const initFragment = new ModuleExternalInitFragment(
240
- id,
241
- moduleAndSpecifiers[0]
242
- );
247
+ const initFragment = new ModuleExternalInitFragment(moduleAndSpecifiers[0]);
243
248
  const baseAccess = `${initFragment.getNamespaceIdentifier()}${propertyAccess(
244
249
  moduleAndSpecifiers,
245
250
  1
@@ -400,7 +405,7 @@ class ExternalModule extends Module {
400
405
  * @returns {string} a unique identifier of the module
401
406
  */
402
407
  identifier() {
403
- return "external " + JSON.stringify(this.request);
408
+ return `external ${this.externalType} ${JSON.stringify(this.request)}`;
404
409
  }
405
410
 
406
411
  /**
@@ -531,18 +536,20 @@ class ExternalModule extends Module {
531
536
  case "umd":
532
537
  case "umd2":
533
538
  case "system":
534
- case "jsonp":
539
+ case "jsonp": {
540
+ const id = chunkGraph.getModuleId(this);
535
541
  return getSourceForAmdOrUmdExternal(
536
- chunkGraph.getModuleId(this),
542
+ id !== null ? id : this.identifier(),
537
543
  this.isOptional(moduleGraph),
538
544
  request,
539
545
  runtimeTemplate
540
546
  );
547
+ }
541
548
  case "import":
542
549
  return getSourceForImportExternal(request, runtimeTemplate);
543
550
  case "script":
544
551
  return getSourceForScriptExternal(request, runtimeTemplate);
545
- case "module":
552
+ case "module": {
546
553
  if (!this.buildInfo.module) {
547
554
  if (!runtimeTemplate.supportsDynamicImport()) {
548
555
  throw new Error(
@@ -559,12 +566,14 @@ class ExternalModule extends Module {
559
566
  "The target environment doesn't support EcmaScriptModule syntax so it's not possible to use external type 'module'"
560
567
  );
561
568
  }
569
+ const id = chunkGraph.getModuleId(this);
562
570
  return getSourceForModuleExternal(
563
- chunkGraph.getModuleId(this),
571
+ id !== null ? id : this.identifier(),
564
572
  request,
565
573
  moduleGraph.getExportsInfo(this),
566
574
  runtime
567
575
  );
576
+ }
568
577
  case "var":
569
578
  case "promise":
570
579
  case "const":
@@ -813,6 +813,7 @@ const getManagedItem = (managedPath, path) => {
813
813
  */
814
814
  const getResolvedTimestamp = entry => {
815
815
  if (entry === "ignore") return undefined;
816
+ if (entry === null) return null;
816
817
  if (entry.resolved !== undefined) return entry.resolved;
817
818
  return entry.symlinks === undefined ? entry : undefined;
818
819
  };
@@ -822,6 +823,7 @@ const getResolvedTimestamp = entry => {
822
823
  * @returns {string | undefined} the resolved entry
823
824
  */
824
825
  const getResolvedHash = entry => {
826
+ if (entry === null) return null;
825
827
  if (entry.resolved !== undefined) return entry.resolved;
826
828
  return entry.symlinks === undefined ? entry.hash : undefined;
827
829
  };
@@ -1159,9 +1161,10 @@ class FileSystemInfo {
1159
1161
  if (cache !== undefined) {
1160
1162
  const resolved = getResolvedTimestamp(cache);
1161
1163
  if (resolved !== undefined) return callback(null, resolved);
1162
- this._resolveContextTimestamp(cache, callback);
1164
+ return this._resolveContextTimestamp(cache, callback);
1163
1165
  }
1164
1166
  this.contextTimestampQueue.add(path, (err, entry) => {
1167
+ if (err) return callback(err);
1165
1168
  const resolved = getResolvedTimestamp(entry);
1166
1169
  if (resolved !== undefined) return callback(null, resolved);
1167
1170
  this._resolveContextTimestamp(entry, callback);
@@ -1176,9 +1179,7 @@ class FileSystemInfo {
1176
1179
  _getUnresolvedContextTimestamp(path, callback) {
1177
1180
  const cache = this._contextTimestamps.get(path);
1178
1181
  if (cache !== undefined) return callback(null, cache);
1179
- this.contextTimestampQueue.add(path, (err, entry) => {
1180
- return callback(null, entry);
1181
- });
1182
+ this.contextTimestampQueue.add(path, callback);
1182
1183
  }
1183
1184
 
1184
1185
  /**
@@ -1202,9 +1203,10 @@ class FileSystemInfo {
1202
1203
  if (cache !== undefined) {
1203
1204
  const resolved = getResolvedHash(cache);
1204
1205
  if (resolved !== undefined) return callback(null, resolved);
1205
- this._resolveContextHash(cache, callback);
1206
+ return this._resolveContextHash(cache, callback);
1206
1207
  }
1207
1208
  this.contextHashQueue.add(path, (err, entry) => {
1209
+ if (err) return callback(err);
1208
1210
  const resolved = getResolvedHash(entry);
1209
1211
  if (resolved !== undefined) return callback(null, resolved);
1210
1212
  this._resolveContextHash(entry, callback);
@@ -1219,9 +1221,7 @@ class FileSystemInfo {
1219
1221
  _getUnresolvedContextHash(path, callback) {
1220
1222
  const cache = this._contextHashes.get(path);
1221
1223
  if (cache !== undefined) return callback(null, cache);
1222
- this.contextHashQueue.add(path, (err, entry) => {
1223
- return callback(null, entry);
1224
- });
1224
+ this.contextHashQueue.add(path, callback);
1225
1225
  }
1226
1226
 
1227
1227
  /**
@@ -1234,9 +1234,10 @@ class FileSystemInfo {
1234
1234
  if (cache !== undefined) {
1235
1235
  const resolved = getResolvedTimestamp(cache);
1236
1236
  if (resolved !== undefined) return callback(null, resolved);
1237
- this._resolveContextTsh(cache, callback);
1237
+ return this._resolveContextTsh(cache, callback);
1238
1238
  }
1239
1239
  this.contextTshQueue.add(path, (err, entry) => {
1240
+ if (err) return callback(err);
1240
1241
  const resolved = getResolvedTimestamp(entry);
1241
1242
  if (resolved !== undefined) return callback(null, resolved);
1242
1243
  this._resolveContextTsh(entry, callback);
@@ -1251,9 +1252,7 @@ class FileSystemInfo {
1251
1252
  _getUnresolvedContextTsh(path, callback) {
1252
1253
  const cache = this._contextTshs.get(path);
1253
1254
  if (cache !== undefined) return callback(null, cache);
1254
- this.contextTshQueue.add(path, (err, entry) => {
1255
- return callback(null, entry);
1256
- });
1255
+ this.contextTshQueue.add(path, callback);
1257
1256
  }
1258
1257
 
1259
1258
  _createBuildDependenciesResolvers() {
@@ -495,6 +495,7 @@ class HotModuleReplacementPlugin {
495
495
  let newModules;
496
496
  let newRuntimeModules;
497
497
  let newFullHashModules;
498
+ let newDependentHashModules;
498
499
  let newRuntime;
499
500
  let removedFromRuntime;
500
501
  const currentChunk = find(
@@ -521,6 +522,13 @@ class HotModuleReplacementPlugin {
521
522
  Array.from(fullHashModules).filter(module =>
522
523
  updatedModules.has(module, currentChunk)
523
524
  );
525
+ const dependentHashModules =
526
+ chunkGraph.getChunkDependentHashModulesIterable(currentChunk);
527
+ newDependentHashModules =
528
+ dependentHashModules &&
529
+ Array.from(dependentHashModules).filter(module =>
530
+ updatedModules.has(module, currentChunk)
531
+ );
524
532
  removedFromRuntime = subtractRuntime(oldRuntime, newRuntime);
525
533
  } else {
526
534
  // chunk has completely removed
@@ -607,6 +615,12 @@ class HotModuleReplacementPlugin {
607
615
  newFullHashModules
608
616
  );
609
617
  }
618
+ if (newDependentHashModules) {
619
+ chunkGraph.attachDependentHashModules(
620
+ hotUpdateChunk,
621
+ newDependentHashModules
622
+ );
623
+ }
610
624
  const renderManifest = compilation.getRenderManifest({
611
625
  chunk: hotUpdateChunk,
612
626
  hash: records.hash,
@@ -6,6 +6,7 @@
6
6
  "use strict";
7
7
 
8
8
  const { ConcatSource } = require("webpack-sources");
9
+ const makeSerializable = require("./util/makeSerializable");
9
10
 
10
11
  /** @typedef {import("webpack-sources").Source} Source */
11
12
  /** @typedef {import("./Generator").GenerateContext} GenerateContext */
@@ -123,8 +124,30 @@ class InitFragment {
123
124
  return source;
124
125
  }
125
126
  }
127
+
128
+ serialize(context) {
129
+ const { write } = context;
130
+
131
+ write(this.content);
132
+ write(this.stage);
133
+ write(this.position);
134
+ write(this.key);
135
+ write(this.endContent);
136
+ }
137
+
138
+ deserialize(context) {
139
+ const { read } = context;
140
+
141
+ this.content = read();
142
+ this.stage = read();
143
+ this.position = read();
144
+ this.key = read();
145
+ this.endContent = read();
146
+ }
126
147
  }
127
148
 
149
+ makeSerializable(InitFragment, "webpack/lib/InitFragment");
150
+
128
151
  InitFragment.prototype.merge = undefined;
129
152
 
130
153
  InitFragment.STAGE_CONSTANTS = 10;
@@ -38,7 +38,11 @@ const {
38
38
  } = require("./util/comparators");
39
39
  const createHash = require("./util/createHash");
40
40
  const { join } = require("./util/fs");
41
- const { contextify, absolutify } = require("./util/identifier");
41
+ const {
42
+ contextify,
43
+ absolutify,
44
+ makePathsRelative
45
+ } = require("./util/identifier");
42
46
  const makeSerializable = require("./util/makeSerializable");
43
47
  const memoize = require("./util/memoize");
44
48
 
@@ -102,7 +106,11 @@ const ABSOLUTE_PATH_REGEX = /^([a-zA-Z]:\\|\\\\|\/)/;
102
106
  */
103
107
  const contextifySourceUrl = (context, source, associatedObjectForCache) => {
104
108
  if (source.startsWith("webpack://")) return source;
105
- return `webpack://${contextify(context, source, associatedObjectForCache)}`;
109
+ return `webpack://${makePathsRelative(
110
+ context,
111
+ source,
112
+ associatedObjectForCache
113
+ )}`;
106
114
  };
107
115
 
108
116
  /**
@@ -540,15 +540,18 @@ class NormalModuleFactory extends ModuleFactory {
540
540
  for (const loader of preLoaders) allLoaders.push(loader);
541
541
  let type = settings.type;
542
542
  if (!type) {
543
- const resource =
544
- (matchResourceData && matchResourceData.resource) ||
545
- resourceData.resource;
543
+ let resource;
546
544
  let match;
547
545
  if (
548
- typeof resource === "string" &&
546
+ matchResourceData &&
547
+ typeof (resource = matchResourceData.resource) === "string" &&
549
548
  (match = /\.webpack\[([^\]]+)\]$/.exec(resource))
550
549
  ) {
551
550
  type = match[1];
551
+ matchResourceData.resource = matchResourceData.resource.slice(
552
+ 0,
553
+ -type.length - 10
554
+ );
552
555
  } else {
553
556
  type = "javascript/auto";
554
557
  }
@@ -44,6 +44,7 @@ class RuntimeModule extends Module {
44
44
  /** @type {ChunkGraph} */
45
45
  this.chunkGraph = undefined;
46
46
  this.fullHash = false;
47
+ this.dependentHash = false;
47
48
  /** @type {string} */
48
49
  this._cachedGeneratedCode = undefined;
49
50
  }
@@ -107,7 +108,7 @@ class RuntimeModule extends Module {
107
108
  hash.update(this.name);
108
109
  hash.update(`${this.stage}`);
109
110
  try {
110
- if (this.fullHash) {
111
+ if (this.fullHash || this.dependentHash) {
111
112
  // Do not use getGeneratedCode here, because i. e. compilation hash might be not
112
113
  // ready at this point. We will cache it later instead.
113
114
  hash.update(this.generate());
@@ -14,7 +14,7 @@ const SourceMapDevToolModuleOptionsPlugin = require("./SourceMapDevToolModuleOpt
14
14
  const createSchemaValidation = require("./util/create-schema-validation");
15
15
  const createHash = require("./util/createHash");
16
16
  const { relative, dirname } = require("./util/fs");
17
- const { absolutify } = require("./util/identifier");
17
+ const { makePathsAbsolute } = require("./util/identifier");
18
18
 
19
19
  /** @typedef {import("webpack-sources").MapOptions} MapOptions */
20
20
  /** @typedef {import("webpack-sources").Source} Source */
@@ -91,7 +91,7 @@ const getTaskForFile = (
91
91
  if (!sourceMap || typeof source !== "string") return;
92
92
  const context = compilation.options.context;
93
93
  const root = compilation.compiler.root;
94
- const cachedAbsolutify = absolutify.bindContextCache(context, root);
94
+ const cachedAbsolutify = makePathsAbsolute.bindContextCache(context, root);
95
95
  const modules = sourceMap.sources.map(source => {
96
96
  if (!source.startsWith("webpack://")) return source;
97
97
  source = cachedAbsolutify(source.slice(10));
package/lib/Watching.js CHANGED
@@ -419,26 +419,24 @@ class Watching {
419
419
  this.compiler.fileTimestamps = undefined;
420
420
  this.compiler.contextTimestamps = undefined;
421
421
  this.compiler.fsStartTime = undefined;
422
- const shutdown = () => {
423
- this.compiler.cache.shutdown(err => {
424
- this.compiler.hooks.watchClose.call();
425
- const closeCallbacks = this._closeCallbacks;
426
- this._closeCallbacks = undefined;
427
- for (const cb of closeCallbacks) cb(err);
428
- });
422
+ const shutdown = err => {
423
+ this.compiler.hooks.watchClose.call();
424
+ const closeCallbacks = this._closeCallbacks;
425
+ this._closeCallbacks = undefined;
426
+ for (const cb of closeCallbacks) cb(err);
429
427
  };
430
428
  if (compilation) {
431
429
  const logger = compilation.getLogger("webpack.Watching");
432
430
  logger.time("storeBuildDependencies");
433
431
  this.compiler.cache.storeBuildDependencies(
434
432
  compilation.buildDependencies,
435
- err => {
433
+ err2 => {
436
434
  logger.timeEnd("storeBuildDependencies");
437
- shutdown();
435
+ shutdown(err || err2);
438
436
  }
439
437
  );
440
438
  } else {
441
- shutdown();
439
+ shutdown(err);
442
440
  }
443
441
  };
444
442
 
@@ -305,9 +305,7 @@ class WebpackOptionsApply extends OptionsApply {
305
305
  new RequireJsStuffPlugin().apply(compiler);
306
306
  }
307
307
  new CommonJsPlugin().apply(compiler);
308
- new LoaderPlugin({
309
- enableExecuteModule: options.experiments.executeModule
310
- }).apply(compiler);
308
+ new LoaderPlugin({}).apply(compiler);
311
309
  if (options.node !== false) {
312
310
  const NodeStuffPlugin = require("./NodeStuffPlugin");
313
311
  new NodeStuffPlugin(options.node).apply(compiler);