Skip to content

Commit

Permalink
Fix: Updated documentation for Webpack 5 (#3057)
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Walczak <[email protected]>
  • Loading branch information
serybva and lukewalczak authored Mar 23, 2022
1 parent 30a4e27 commit a70a8fc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/pages/5.react-native-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ Now, add the following in the `module.rules` array in your webpack config:

### 3. Configure `file-loader`

#### webpack < 5.0

To be able to import images and other assets using `require`, we need to configure `file-loader`. Let's install it:

```sh
Expand All @@ -217,6 +219,17 @@ To configure it, add the following in the `module.rules` array in your webpack c
}
```

##### webpack >= 5.0

Use `asset/resource`, since `file-loader` was deprecated in webpack v5.

```js
{
test: /\.(jpg|png|woff|woff2|eot|ttf|svg)$/,
type: 'asset/resource'
}
```

## Load the Material Community Icons

If you followed the getting started guide, you should have the following code in your root component:
Expand Down

0 comments on commit a70a8fc

Please sign in to comment.