mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-01-12 22:46:30 +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]'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -138,7 +138,8 @@ module.exports = {
|
||||
/\.html$/,
|
||||
/\.(js|jsx)$/,
|
||||
/\.css$/,
|
||||
/\.json$/
|
||||
/\.json$/,
|
||||
/\.svg$/
|
||||
],
|
||||
loader: 'url',
|
||||
query: {
|
||||
@@ -180,6 +181,14 @@ module.exports = {
|
||||
{
|
||||
test: /\.json$/,
|
||||
loader: 'json'
|
||||
},
|
||||
// "file" loader for svg
|
||||
{
|
||||
test: /\.svg$/,
|
||||
loader: 'file',
|
||||
query: {
|
||||
name: 'static/media/[name].[hash:8].[ext]'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -76,6 +76,7 @@ npm run build
|
||||
test -e build/*.html
|
||||
test -e build/static/js/*.js
|
||||
test -e build/static/css/*.css
|
||||
test -e build/static/media/*.svg
|
||||
test -e build/favicon.ico
|
||||
|
||||
# Run tests with CI flag
|
||||
@@ -140,6 +141,7 @@ npm run build
|
||||
test -e build/*.html
|
||||
test -e build/static/js/*.js
|
||||
test -e build/static/css/*.css
|
||||
test -e build/static/media/*.svg
|
||||
test -e build/favicon.ico
|
||||
|
||||
# Run tests with CI flag
|
||||
@@ -169,6 +171,7 @@ npm run build
|
||||
test -e build/*.html
|
||||
test -e build/static/js/*.js
|
||||
test -e build/static/css/*.css
|
||||
test -e build/static/media/*.svg
|
||||
test -e build/favicon.ico
|
||||
|
||||
# Run tests, overring the watch option to disable it.
|
||||
|
||||
Reference in New Issue
Block a user