webpack 4.28.3 → 4.28.4

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/lib/Compiler.js CHANGED
@@ -207,6 +207,10 @@ class Compiler extends Tapable {
207
207
  const finalCallback = (err, stats) => {
208
208
  this.running = false;
209
209
 
210
+ if (err) {
211
+ this.hooks.failed.call(err);
212
+ }
213
+
210
214
  if (callback !== undefined) return callback(err, stats);
211
215
  };
212
216
 
@@ -463,7 +463,7 @@ class WebpackOptionsApply extends OptionsApply {
463
463
  if (options.optimization.minimize) {
464
464
  for (const minimizer of options.optimization.minimizer) {
465
465
  if (typeof minimizer === "function") {
466
- minimizer.apply(compiler);
466
+ minimizer.call(compiler, compiler);
467
467
  } else {
468
468
  minimizer.apply(compiler);
469
469
  }
@@ -36,8 +36,12 @@ module.exports = class AMDRequireDependenciesBlock extends AsyncDependenciesBloc
36
36
  } else {
37
37
  this.range = expr.range;
38
38
  }
39
- const dep = new AMDRequireDependency(this);
39
+ const dep = this.newRequireDependency();
40
40
  dep.loc = loc;
41
41
  this.addDependency(dep);
42
42
  }
43
+
44
+ newRequireDependency() {
45
+ return new AMDRequireDependency(this);
46
+ }
43
47
  };
@@ -13,9 +13,13 @@ module.exports = class HarmonyDetectionParserPlugin {
13
13
  const isStrictHarmony = parser.state.module.type === "javascript/esm";
14
14
  const isHarmony =
15
15
  isStrictHarmony ||
16
- ast.body.some(statement => {
17
- return /^(Import|Export).*Declaration$/.test(statement.type);
18
- });
16
+ ast.body.some(
17
+ statement =>
18
+ statement.type === "ImportDeclaration" ||
19
+ statement.type === "ExportDefaultDeclaration" ||
20
+ statement.type === "ExportNamedDeclaration" ||
21
+ statement.type === "ExportAllDeclaration"
22
+ );
19
23
  if (isHarmony) {
20
24
  const module = parser.state.module;
21
25
  const compatDep = new HarmonyCompatibilityDependency(module);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "4.28.3",
3
+ "version": "4.28.4",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
6
6
  "license": "MIT",