webpack 4.36.1 → 4.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.
- package/declarations/WebpackOptions.d.ts +35 -10
- package/lib/Chunk.js +5 -1
- package/lib/ChunkGroup.js +1 -1
- package/lib/Compilation.js +83 -477
- package/lib/Compiler.js +42 -2
- package/lib/MultiCompiler.js +8 -1
- package/lib/NormalModule.js +15 -4
- package/lib/ProgressPlugin.js +21 -63
- package/lib/ResolverFactory.js +6 -10
- package/lib/SourceMapDevToolPlugin.js +25 -17
- package/lib/Stats.js +227 -3
- package/lib/SystemMainTemplatePlugin.js +5 -1
- package/lib/TemplatedPathPlugin.js +8 -1
- package/lib/WebpackOptionsDefaulter.js +12 -1
- package/lib/buildChunkGraph.js +689 -0
- package/lib/logging/Logger.js +131 -0
- package/lib/logging/createConsoleLogger.js +209 -0
- package/lib/logging/runtime.js +36 -0
- package/lib/logging/truncateArgs.js +76 -0
- package/lib/node/NodeEnvironmentPlugin.js +16 -0
- package/lib/node/nodeConsole.js +135 -0
- package/lib/web/JsonpMainTemplatePlugin.js +1 -1
- package/lib/webpack.js +3 -1
- package/package.json +18 -20
- package/schemas/WebpackOptions.json +53 -1
@@ -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
|
-
|
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
|
|