Merge pull request #3048 from yoichiro/improve-instruction-for-webpack-plugin

Improve the instruction for each Webpack version.
This commit is contained in:
Henning Dieterichs 2022-03-31 12:51:35 +02:00 committed by GitHub
commit d001070938
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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