Skip to content

Commit bf591ee

Browse files
committed
Corrected typos and else from review comments
1 parent edb6adf commit bf591ee

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

content/concepts/module-resolution.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ A resolver is a library which helps in locating a module by its absolute path.
1010
A module can be required as a dependency from another module as:
1111

1212
```js
13-
import module from 'path/to/module'
13+
import foo from 'path/to/module'
1414
// or
1515
require('path/to/module')
1616
```
1717

1818
The dependency module can be from the application code or a third party library. The resolver helps
19-
webpack find the module code that needs to be included in the bundle for every such `require`/`import` statement.
19+
webpack finds the module code that needs to be included in the bundle for every such `require`/`import` statement.
2020
webpack uses [enhanced-resolve](https://github.com/webpack/enhanced-resolve) to resolve file paths while bundling modules.
2121

2222
## Resolving rules in webpack
2323

2424
Using `enhanced-resolve`, webpack can resolve three kinds of file paths:
2525

26-
### 1. Absolute paths
26+
### Absolute paths
2727

2828
```js
2929
import "/home/me/file";
@@ -33,7 +33,7 @@ import "C:\\Users\\me\\file";
3333

3434
Since we already have the absolute path to the file, no further resolution is required.
3535

36-
### 2. Relative paths
36+
### Relative paths
3737

3838
```js
3939
import "../src/file1";
@@ -42,7 +42,7 @@ import "./file2";
4242

4343
In this case, the directory of the resource file where the `import` or `require` occurs is taken to be the context directory. The relative path specified in the `import/require` is joined to this context path to produce the absolute path to the module.
4444

45-
### 3. Module paths
45+
### Module paths
4646

4747
```js
4848
import "module";
@@ -61,7 +61,7 @@ If the path points to a folder, then the following steps are taken to find the r
6161
* If there is no `package.json` or if the main fields do not return a valid path, file names specified in the [`resolve.mainFiles`](/configuration/resolve/#resolve-mainfiles) configuration option are looked for in order, to see if a matching filename exists in the imported/required directory .
6262
* The file extension is then resolved in a similar way using the `resolve.extensions` option.
6363

64-
Webpack provides reasonable [defaults](/configuration/resolve) for these options depending on your build target.
64+
webpack provides reasonable [defaults](/configuration/resolve) for these options depending on your build target.
6565

6666
## Resolving Loaders
6767

0 commit comments

Comments
 (0)