Skip to content

Commit 980f857

Browse files
committed
Simplify docs
1 parent c7f0c11 commit 980f857

File tree

1 file changed

+10
-33
lines changed

1 file changed

+10
-33
lines changed

README.md

+10-33
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ if the cost exceeds the limit.
1717
and understandable metric compared to the size in bytes.
1818
* Calculations include **all dependencies and polyfills**
1919
used in your JS.
20-
* **Flexible usage**: Install as a dev dependency with full configuration
21-
or use with npx for quick checks (requires plugin installation).
2220

2321
<p align="center">
2422
<img src="./img/example.png" alt="Size Limit CLI" width="738">
@@ -95,34 +93,6 @@ We are using [Statoscope] for this analysis.
9593

9694
## Usage
9795

98-
### Quick Start with npx
99-
100-
Size Limit can be used with npx for quick size checks, but requires the appropriate plugin to be installed first due to its plugin architecture:
101-
102-
1. Install the required plugin as a **dev dependency** (choose based on your needs):
103-
104-
```sh
105-
npm install --save-dev @size-limit/file # For simple file size checks
106-
# Or for other cases:
107-
# npm install --save-dev @size-limit/webpack # For webpack projects
108-
# npm install --save-dev @size-limit/esbuild # For faster checks
109-
```
110-
111-
2. Run size-limit with **npx**:
112-
113-
```sh
114-
npx size-limit --limit "10 kB" dist/bundle.js
115-
```
116-
117-
3. Run size-limit with **global** installation instead of npx:
118-
119-
```sh
120-
npm install --global @size-limit/cli
121-
size-limit --limit "10 kB" dist/bundle.js
122-
```
123-
124-
Note: This approach works best for quick checks. For long-term project maintenance and CI integration, we recommend the full installation methods described below.
125-
12696
### JS Applications
12797

12898
Suitable for applications that have their own bundler and send the JS bundle
@@ -258,7 +228,7 @@ to track the time a browser takes to compile and execute your JS.
258228
```
259229
260230
6. If you don’t have a continuous integration service running, don’t forget
261-
to add one — start with Github Actions.
231+
to add one — start with GitHub Actions.
262232
263233
</details>
264234
@@ -342,7 +312,7 @@ the size in bytes. Libraries like [React] are good examples for this preset.
342312
```
343313
344314
7. If you don’t have a continuous integration service running, don’t forget
345-
to add one — start with Github Actions.
315+
to add one — start with GitHub Actions.
346316
8. Add the library size to docs, it will help users to choose your project:
347317
348318
```diff
@@ -429,7 +399,7 @@ for this preset.
429399
```
430400
431401
7. If you don’t have a continuous integration service running, don’t forget
432-
to add one — start with Github Actions.
402+
to add one — start with GitHub Actions.
433403
8. Add the library size to docs, it will help users to choose your project:
434404
435405
```diff
@@ -614,6 +584,13 @@ If you use Size Limit to track the size of CSS files, make sure to set
614584
`webpack: false`. Otherwise, you will get wrong numbers, because webpack
615585
inserts `style-loader` runtime (≈2 kB) into the bundle.
616586
587+
Also, you avoid having a config and pass the limit to CLI:
588+
589+
```sh
590+
npm install --save-dev @size-limit/file
591+
npx size-limit --limit "10 kB" dist/bundle.js
592+
```
593+
617594
[Statoscope docs]: https://github.com/statoscope/statoscope/tree/master/packages/webpack-plugin#optionsreports-report
618595
[pattern]: https://github.com/SuperchupuDev/tinyglobby
619596

0 commit comments

Comments
 (0)