Skip to content

Commit 9bde319

Browse files
authored
Merge pull request #17420 from ersachin3112/stats-detailed
docs: add example for stats detailed output
2 parents 4938e77 + aab745c commit 9bde319

5 files changed

Lines changed: 126 additions & 0 deletions

File tree

examples/stats-detailed/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
This configuration will enable the detailed output for the stats report.
2+
3+
You see that everything is working nicely together.
4+
5+
# example.js
6+
7+
```javascript
8+
console.log("Hello World!");
9+
```
10+
11+
# webpack.config.js
12+
13+
```javascript
14+
const path = require("path");
15+
16+
module.exports = {
17+
output: {
18+
path: path.join(__dirname, "dist"),
19+
filename: "output.js"
20+
},
21+
stats: "detailed"
22+
};
23+
```
24+
25+
# dist/output.js
26+
27+
```javascript
28+
/******/ (() => { // webpackBootstrap
29+
var __webpack_exports__ = {};
30+
/*!********************!*\
31+
!*** ./example.js ***!
32+
\********************/
33+
/*! unknown exports (runtime-defined) */
34+
/*! runtime requirements: */
35+
console.log("Hello World!");
36+
37+
/******/ })()
38+
;
39+
```
40+
41+
# Info
42+
43+
## Production mode
44+
45+
```
46+
PublicPath: dist/
47+
asset output.js 28 bytes {179} [emitted] [minimized] (name: main)
48+
Entrypoint main 28 bytes = output.js
49+
chunk {179} (runtime: main) output.js (main) 29 bytes [entry] [rendered]
50+
> ./example.js main
51+
./example.js [144] 29 bytes {179} [depth 0] [built] [code generated]
52+
[no exports used]
53+
Statement (ExpressionStatement) with side effects in source code at 1:0-28
54+
ModuleConcatenation bailout: Module is not an ECMAScript module
55+
56+
LOG from webpack.Compilation
57+
1 modules hashed, 0 from cache (1 variants per module in average)
58+
100% code generated (1 generated, 0 from cache)
59+
+ 24 hidden lines
60+
61+
LOG from webpack.FlagDependencyExportsPlugin
62+
0% of exports of modules have been determined (1 no declared exports, 0 not cached, 0 flagged uncacheable, 0 from cache, 0 from mem cache, 0 additional calculations due to dependencies)
63+
+ 3 hidden lines
64+
65+
LOG from webpack.buildChunkGraph
66+
2 queue items processed (1 blocks)
67+
0 chunk groups connected
68+
0 chunk groups processed for merging (0 module sets, 0 forked, 0 + 0 modules forked, 0 + 0 modules merged into fork, 0 resulting modules)
69+
0 chunk group info updated (0 already connected chunk groups reconnected)
70+
+ 5 hidden lines
71+
72+
LOG from webpack.FileSystemInfo
73+
1 new snapshots created
74+
0% root snapshot uncached (0 / 0)
75+
0% children snapshot uncached (0 / 0)
76+
0 entries tested
77+
File info in cache: 1 timestamps 1 hashes 1 timestamp hash combinations
78+
File timestamp hash combination snapshot optimization: 0% (0/1) entries shared via 0 shared snapshots (0 times referenced)
79+
Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations
80+
Managed items info in cache: 0 items
81+
82+
2023-06-23 22:57:08: webpack 5.88.0 compiled successfully (208f5e6e78a48d3e157f)
83+
```

examples/stats-detailed/build.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
global.NO_REASONS = true;
2+
global.NO_STATS_OPTIONS = true;
3+
global.STATS_COLORS = true;
4+
require("../build-common");

examples/stats-detailed/example.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello World!");
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
This configuration will enable the detailed output for the stats report.
2+
3+
You see that everything is working nicely together.
4+
5+
# example.js
6+
7+
```javascript
8+
_{{example.js}}_
9+
```
10+
11+
# webpack.config.js
12+
13+
```javascript
14+
_{{webpack.config.js}}_
15+
```
16+
17+
# dist/output.js
18+
19+
```javascript
20+
_{{dist/output.js}}_
21+
```
22+
23+
# Info
24+
25+
## Production mode
26+
27+
```
28+
_{{production:stdout}}_
29+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const path = require("path");
2+
3+
module.exports = {
4+
output: {
5+
path: path.join(__dirname, "dist"),
6+
filename: "output.js"
7+
},
8+
stats: "detailed"
9+
};

0 commit comments

Comments
 (0)