docs: add example for stats normal output

This commit is contained in:
Sachin Kumar 2023-06-27 06:29:16 +05:30
parent 1e18b1d1c7
commit 9c419c24ba
5 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,49 @@
This configuration will enable the normal output for the stats report.
You see that everything is working nicely together.
# example.js
```javascript
console.log("Hello World!");
```
# webpack.config.js
```javascript
const path = require("path");
module.exports = {
output: {
path: path.join(__dirname, "dist"),
filename: "output.js"
},
stats: "normal"
};
```
# dist/output.js
```javascript
/******/ (() => { // webpackBootstrap
var __webpack_exports__ = {};
/*!********************!*\
!*** ./example.js ***!
\********************/
/*! unknown exports (runtime-defined) */
/*! runtime requirements: */
console.log("Hello World!");
/******/ })()
;
```
# Info
## Production mode
```
asset output.js 28 bytes [emitted] [minimized] (name: main)
./example.js 29 bytes [built] [code generated]
webpack 5.88.0 compiled successfully
```

View File

@ -0,0 +1,4 @@
global.NO_REASONS = true;
global.NO_STATS_OPTIONS = true;
global.STATS_COLORS = true;
require("../build-common");

View File

@ -0,0 +1 @@
console.log("Hello World!");

View File

@ -0,0 +1,29 @@
This configuration will enable the normal output for the stats report.
You see that everything is working nicely together.
# example.js
```javascript
_{{example.js}}_
```
# webpack.config.js
```javascript
_{{webpack.config.js}}_
```
# dist/output.js
```javascript
_{{dist/output.js}}_
```
# Info
## Production mode
```
_{{production:stdout}}_
```

View File

@ -0,0 +1,9 @@
const path = require("path");
module.exports = {
output: {
path: path.join(__dirname, "dist"),
filename: "output.js"
},
stats: "normal"
};