Skip to content

Commit 7ad0d64

Browse files
authored
Merge pull request #381 from pastelsky/patch-1
Better wording and grammar / punctuation fixes for first part of rules documentation
2 parents c115669 + 9c73329 commit 7ad0d64

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

content/configuration/module.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ These options determine how the [different types of modules](/concepts/modules)
1212

1313
`RegExp | [RegExp]`
1414

15-
Prevent webpack from parsing any files matching the given regular expression(s). Ignored files **should not** have calls to `import`, `require`, `define` or any other importing mechanism. This can boost build performance when ignoring large libraries...
15+
Prevent webpack from parsing any files matching the given regular expression(s). Ignored files **should not** have calls to `import`, `require`, `define` or any other importing mechanism. This can boost build performance when ignoring large libraries.
1616

1717
```js
1818
noParse: /jquery|backbone/
@@ -25,35 +25,33 @@ noParse: /jquery|backbone/
2525
An array of [Rules](#rule) which are matched to requests when modules are created. These rules can modify how the module is created. They can apply loaders to the module, or modify the parser.
2626

2727

28-
## `Rule`
28+
## Rule
2929

30-
A Rule can be separated into three parts: Conditions, Results and nested Rules.
30+
A Rule can be separated into three parts Conditions, Results and nested Rules.
3131

32-
### `Rule` conditions
32+
### Rule conditions
3333

3434
There are two input values for the conditions:
3535

36-
The resource: An absolute path to the file requested. It's already resolved according the [`resolve` rules](/configuration/resolve).
36+
1. The resource: An absolute path to the file requested. It's already resolved according the [`resolve` rules](/configuration/resolve).
3737

38-
The issuer: An absolute path to the file of the module which requested the resource. It's the location of the import.
38+
2. The issuer: An absolute path to the file of the module which requested the resource. It's the location of the import.
3939

40-
**Example:** The `import "./style.css"` from `app.js`:
41-
42-
Resource is `/path/to/style.css`. Issuer is `/path/to/app.js`.
40+
**Example:** When we `import "./style.css"` from `app.js`, the resource is `/path/to/style.css` and the issuer is `/path/to/app.js`.
4341

4442
In a Rule the properties [`test`](#rule-test), [`include`](#rule-include), [`exclude`](#rule-exclude) and [`resource`](#rule-resource) are matched with the resource and the property [`issuer`](#rule-issuer) is matched with the issuer.
4543

4644
When using multiple conditions, all conditions must match.
4745

48-
### `Rule` results
46+
### Rule results
4947

50-
Rule results are only used when the Rule condition matches.
48+
Rule results are used only when the Rule condition matches.
5149

5250
There are two output values of a Rule:
5351

54-
The applied loaders: An array of loaders applied to the resource. Separated in pre-, post- and normal loaders.
52+
1. Applied loaders: An array of loaders applied to the resource.
5553

56-
The parser options: An object with options which should be used to create the parser for this module.
54+
2. Parser options: An options object which should be used to create the parser for this module.
5755

5856
These properties affect the loaders: [`loader`](#rule-loader), [`options`](#rule-options-rule-query), [`use`](#rule-use).
5957

@@ -64,16 +62,15 @@ The [`enforce`](#rule-enforce) property affect the loader category. Whether it's
6462
The [`parser`](#rule-parser) property affect the parser options.
6563

6664

67-
## `Rule` nested rules
68-
69-
With the properties [`rules`](#rule-rules) and [`oneOf`](#rule-oneof) nested rules can be specified.
65+
## Nested rules
7066

71-
Nested rules are used when the Rule condition matches.
67+
Nested rules can be specified under the properties [`rules`](#rule-rules) and [`oneOf`](#rule-oneof).
7268

69+
These rules are evaluated when the Rule condition matches.
7370

7471
## `Rule.enforce`
7572

76-
Either `"pre"`, `"post"` or no value.
73+
Possible values: `"pre" | "post"`
7774

7875
Specifies the category of the loader. No value means normal loader.
7976

0 commit comments

Comments
 (0)