mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
fix webpack handling for svg imports (#21311)
This commit is contained in:
parent
3f2ad33b2b
commit
30339bd9a3
@ -456,6 +456,7 @@ module.exports = (env, argv) => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.svg$/,
|
test: /\.svg$/,
|
||||||
|
issuer: /\.(js|ts|jsx|tsx|html)$/,
|
||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
loader: '@svgr/webpack',
|
loader: '@svgr/webpack',
|
||||||
@ -478,10 +479,28 @@ module.exports = (env, argv) => {
|
|||||||
outputPath: getAssetOutputPath,
|
outputPath: getAssetOutputPath,
|
||||||
publicPath: function (url, resourcePath) {
|
publicPath: function (url, resourcePath) {
|
||||||
const outputPath = getAssetOutputPath(url, resourcePath);
|
const outputPath = getAssetOutputPath(url, resourcePath);
|
||||||
return toPublicPath(path.join("../..", outputPath));
|
return toPublicPath(outputPath);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
loader: 'file-loader',
|
||||||
|
options: {
|
||||||
|
esModule: false,
|
||||||
|
name: '[name].[hash:7].[ext]',
|
||||||
|
outputPath: getAssetOutputPath,
|
||||||
|
publicPath: function (url, resourcePath) {
|
||||||
|
const outputPath = getAssetOutputPath(url, resourcePath);
|
||||||
|
return toPublicPath(outputPath);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.svg$/,
|
||||||
|
issuer: /\.(scss|css)$/,
|
||||||
|
use: [
|
||||||
{
|
{
|
||||||
loader: 'file-loader',
|
loader: 'file-loader',
|
||||||
options: {
|
options: {
|
||||||
|
Loading…
Reference in New Issue
Block a user