You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/api/stats.mdx
+35-5Lines changed: 35 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,16 @@ contributors:
9
9
- superburrito
10
10
- chenxsan
11
11
- rahul3v
12
+
- snitin315
12
13
---
13
14
14
15
When compiling source code with webpack, users can generate a JSON file containing statistics about modules. These statistics can be used to analyze an application's dependency graph as well as to optimize compilation speed. The file is typically generated with the following CLI command:
The `--json > compilation-stats.json` flag indicates to webpack that it should emit the `compilation-stats.json` containing the dependency graph and various other build information. Typically, the `--profile` flag is also added so that a `profile` section is added to each [`modules` object](#module-objects) containing module-specific compilation stats.
21
+
The `--json=compilation-stats.json` flag indicates to webpack that it should emit the `compilation-stats.json` containing the dependency graph and various other build information. Typically, the `--profile` flag is also added so that a `profile` section is added to each [`modules` object](#module-objects) containing module-specific compilation stats.
21
22
22
23
23
24
## Structure
@@ -26,10 +27,10 @@ The top-level structure of the output JSON file is fairly straightforward but th
26
27
27
28
```js-with-links
28
29
{
29
-
'version': '5.0.0-alpha.6', // Version of webpack used for the compilation
30
+
'version': '5.9.0', // Version of webpack used for the compilation
30
31
'hash': '11593e3b3ac85436984a', // Compilation specific hash
31
32
'time': 2469, // Compilation time in milliseconds
32
-
'filteredModules': 0, // A count of excluded modules when [`exclude`](/configuration/stats/#statsexclude) is passed to the [`toJson`](/api/node/#statstojsonoptions) method
33
+
'publicPath': 'auto',
33
34
'outputPath': '/', // path to webpack output directory
34
35
'assetsByChunkName': {
35
36
// Chunk name to emitted asset(s) mapping
@@ -53,12 +54,17 @@ The top-level structure of the output JSON file is fairly straightforward but th
53
54
'modules': [
54
55
// A list of [module objects](#module-objects)
55
56
],
57
+
'entryPoints': {
58
+
// A list of [entry objects](#entry-objects)
59
+
},
56
60
'errors': [
57
61
// A list of [error objects](#errors-and-warnings)
58
62
],
63
+
'errorsCount': 0, // number of errors
59
64
'warnings': [
60
65
// A list of [warning objects](#errors-and-warnings)
61
-
]
66
+
],
67
+
'warningsCount': 0, // nummber of warnings
62
68
}
63
69
```
64
70
@@ -187,6 +193,30 @@ Every module also contains a list of `reasons` objects describing why that modul
0 commit comments