diff --git a/docs/pages/5.react-native-web.md b/docs/pages/5.react-native-web.md index 5ba30bf033..05f12dbb77 100644 --- a/docs/pages/5.react-native-web.md +++ b/docs/pages/5.react-native-web.md @@ -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 @@ -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: