@modus/gimbal-plugin-source-map-explorer
Version:
Adds Source Map Explorer auditing to Gimbal
79 lines (62 loc) • 4.14 kB
Markdown
# Gimbal `source-map-explorer` Plugin
[](https://www.npmjs.com/package/@modus/gimbal-plugin-source-map-explorer)
[](https://www.npmjs.com/package/@modus/gimbal-plugin-source-map-explorer)
[](https://circleci.com/gh/ModusCreateOrg/gimbal)
[](http://makeapullrequest.com)
[](./LICENSE)
[](https://moduscreate.com)
A Gimbal plugin to add [Source Map Explorer](https://github.com/danvk/source-map-explorer) auditing.
## Installation
First, you need to install the plugin to your project:
```sh
# with npm
npm install --save-dev @modus/gimbal-plugin-source-map-explorer
# or with yarn
yarn add --dev @modus/gimbal-plugin-source-map-explorer
```
Next, you need to add the plugin to your Gimbal configuration file:
### YAML
```yaml
plugins:
- '@modus/gimbal-plugin-source-map-explorer'
```
### JSON
```json
{
"plugins": ["@modus/gimbal-plugin-source-map-explorer"]
}
```
### JavaScript
```javascript
modules.exports = {
plugins: ['@modus/gimbal-plugin-source-map-explorer'],
};
```
## Configuration
By default, it will not check the sizes of the bundled files. You can check for file sizes within bundles using the `bundles` config using glob syntax for the bundle file name and the files within the bundle:
```yaml
plugins:
- plugin: '@modus/gimbal-plugin-source-map-explorer'
bundles:
- path: '**/main.*.js'
thresholds:
App.js: 450 B
index.js: 100 B
logo.svg: 250 B
serviceWorker.js: 300 B
<unmapped>: 150 B
- path: '**/2.*.js'
thresholds:
react/index.js: 50 B
object-assign/index.js: 1 KB
react-dom/index.js: 300 B
react/cjs/react.production.min.js: 7 KB
react-dom/cjs/react-dom.production.min.js: 110 KB
scheduler/index.js: 50 B
scheduler/cjs/scheduler.production.min.js: 5 KB
webpack/**/*.js: 150 B
<unmapped>: 150 B
- '!precache-manifest*'
- '!service-worker.js'
- '!**/runtime*.js'
```