Skip to content

Commit 39d7dd0

Browse files
authored
docs: fix typos and improve clarity in README.md (#632)
1 parent b67eaa6 commit 39d7dd0

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

README.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ This plugin uses [terser](https://github.com/terser/terser) to minify/minimize y
1717

1818
## Getting Started
1919

20-
Webpack v5 comes with the latest `terser-webpack-plugin` out of the box. If you are using Webpack v5 or above and wish to customize the options, you will still need to install `terser-webpack-plugin`. Using Webpack v4, you have to install `terser-webpack-plugin` v4.
20+
Webpack v5 comes with the latest `terser-webpack-plugin` out of the box.
21+
If you are using Webpack v5 or above and wish to customize the options, you will still need to install `terser-webpack-plugin`.
22+
Using Webpack v4, you have to install `terser-webpack-plugin` v4.
2123

2224
To begin, you'll need to install `terser-webpack-plugin`:
2325

@@ -37,7 +39,7 @@ or
3739
pnpm add -D terser-webpack-plugin
3840
```
3941

40-
Then add the plugin to your `webpack` config. For example:
42+
Then add the plugin to your `webpack` configuration. For example:
4143

4244
**webpack.config.js**
4345

@@ -52,7 +54,7 @@ module.exports = {
5254
};
5355
```
5456

55-
And run `webpack` via your preferred method.
57+
Finally, run `webpack` using the method you normally use (e.g., via CLI or an npm script).
5658

5759
## Note about source maps
5860

@@ -61,7 +63,7 @@ And run `webpack` via your preferred method.
6163
Why?
6264

6365
- `eval` wraps modules in `eval("string")` and the minimizer does not handle strings.
64-
- `cheap` has not column information and minimizer generate only a single line, which leave only a single mapping.
66+
- `cheap` has no column information and the minimizer generates only a single line, which leaves only a single mapping.
6567

6668
Using supported `devtool` values enable source map generation.
6769

@@ -167,6 +169,7 @@ type parallel = boolean | number;
167169
Default: `true`
168170

169171
Use multi-process parallel running to improve the build speed.
172+
170173
Default number of concurrent runs: `os.cpus().length - 1` or `os.availableParallelism() - 1` (if this function is supported).
171174

172175
> **Note**
@@ -175,7 +178,7 @@ Default number of concurrent runs: `os.cpus().length - 1` or `os.availableParall
175178
176179
> **Warning**
177180
>
178-
> If you use **Circle CI** or any other environment that doesn't provide real available count of CPUs then you need to setup explicitly number of CPUs to avoid `Error: Call retries were exceeded` (see [#143](https://github.com/webpack-contrib/terser-webpack-plugin/issues/143), [#202](https://github.com/webpack-contrib/terser-webpack-plugin/issues/202)).
181+
> If you use **Circle CI** or any other environment that doesn't provide the real available count of CPUs then you need to explicitly set up the number of CPUs to avoid `Error: Call retries were exceeded` (see [#143](https://github.com/webpack-contrib/terser-webpack-plugin/issues/143), [#202](https://github.com/webpack-contrib/terser-webpack-plugin/issues/202)).
179182
180183
#### `boolean`
181184

@@ -280,7 +283,7 @@ type minify = (
280283

281284
Default: `TerserPlugin.terserMinify`
282285

283-
Allows you to override default minify function.
286+
Allows you to override the default minify function.
284287
By default plugin uses [terser](https://github.com/terser/terser) package.
285288
Useful for using and testing unpublished versions or forks.
286289

@@ -444,9 +447,12 @@ type extractComments =
444447
Default: `true`
445448

446449
Whether comments shall be extracted to a separate file, (see [details](https://github.com/webpack/webpack/commit/71933e979e51c533b432658d5e37917f9e71595a)).
447-
By default extract only comments using `/^\**!|@preserve|@license|@cc_on/i` regexp condition and remove remaining comments.
450+
451+
By default, extract only comments using `/^\**!|@preserve|@license|@cc_on/i` RegExp condition and remove remaining comments.
452+
448453
If the original file is named `foo.js`, then the comments will be stored to `foo.js.LICENSE.txt`.
449-
The `terserOptions.format.comments` option specifies whether the comment will be preserved, i.e. it is possible to preserve some comments (e.g. annotations) while extracting others or even preserving comments that have been extracted.
454+
455+
The `terserOptions.format.comments` option specifies whether the comment will be preserved - i.e., it is possible to preserve some comments (e.g. annotations) while extracting others, or even preserve comments that have already been extracted.
450456

451457
#### `boolean`
452458

@@ -469,7 +475,7 @@ module.exports = {
469475

470476
#### `string`
471477

472-
Extract `all` or `some` (use `/^\**!|@preserve|@license|@cc_on/i` RegExp) comments.
478+
Extract `all` or `some` (use the `/^\**!|@preserve|@license|@cc_on/i` RegExp) comments.
473479

474480
**webpack.config.js**
475481

@@ -488,7 +494,7 @@ module.exports = {
488494

489495
#### `RegExp`
490496

491-
All comments that match the given expression will be extracted to the separate file.
497+
All comments that match the given expression will be extracted to a separate file.
492498

493499
**webpack.config.js**
494500

@@ -507,7 +513,7 @@ module.exports = {
507513

508514
#### `function`
509515

510-
All comments that match the given expression will be extracted to the separate file.
516+
All comments that match the given expression will be extracted to a separate file.
511517

512518
**webpack.config.js**
513519

@@ -532,7 +538,7 @@ module.exports = {
532538

533539
#### `object`
534540

535-
Allow to customize condition for extract comments, specify extracted file name and banner.
541+
Allows you to customize condition for extracting comments, and specify the extracted file name and banner.
536542

537543
**webpack.config.js**
538544

@@ -581,7 +587,7 @@ type condition =
581587
| undefined;
582588
```
583589

584-
Condition what comments you need extract.
590+
The condition that determines which comments should be extracted.
585591

586592
**webpack.config.js**
587593

@@ -620,11 +626,12 @@ Default: `[file].LICENSE.txt[query]`
620626
Available placeholders: `[file]`, `[query]` and `[filebase]` (`[base]` for webpack 5).
621627

622628
The file where the extracted comments will be stored.
629+
623630
Default is to append the suffix `.LICENSE.txt` to the original filename.
624631

625632
> **Warning**
626633
>
627-
> We highly recommend using the `txt` extension. Using `js`/`cjs`/`mjs` extensions may conflict with existing assets which leads to broken code.
634+
> We highly recommend using the `.txt` extension. Using `.js`/`.cjs`/`.mjs` extensions may conflict with existing assets, which leads to broken code.
628635
629636
**webpack.config.js**
630637

@@ -657,9 +664,11 @@ type banner = string | boolean | ((commentsFile: string) => string) | undefined;
657664

658665
Default: `/*! For license information please see ${commentsFile} */`
659666

660-
The banner text that points to the extracted file and will be added on top of the original file.
661-
Can be `false` (no banner), a `String`, or a `Function<(string) -> String>` that will be called with the filename where extracted comments have been stored.
662-
Will be wrapped into comment.
667+
The banner text that points to the extracted file and will be added at the top of the original file.
668+
669+
It can be `false` (no banner), a `String`, or a `function<(string) -> String>` that will be called with the filename where the extracted comments have been stored.
670+
671+
The banner will be wrapped in a comment.
663672

664673
**webpack.config.js**
665674

@@ -713,7 +722,7 @@ module.exports = {
713722

714723
### Remove Comments
715724

716-
If you avoid building with comments, use this config:
725+
If you want to build without comments, use this config:
717726

718727
**webpack.config.js**
719728

@@ -759,11 +768,11 @@ module.exports = {
759768

760769
### [`swc`](https://github.com/swc-project/swc)
761770

762-
[`swc`](https://github.com/swc-project/swc) is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript.
771+
[`swc`](https://github.com/swc-project/swc) is a super-fast compiler written in `Rust`, producing widely supported JavaScript from modern standards and TypeScript.
763772

764773
> **Warning**
765774
>
766-
> the `extractComments` option is not supported and all comments will be removed by default, it will be fixed in future
775+
> The `extractComments` option is not supported, and all comments will be removed by default. This will be fixed in future
767776
768777
**webpack.config.js**
769778

@@ -789,7 +798,7 @@ module.exports = {
789798

790799
> **Warning**
791800
>
792-
> the `extractComments` option is not supported and all legal comments (i.e. copyright, licenses and etc) will be preserved
801+
> The `extractComments` option is not supported, and all legal comments (i.e. copyright, licenses and etc) will be preserved.
793802
794803
**webpack.config.js**
795804

@@ -818,7 +827,7 @@ module.exports = {
818827

819828
### Custom Minify Function
820829

821-
Override default minify function - use `uglify-js` for minification.
830+
Override the default minify function - use `uglify-js` for minification.
822831

823832
**webpack.config.js**
824833

@@ -850,7 +859,7 @@ module.exports = {
850859

851860
### Typescript
852861

853-
With default terser minify function:
862+
With default Terser minify function:
854863

855864
```ts
856865
module.exports = {
@@ -912,7 +921,8 @@ module.exports = {
912921

913922
## Contributing
914923

915-
Please take a moment to read our contributing guidelines if you haven't yet done so.
924+
We welcome all contributions!
925+
If you're new here, please take a moment to review our contributing guidelines before submitting issues or pull requests.
916926

917927
[CONTRIBUTING](./.github/CONTRIBUTING.md)
918928

0 commit comments

Comments
 (0)