diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index bd8db711a0c..96fd632b795 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -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]' + } } ] }, diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index df970584a9e..c2f066e5d6a 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -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]' + } } ] }, diff --git a/tasks/e2e.sh b/tasks/e2e.sh index 58e6ad53ee8..ce7b50f35b5 100755 --- a/tasks/e2e.sh +++ b/tasks/e2e.sh @@ -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.