remove file loader as dependency (#5012)

This commit is contained in:
Scott Bell 2022-03-30 18:58:26 +02:00 committed by GitHub
parent 47b6d19de8
commit 0a511e6155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 20 deletions

View File

@ -32,7 +32,6 @@
"eventemitter3": "1.2.0",
"exports-loader": "0.7.0",
"express": "4.13.1",
"file-loader": "6.2.0",
"file-saver": "2.0.5",
"git-rev-sync": "3.0.2",
"html2canvas": "1.4.1",

View File

@ -109,25 +109,24 @@ const config = {
]
},
{
test: /\.(jpg|jpeg|png|svg|ico|woff|woff2?|eot|ttf)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath(url, resourcePath, context) {
if (/\.(jpg|jpeg|png|svg)$/.test(url)) {
return `images/${url}`;
}
if (/\.ico$/.test(url)) {
return `icons/${url}`;
}
if (/\.(woff|woff2?|eot|ttf)$/.test(url)) {
return `fonts/${url}`;
} else {
return `${url}`;
}
}
test: /\.(jpg|jpeg|png|svg)$/,
type: 'asset/resource',
generator: {
filename: 'images/[name][ext]'
}
},
{
test: /\.ico$/,
type: 'asset/resource',
generator: {
filename: 'icons/[name][ext]'
}
},
{
test: /\.(woff|woff2?|eot|ttf)$/,
type: 'asset/resource',
generator: {
filename: 'fonts/[name][ext]'
}
}
]
@ -135,4 +134,5 @@ const config = {
stats: 'errors-warnings'
};
// eslint-disable-next-line no-undef
module.exports = config;