From fa1e1b717bd71dd718ef7ed06d1f89cbd6112244 Mon Sep 17 00:00:00 2001 From: Brian McBride Date: Mon, 1 Oct 2018 19:02:49 -0700 Subject: [PATCH] Fix for issue #4066 / #4180 The webpack currently uses both file-loader and svg-url-loader. file-loader will handle .svg files just fine. svg-url-loader is causing images to not load properly. This might be identified by @cainlevy in issue 4180: > svg-url-loader is not drop-in compatible with url-loader. Unless there is a compelling reason to use svg-url-loader instead of just leveraging the currently utilized url-loader, this change seems to fix the issues and can result in removing the dependency on svg-url-loader from the repo completely. --- lib/core/src/server/config/webpack.config.default.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/core/src/server/config/webpack.config.default.js b/lib/core/src/server/config/webpack.config.default.js index 3af1c9fc98fd..4e1362300e72 100644 --- a/lib/core/src/server/config/webpack.config.default.js +++ b/lib/core/src/server/config/webpack.config.default.js @@ -33,16 +33,12 @@ export function createDefaultWebpackConfig(storybookBaseConfig) { ], }, { - test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2)(\?.*)?$/, + test: /\.(svg|ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2)(\?.*)?$/, loader: require.resolve('file-loader'), query: { name: 'static/media/[name].[hash:8].[ext]', }, }, - { - test: /\.svg$/, - loader: require.resolve('svg-url-loader'), - }, { test: /\.(mp4|webm|wav|mp3|m4a|aac|oga)(\?.*)?$/, loader: require.resolve('url-loader'),