Improve the instruction for each Webpack version.

This commit is contained in:
Yoichiro Tanaka 2022-03-31 14:00:45 +09:00
parent d3a5ccae5e
commit 9f5f254d2e

View file

@ -30,7 +30,7 @@ module.exports = {
}, },
{ {
test: /\.ttf$/, test: /\.ttf$/,
use: ['file-loader'] type: 'asset/resource'
} }
] ]
}, },
@ -38,6 +38,15 @@ module.exports = {
}; };
``` ```
If using Webpack 4 or lower, it is necessary to use the file-loader instead of Asset Modules like the code below:
```js
{
test: /\.ttf$/,
use: ['file-loader']
}
```
- `index.js`: - `index.js`:
```js ```js