Skip to content

Commit 408fb52

Browse files
committed
docs: fix typos and improve clarity in README.md
1 parent cf6e8c2 commit 408fb52

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

README.md

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

1414
# expose-loader
1515

16-
The `expose-loader` loader allows to expose a module (in whole or in part) to global object (`self`, `window` and `global`).
16+
The `expose-loader` loader allows to expose a module (either in whole or in part) to global object (`self`, `window` and `global`).
1717

18-
For further hints on compatibility issues, check out [Shimming](https://webpack.js.org/guides/shimming/) of the official docs.
18+
For compatibility tips and examples, check out [Shimming](https://webpack.js.org/guides/shimming/) guide in the official documentation.
1919

2020
## Getting Started
2121

@@ -37,7 +37,7 @@ or
3737
pnpm add -D expose-loader
3838
```
3939

40-
(If you're using WebPack 4, install `expose-loader@1` and follow the [corresponding instructions](https://v4.webpack.js.org/loaders/expose-loader/) instead.)
40+
(If you're using webpack 4, install `expose-loader@1` and follow the [corresponding instructions](https://v4.webpack.js.org/loaders/expose-loader/) instead.)
4141

4242
Then you can use the `expose-loader` using two approaches.
4343

@@ -48,7 +48,7 @@ The documentation and syntax examples can be read [here](#syntax).
4848

4949
> [!WARNING]
5050
>
51-
> `%20` is space in a query string, because you can't use spaces in URLs
51+
> `%20` represents a `space` in a query string because spaces are not allowed in URLs.
5252
5353
```js
5454
import $ from "expose-loader?exposes=$,jQuery!jquery";
@@ -115,10 +115,10 @@ module.exports = {
115115
```
116116

117117
The [`require.resolve`](https://nodejs.org/api/modules.html#modules_require_resolve_request_options) call is a Node.js function (unrelated to `require.resolve` in webpack processing).
118-
`require.resolve` gives you the absolute path to the module (`"/.../app/node_modules/jquery/dist/jquery.js"`).
119-
So the expose only applies to the `jquery` module. And it's only exposed when used in the bundle.
118+
`require.resolve` that returns the absolute path of the module (`"/.../app/node_modules/jquery/dist/jquery.js"`).
119+
So the expose only applies to the `jquery` module and it's only exposed when used in the bundle.
120120

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

123123
## Options
124124

@@ -155,17 +155,17 @@ List of exposes.
155155

156156
#### `string`
157157

158-
Allows to use a string to describe an expose.
158+
Allows to use a `string` to describe an expose.
159159

160160
##### `syntax`
161161

162162
The `|` or `%20` (space) allow to separate the `globalName`, `moduleLocalName` and `override` of expose.
163163

164164
String syntax - `[[globalName] [moduleLocalName] [override]]` or `[[globalName]|[moduleLocalName]|[override]]`, where:
165165

166-
- `globalName` - the name in the global object, for example `window.$` for a browser environment (**required**)
167-
- `moduleLocalName` - the name of method/variable/etc of the module (the module must export it) (**may be omitted**)
168-
- `override` - allows to override existing value in the global object (**may be omitted**)
166+
- `globalName` - The name on the global object, for example `window.$` for a browser environment (**required**)
167+
- `moduleLocalName` - The name of method/variable etc of the module (the module must export it) (**may be omitted**)
168+
- `override` - Allows to override existing value in the global object (**may be omitted**)
169169

170170
If `moduleLocalName` is not specified, it exposes the entire module to the global object, otherwise it exposes only the value of `moduleLocalName`.
171171

@@ -262,7 +262,7 @@ type moduleLocalName = string;
262262

263263
Default: `undefined`
264264

265-
The name of method/variable/etc of the module (the module must export it).
265+
The name of method/variable etc of the module (the module must export it).
266266
If `moduleLocalName` is specified, it exposes only the value of `moduleLocalName`.
267267

268268
**src/index.js**
@@ -375,7 +375,7 @@ module.exports = {
375375

376376
It will expose **only** `map`, `filter` and `find` (under `myNameForFind` name) methods to the global object.
377377

378-
In a browser these methods will be available under `windows._.map(..args)`, `windows._.filter(...args)` and `windows._.myNameForFind(...args)` methods.
378+
In browsers, these methods will be available under `windows._.map(..args)`, `windows._.filter(...args)` and `windows._.myNameForFind(...args)` methods.
379379

380380
### `globalObject`
381381

@@ -460,7 +460,8 @@ module.exports = {
460460

461461
## Contributing
462462

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

465466
[CONTRIBUTING](./.github/CONTRIBUTING.md)
466467

0 commit comments

Comments
 (0)