Use file-loader for svgs (#1180)

This commit is contained in:
Bogdan Soare
2016-12-06 18:07:50 +02:00
committed by Dan Abramov
parent d8dfdb01c7
commit 15feb02e9c
3 changed files with 23 additions and 2 deletions

View File

@@ -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]'
}
}
]
},

View File

@@ -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]'
}
}
]
},

View File

@@ -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.