1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | const path = require("path");
|
11 | function getEmittedFiles(compilation) {
|
12 | const files = [];
|
13 |
|
14 | for (const chunk of compilation.chunks) {
|
15 | for (const file of chunk.files) {
|
16 | files.push({
|
17 |
|
18 |
|
19 | id: chunk.id.toString(),
|
20 | name: chunk.name,
|
21 | file,
|
22 | extension: path.extname(file),
|
23 | initial: chunk.isOnlyInitial(),
|
24 | });
|
25 | }
|
26 | }
|
27 |
|
28 | for (const file of Object.keys(compilation.assets)) {
|
29 | files.push({ file, extension: path.extname(file), initial: false, asset: true });
|
30 | }
|
31 |
|
32 | return files.filter(({ file, name }, index) => files.findIndex(f => f.file === file && (!name || name === f.name)) === index);
|
33 | }
|
34 | exports.getEmittedFiles = getEmittedFiles;
|