fix(react): add fallback for SVG imports coming from non-TS/JS modules (#2351)
This commit is contained in:
parent
1132d9ec57
commit
20885513ae
@ -18,6 +18,9 @@ function getWebpackConfig(config: Configuration) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.svg$/,
|
test: /\.svg$/,
|
||||||
|
oneOf: [
|
||||||
|
// If coming from JS/TS file, then transform into React component using SVGR.
|
||||||
|
{
|
||||||
issuer: {
|
issuer: {
|
||||||
test: /\.[jt]sx?$/
|
test: /\.[jt]sx?$/
|
||||||
},
|
},
|
||||||
@ -31,6 +34,20 @@ function getWebpackConfig(config: Configuration) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
// Fallback to plain URL loader.
|
||||||
|
{
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'url-loader',
|
||||||
|
options: {
|
||||||
|
limit: 10000, // 10kB
|
||||||
|
name: '[name].[hash:7].[ext]'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user