From 9f5f254d2efe7c19ce9d3bf2ac8ef87c71480f78 Mon Sep 17 00:00:00 2001 From: Yoichiro Tanaka Date: Thu, 31 Mar 2022 14:00:45 +0900 Subject: [PATCH] Improve the instruction for each Webpack version. --- webpack-plugin/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webpack-plugin/README.md b/webpack-plugin/README.md index 3dbc5d65..b457178c 100644 --- a/webpack-plugin/README.md +++ b/webpack-plugin/README.md @@ -30,7 +30,7 @@ module.exports = { }, { 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`: ```js