mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-25 13:45:42 +08:00
Use file-loader for svgs (#1180)
This commit is contained in:
committed by
Dan Abramov
parent
d8dfdb01c7
commit
15feb02e9c
@@ -131,7 +131,8 @@ module.exports = {
|
||||
/\.html$/,
|
||||
/\.(js|jsx)$/,
|
||||
/\.css$/,
|
||||
/\.json$/
|
||||
/\.json$/,
|
||||
/\.svg$/
|
||||
],
|
||||
loader: 'url',
|
||||
query: {
|
||||
@@ -169,6 +170,14 @@ module.exports = {
|
||||
{
|
||||
test: /\.json$/,
|
||||
loader: 'json'
|
||||
},
|
||||
// "file" loader for svg
|
||||
{
|
||||
test: /\.svg$/,
|
||||
loader: 'file',
|
||||
query: {
|
||||
name: 'static/media/[name].[hash:8].[ext]'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user