Skip to content

Commit 49d0b5a

Browse files
refactor: remove file-loader and use asset modules instead (#1855)
1 parent b6930f8 commit 49d0b5a

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

package-lock.json

Lines changed: 0 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
"eslint": "6.8.0",
9999
"eslint-plugin-jest": "23.8.2",
100100
"eslint-plugin-react": "7.19.0",
101-
"file-loader": "6.0.0",
102101
"http-server": "0.12.0",
103102
"jest": "24.8.0",
104103
"madge": "5.0.1",

webpack/base.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ module.exports = {
2020
context: path.join(__dirname, '../src'),
2121
output: {
2222
filename: '[name].bundle.js',
23-
publicPath: 'bundles/'
23+
publicPath: 'bundles/',
24+
assetModuleFilename: 'img/[hash][ext]'
2425
},
2526
resolve: {
2627
modules: [__dirname,path.join(__dirname, '../src'), path.join(__dirname, '../node_modules')]
@@ -67,10 +68,10 @@ module.exports = {
6768
use: [ 'style-loader', 'css-loader' ]
6869
}, {
6970
test: /\.png$/,
70-
use: { loader: 'file-loader?name=img/[hash].[ext]' }
71+
type: 'asset/resource'
7172
}, {
7273
test: /\.jpg$/,
73-
use: { loader: 'file-loader?name=img/[hash].[ext]' }
74+
type: 'asset/resource'
7475
}, {
7576
test: /\.flow$/,
7677
use: 'null-loader'

0 commit comments

Comments
 (0)