webpack 4.36.0 → 4.39.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.
@@ -47,12 +47,18 @@ const getReplacer = (value, allowEmpty) => {
47
47
  }
48
48
  return "";
49
49
  } else {
50
- return `${value}`;
50
+ return `${escapePathVariables(value)}`;
51
51
  }
52
52
  };
53
53
  return fn;
54
54
  };
55
55
 
56
+ const escapePathVariables = value => {
57
+ return typeof value === "string"
58
+ ? value.replace(/\[(\\*[\w:]+\\*)\]/gi, "[\\$1\\]")
59
+ : value;
60
+ };
61
+
56
62
  const replacePathVariables = (path, data) => {
57
63
  const chunk = data.chunk;
58
64
  const chunkId = chunk && chunk.id;
@@ -114,6 +120,7 @@ const replacePathVariables = (path, data) => {
114
120
  .replace(REGEXP_QUERY, getReplacer(data.query, true))
115
121
  // only available in sourceMappingURLComment
116
122
  .replace(REGEXP_URL, getReplacer(data.url))
123
+ .replace(/\[\\(\\*[\w:]+\\*)\\\]/gi, "[$1]")
117
124
  );
118
125
  };
119
126
 
@@ -196,7 +196,12 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
196
196
  );
197
197
 
198
198
  this.set("optimization", "call", value => Object.assign({}, value));
199
- this.set("optimization.removeAvailableModules", true);
199
+ // TODO webpack 5: Disable by default in a modes
200
+ this.set(
201
+ "optimization.removeAvailableModules",
202
+ "make",
203
+ options => options.mode !== "development"
204
+ );
200
205
  this.set("optimization.removeEmptyChunks", true);
201
206
  this.set("optimization.mergeDuplicateChunks", true);
202
207
  this.set("optimization.flagIncludedChunks", "make", options =>
@@ -363,6 +368,12 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
363
368
  options.resolveLoader.plugins.length > 0
364
369
  );
365
370
  });
371
+
372
+ this.set("infrastructureLogging", "call", value =>
373
+ Object.assign({}, value)
374
+ );
375
+ this.set("infrastructureLogging.level", "info");
376
+ this.set("infrastructureLogging.debug", false);
366
377
  }
367
378
  }
368
379