@angular-devkit/build-webpack 0.1200.1 → 0.1200.5

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/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-webpack",
3
- "version": "0.1200.1",
3
+ "version": "0.1200.5",
4
4
  "description": "Webpack Builder for Architect",
5
5
  "experimental": true,
6
6
  "main": "src/index.js",
7
7
  "typings": "src/index.d.ts",
8
8
  "builders": "builders.json",
9
9
  "dependencies": {
10
- "@angular-devkit/architect": "0.1200.1",
10
+ "@angular-devkit/architect": "0.1200.5",
11
11
  "rxjs": "6.6.7"
12
12
  },
13
13
  "peerDependencies": {
@@ -26,7 +26,7 @@
26
26
  "url": "https://github.com/angular/angular-cli.git"
27
27
  },
28
28
  "engines": {
29
- "node": "^12.14.1 || ^14.0.0",
29
+ "node": "^12.14.1 || >=14.0.0",
30
30
  "npm": "^6.11.0 || ^7.5.6",
31
31
  "yarn": ">= 1.13.0"
32
32
  },
@@ -31,9 +31,6 @@ function runWebpack(config, context, options = {}) {
31
31
  }
32
32
  };
33
33
  return createWebpack({ ...config, watch: false }).pipe(operators_1.switchMap((webpackCompiler) => new rxjs_1.Observable((obs) => {
34
- var _a;
35
- // Webpack 5 has a compiler level close function
36
- const compilerClose = (_a = webpackCompiler.close) === null || _a === void 0 ? void 0 : _a.bind(webpackCompiler);
37
34
  const callback = (err, stats) => {
38
35
  if (err) {
39
36
  return obs.error(err);
@@ -43,19 +40,15 @@ function runWebpack(config, context, options = {}) {
43
40
  }
44
41
  // Log stats.
45
42
  log(stats, config);
43
+ const statsOptions = typeof config.stats === 'boolean' ? undefined : config.stats;
46
44
  obs.next({
47
45
  success: !stats.hasErrors(),
48
- webpackStats: shouldProvideStats ? stats.toJson() : undefined,
46
+ webpackStats: shouldProvideStats ? stats.toJson(statsOptions) : undefined,
49
47
  emittedFiles: utils_1.getEmittedFiles(stats.compilation),
50
48
  outputPath: stats.compilation.outputOptions.path,
51
49
  });
52
50
  if (!config.watch) {
53
- if (compilerClose) {
54
- compilerClose(() => obs.complete());
55
- }
56
- else {
57
- obs.complete();
58
- }
51
+ webpackCompiler.close(() => obs.complete());
59
52
  }
60
53
  };
61
54
  try {
@@ -65,7 +58,7 @@ function runWebpack(config, context, options = {}) {
65
58
  // Teardown logic. Close the watcher when unsubscribed from.
66
59
  return () => {
67
60
  watching.close(() => { });
68
- compilerClose === null || compilerClose === void 0 ? void 0 : compilerClose(() => { });
61
+ webpackCompiler.close(() => { });
69
62
  };
70
63
  }
71
64
  else {