Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/vigneshshanmugam/perf-hints-plugin

Provide performance hints in webpack output
https://github.com/vigneshshanmugam/perf-hints-plugin

perf-hints performance webpack-plugin

Last synced: 30 days ago
JSON representation

Provide performance hints in webpack output

Awesome Lists containing this project

README

        

# perf-hints-plugin

DEPRECATED ❌❌ - Please use the [webpack performance feature](https://webpack.js.org/configuration/performance/)

Webpack plugin that provides hints for Performance.

Attempt at providing warnings and errors while bundling JS/CSS in Webpack. Inspired from this [RFC](https://github.com/webpack/webpack/issues/3216).

### Features

+ Monolithic bundle size warnings.
![monolith](https://github.com/vigneshshanmugam/perf-hints-plugin/blob/master/images/monolith.png)

+ Code splitted bundles exceed given max size.
![code-split](https://github.com/vigneshshanmugam/perf-hints-plugin/blob/master/images/code-split.png)

## Install

```sh
npm i --save-dev perf-hints-plugin
```

```sh
yarn add -D perf-hints-plugin
```

## Usage

```js
// webpack.config.js
const PerfHintsPlugin = require("perf-hints-plugin");
module.exports = {
entry: //...,
output: //...,
plugins: [
new PerfHintsPlugin({
hints: true,
maxBundleSize: 200 // kB
})
]
}
```

### Options

+ `hints` - Flag to Enable/Disable hints in the console. Default is `false`
+ `maxBundleSize` - for setting the performance budget. Expressed in kiloBytes. Default value is `250kB`