mirror of https://github.com/webpack/webpack.git
Merge pull request #17406 from ersachin3112/stats-minimal
docs: add example for stats minimal output
This commit is contained in:
commit
d1f1433fd8
|
|
@ -16,7 +16,8 @@ const targetArgs = global.NO_TARGET_ARGS ? "" : "--entry ./example.js --output-f
|
|||
const displayReasons = global.NO_REASONS ? "" : "--stats-reasons --stats-used-exports --stats-provided-exports";
|
||||
const statsArgs = global.NO_STATS_OPTIONS ? "" : "--stats-chunks --stats-modules-space 99999 --stats-chunk-origins";
|
||||
const publicPathArgs = global.NO_PUBLIC_PATH ? "" : '--output-public-path "dist/"';
|
||||
const commonArgs = `--no-stats-colors ${statsArgs} ${publicPathArgs} ${extraArgs} ${targetArgs}`;
|
||||
const statsColorsArg = global.STATS_COLORS ? "" : "--no-stats-colors";
|
||||
const commonArgs = `${statsColorsArg} ${statsArgs} ${publicPathArgs} ${extraArgs} ${targetArgs}`;
|
||||
|
||||
let readme = fs.readFileSync(require("path").join(process.cwd(), "template.md"), "utf-8");
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
module.exports = "module";
|
||||
module.exports = "module";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
This configuration will enable the minimal 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: "minimal"
|
||||
};
|
||||
```
|
||||
|
||||
# dist/output.js
|
||||
|
||||
```javascript
|
||||
/******/ (() => { // webpackBootstrap
|
||||
var __webpack_exports__ = {};
|
||||
/*!********************!*\
|
||||
!*** ./example.js ***!
|
||||
\********************/
|
||||
/*! unknown exports (runtime-defined) */
|
||||
/*! runtime requirements: */
|
||||
console.log("Hello World!");
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
```
|
||||
|
||||
# Info
|
||||
|
||||
## Production mode
|
||||
|
||||
```
|
||||
1 asset
|
||||
1 module
|
||||
webpack 5.87.0 compiled successfully
|
||||
```
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
global.NO_REASONS = true;
|
||||
global.NO_STATS_OPTIONS = true;
|
||||
global.STATS_COLORS = true;
|
||||
require("../build-common");
|
||||
|
|
@ -0,0 +1 @@
|
|||
console.log("Hello World!");
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
This configuration will enable the minimal 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}}_
|
||||
```
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
output: {
|
||||
path: path.join(__dirname, "dist"),
|
||||
filename: "output.js"
|
||||
},
|
||||
stats: "minimal"
|
||||
};
|
||||
Loading…
Reference in New Issue