You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🕵️ **Code PushUp plugin for detecting changes in file size using different compressions** 📋
4
+
5
+
---
6
+
7
+
The plugin crawls the file base depending on your configuration and reports about their file size.
8
+
9
+
You can configure the plugin with the following options:
10
+
11
+
- directory to crawl
12
+
- file name pattern
13
+
- budget as number in bytes
14
+
15
+
## Getting started
16
+
17
+
1. If you haven't already, install [@code-pushup/cli](../cli/README.md) and create a configuration file.
18
+
19
+
2. Copy the [plugin source](../file-size) as is into your project
20
+
21
+
3. Add this plugin to the `plugins` array in your Code PushUp CLI config file (e.g. `code-pushup.config.js`).
22
+
23
+
Pass in the path on the directory to crawl (relative to `process.cwd()`), as well as patterns and a budget.
24
+
25
+
```js
26
+
importfileSizePluginfrom'./file-size.plugin';
27
+
28
+
exportdefault {
29
+
// ...
30
+
plugins: [
31
+
// ...
32
+
fileSizePlugin({
33
+
directory:'dist',
34
+
patterns:/.js$/,
35
+
budget:42000,
36
+
}),
37
+
],
38
+
};
39
+
```
40
+
41
+
4. (Optional) Reference audits (or groups) that you wish to include in custom categories (use `npx code-pushup print-config` to list audits and groups).
42
+
43
+
Assign weights based on what influence each audit and group should have on the overall category score (assign weight 0 to only include it for extra info, without influencing the category score).
0 commit comments