https://github.com/moduscreateorg/webpack-gimbal-plugin
Webpack plugin that utilizes Gimbal to maintain performance budgets
https://github.com/moduscreateorg/webpack-gimbal-plugin
Last synced: about 2 months ago
JSON representation
Webpack plugin that utilizes Gimbal to maintain performance budgets
- Host: GitHub
- URL: https://github.com/moduscreateorg/webpack-gimbal-plugin
- Owner: ModusCreateOrg
- License: mit
- Created: 2019-05-10T12:55:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T23:44:32.000Z (over 2 years ago)
- Last Synced: 2024-04-28T06:53:53.423Z (over 1 year ago)
- Language: JavaScript
- Size: 308 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](http://makeapullrequest.com)
[](./LICENSE)
[](https://moduscreate.com)
# Webpack Gimbal Plugin
[Gimbal](https://github.com/ModusCreateOrg/gimbal) integration for Webpack. Uses the same [configuration](https://github.com/ModusCreateOrg/gimbal/#configuration) as Gimbal to simplify performance budgeting in production builds.
## Getting Started
You can install Gimbal globally using `npm` or `yarn`:
```sh
# with npm
npm install webpack-gimbal-plugin
# or with yarn
yarn add webpack-gimbal-plugin
```
Add it to your Webpack configuration as you would with any other plugin:
```js
var GimbalPlugin = require('webpack-gimbal-plugin');
{
plugins: [new GimbalPlugin()];
}
```
## Configuration
Gimbal emits a warning or an error to a webpack compilation. It defaults to a warning for each failed audit. You can change that to an error by setting `bail: true` in GimbalPlugin configuration.
```js
{
plugins: [
// Emit errors for failed audits
new GimbalPlugin({ bail: true }),
];
}
```
Note: webpack config also uses `bail` configuration to break execution on errors. GimbalPlugin uses the same verbiage, but it will not bubble up to Webpack's config. It's entirely isolated to this usecase.
### Gimbal Configuration Example
You can use [Gimbal configuration](https://github.com/ModusCreateOrg/gimbal/#configuration) in `.gimbalrc.yml` like the following:
```yaml
configs:
heap-snapshot:
threshold:
Documents: 5
Frames: 2
JSHeapTotalSize: 23356000
JSHeapUsedSize: 15068000
Nodes: 800
RecalcStyleCount: 9
lighthouse:
threshold:
accessibility: 93
'best-practices': 90
performance: 50
pwa: 75
seo: 100
size:
- path: ./build/precache-*.js
maxSize: 500 B
- path: ./build/static/js/*.chunk.js
maxSize: 1 MB
- path: ./build/static/js/runtime*.js
maxSize: 10 KB
- path: ./build/
maxSize: 18 MB
```
## Questions and Support
If you have a problem running Gimbal, [please submit an issue](./issues). The more information you give us the faster we can get back with a good answer.
## Modus Create
[Modus Create](https://moduscreate.com) is a digital product consultancy. We use a distributed team of the best talent in the world to offer a full suite of digital product design-build services; ranging from consumer facing apps, to digital migration, to agile development training, and business transformation.
[](https://moduscreate.com)
This project is part of [Modus Labs](https://labs.moduscreate.com).
[](https://labs.moduscreate.com)
## Licensing
This project is [MIT licensed](./LICENSE).