Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 09781c8

Browse files
authored
docs: fix typos and improve clarity in README.md (#169)
* docs: fix typos and improve clarity in README.md * docs: fixed typo
1 parent 6b0412f commit 09781c8

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

README.md

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313

1414
# val-loader
1515

16-
A webpack loader which executes a given module, and returns the result of the
17-
execution at build-time, when the module is required in the bundle. In this way,
18-
the loader changes a module from code to a result.
16+
A webpack loader that executes a given module and returns the result of the execution at build-time, when the module is required in the bundle. In this way, the loader changes a module from code into a result.
1917

20-
Another way to view `val-loader`, is that it allows a user a way to make their
21-
own custom loader logic, without having to write a custom loader.
18+
Another way to view `val-loader` is that it allows users to implement custom loader logic without needing to write a full custom loader.
2219

2320
The target module is called with two arguments: `(options, loaderContext)`
2421

@@ -41,7 +38,7 @@ yarn add -D val-loader
4138
pnpm add -D val-loader
4239
```
4340

44-
Then add the loader to your `webpack` config. For example:
41+
Then, add the loader to your `webpack` configuration. For example:
4542

4643
**target-file.js**
4744

@@ -76,7 +73,7 @@ module.exports = {
7673
const answer = require("target-file");
7774
```
7875

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

8178
## Options
8279

@@ -92,7 +89,7 @@ type executableFile = string;
9289

9390
Default: `undefined`
9491

95-
Allows to specify path to the executable file
92+
Allows to specify path to the executable file.
9693

9794
**data.json**
9895

@@ -148,9 +145,7 @@ module.exports = {
148145

149146
## Return Object Properties
150147

151-
Targeted modules of this loader must export a `Function` that returns an object,
152-
or a `Promise` resolving an object (e.g. async function), containing a `code` property at a minimum, but can
153-
contain any number of additional properties.
148+
Targeted modules of this loader must export a `function` that returns an object, or a `Promise` resolving to an object (e.g. async function), containing a `code` property at a minimum, but can also include additional properties.
154149

155150
### `code`
156151

@@ -163,7 +158,7 @@ type code = string | Buffer;
163158
Default: `undefined`
164159
_Required_
165160

166-
Code passed along to webpack or the next loader that will replace the module.
161+
Code passed along to webpack or the next loader that will replace the original module.
167162

168163
### `sourceMap`
169164

@@ -187,9 +182,7 @@ type ast = Array<object>;
187182

188183
Default: `undefined`
189184

190-
An [Abstract Syntax Tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree)
191-
that will be passed to the next loader. Useful to speed up the build time if the
192-
next loader uses the same AST.
185+
An [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) that will be passed to the next loader. Useful to speed up the build time if the next loader uses the same AST.
193186

194187
### `dependencies`
195188

@@ -243,17 +236,14 @@ type cacheable = boolean;
243236

244237
Default: `false`
245238

246-
If `true`, specifies that the code can be re-used in watch mode if none of the
247-
`dependencies` have changed.
239+
If `true`, specifies that the code can be reused in watch mode if none of the `dependencies` have changed.
248240

249241
## Examples
250242

251243
### Simple
252244

253-
In this example the loader is configured to operator on a file name of
254-
`years-in-ms.js`, execute the code, and store the result in the bundle as the
255-
result of the execution. This example passes `years` as an `option`, which
256-
corresponds to the `years` parameter in the target module exported function:
245+
In this example the loader is configured to operate on a file name of `years-in-ms.js`, execute the code, and store the result in the bundle as the result of the execution.
246+
This example passes `years` as an `option`, which corresponds to the `years` parameter in the target module's exported function:
257247

258248
**years-in-ms.js**
259249

@@ -446,7 +436,8 @@ module.exports = {
446436

447437
## Contributing
448438

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

451442
[CONTRIBUTING](./.github/CONTRIBUTING.md)
452443

0 commit comments

Comments
 (0)