Build: Replace the file-loader loader with asset module in webpack config (#53088)
This commit is contained in:
@@ -2,7 +2,6 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
|
||||
const CopyUniconsPlugin = require('./plugins/CopyUniconsPlugin');
|
||||
const CorsWorkerPlugin = require('./plugins/CorsWorkerPlugin');
|
||||
|
||||
module.exports = {
|
||||
@@ -45,7 +44,6 @@ module.exports = {
|
||||
new webpack.ProvidePlugin({
|
||||
Buffer: ['buffer', 'Buffer'],
|
||||
}),
|
||||
new CopyUniconsPlugin(),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{
|
||||
@@ -98,15 +96,15 @@ module.exports = {
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
},
|
||||
// for pre-caching SVGs as part of the JS bundles
|
||||
{
|
||||
test: /\.svg$/,
|
||||
use: 'raw-loader',
|
||||
},
|
||||
{
|
||||
test: /\.(svg|ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/,
|
||||
loader: 'file-loader',
|
||||
options: { name: 'static/img/[name].[contenthash:8].[ext]' },
|
||||
type: 'asset/resource',
|
||||
generator: { filename: 'static/img/[name].[hash:8][ext]' },
|
||||
},
|
||||
// for pre-caching SVGs as part of the JS bundles
|
||||
{
|
||||
test: /(unicons|mono|custom)[\\/].*\.svg$/,
|
||||
type: 'asset/source',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user