@angular-devkit/build-webpack 0.1300.4 → 0.1301.0-next.3

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.1300.4",
3
+ "version": "0.1301.0-next.3",
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.1300.4",
10
+ "@angular-devkit/architect": "0.1301.0-next.3",
11
11
  "rxjs": "6.6.7"
12
12
  },
13
13
  "peerDependencies": {
package/src/utils.d.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import * as webpack from 'webpack';
9
8
  export interface EmittedFiles {
10
9
  id?: string;
11
10
  name?: string;
@@ -14,4 +13,4 @@ export interface EmittedFiles {
14
13
  asset?: boolean;
15
14
  extension: string;
16
15
  }
17
- export declare function getEmittedFiles(compilation: webpack.Compilation): EmittedFiles[];
16
+ export declare function getEmittedFiles(compilation: import('webpack').Compilation): EmittedFiles[];
package/src/utils.js CHANGED
@@ -29,14 +29,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.getEmittedFiles = void 0;
30
30
  const path = __importStar(require("path"));
31
31
  function getEmittedFiles(compilation) {
32
+ var _a;
32
33
  const files = [];
34
+ const chunkFileNames = new Set();
33
35
  // adds all chunks to the list of emitted files such as lazy loaded modules
34
36
  for (const chunk of compilation.chunks) {
35
37
  for (const file of chunk.files) {
38
+ if (chunkFileNames.has(file)) {
39
+ continue;
40
+ }
41
+ chunkFileNames.add(file);
36
42
  files.push({
37
- // The id is guaranteed to exist at this point in the compilation process
38
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
39
- id: chunk.id.toString(),
43
+ id: (_a = chunk.id) === null || _a === void 0 ? void 0 : _a.toString(),
40
44
  name: chunk.name,
41
45
  file,
42
46
  extension: path.extname(file),
@@ -44,11 +48,14 @@ function getEmittedFiles(compilation) {
44
48
  });
45
49
  }
46
50
  }
47
- // other all files
51
+ // add all other files
48
52
  for (const file of Object.keys(compilation.assets)) {
53
+ // Chunk files have already been added to the files list above
54
+ if (chunkFileNames.has(file)) {
55
+ continue;
56
+ }
49
57
  files.push({ file, extension: path.extname(file), initial: false, asset: true });
50
58
  }
51
- // dedupe
52
- return files.filter(({ file, name }, index) => files.findIndex((f) => f.file === file && (!name || name === f.name)) === index);
59
+ return files;
53
60
  }
54
61
  exports.getEmittedFiles = getEmittedFiles;