Statoscope CLI
This package supplies Statoscope as CLI tool
Installation
npm i @statoscope/cli -g
Usage
statoscope [command] [...args]
Commands
validate
Validate or compare webpack stats.
validate [...args]
--input
(-i
) - path to a stats.json--reference
(-r
) - path to a stats-file to compare with (optional)--config
(-c
) - path to statoscope config (by default {pwd}/statoscope.config.js
has used)--warn-as-error
(-w
) - treat warnings as errors
Example:
-
Install webpack-plugin for the validator:
npm install --save-dev @statoscope/stats-validator-plugin-webpack
-
Create a statosope-config:
statoscope.config.js
module.exports = {
validate: {
plugins: ['@statoscope/webpack'],
reporters: [
'@statoscope/console',
['@statoscope/stats-report', {open: true}],
],
rules: {
'@statoscope/webpack/build-time-limits': ['error', {global: 10000}],
}
}
}
- Exec the command:
statoscope validate --input path/to/stats.json
- Analyze results in the console or generated UI-report
Learn more on @staoscope/stats-validator and @statoscope/stats-validator-plugin-webpack and
serve
Start HTTP-server and serve JSON-stats as HTML report
serve input [...args]
--input
(-i
) - path to one or more webpack stats--host
(-h
) - server host--port
(-p
) - server port--open
(-o
) - open browser after server start
Example:
statoscope serve path/to/stats.json -o
Start server and open browser.
generate
Generate HTML report from JSON-stats.
generate input output [...args]
--input
(-i
) - path to one or more webpack stats--output
(-t
) - path to generated HTML--open
(-o
) - open browser after generate
Example:
statoscope generate path/to/stats.json path/to/report.html -o
Create statoscope report, save it to path/to/report.html
and open
Support
If you are an engineer or a company that is interested in Statoscope improvements, you may support Statoscope by
financial contribution at OpenCollective.