An open API service indexing awesome lists of open source software.

https://github.com/ehyland/better-stats-webpack-plugin

Better stats for webpack builds
https://github.com/ehyland/better-stats-webpack-plugin

webpack webpack-plugin webpack-stats

Last synced: 17 days ago
JSON representation

Better stats for webpack builds

Awesome Lists containing this project

README

          

better-stats-webpack-plugin


Usable stats output for webpack builds.

Install

```bash
npm install --save-dev better-stats-webpack-plugin
```

Usage

```js
const BetterStatsWebpackPlugin = require("better-stats-webpack-plugin");

module.exports = {
entry: {
main: 'src/app.js',
admin: 'src/admin.js'
},
output: {
filename: '[name].js',
path: path.resolve(workspace, 'dist'),
publicPath: 'https://s3.eamon.sh/my-app/'
},
module: {
rules: [...]
},
plugins: [
new BetterStatsWebpackPlugin({ statsFile: './better-stats.json' }),
]
}
```

Result

```js
{
"[entry]_js": ["[public-file-path].js"],
"[entry]_js_import": "",
"[entry]_css": ["[public-file-path].css"],
"[entry]_css_import": "",

"assets": [
"src/cat.gif": "[public-file-path].gif"
]
}
```

## Options

### `statsFile`
**Description:** Better stats output path
**Default:** $PWD/better-stats.json