From 72a0b32285127b9e66e10ae259285fc53c4bb6af Mon Sep 17 00:00:00 2001 From: Stan Chollet Date: Wed, 17 Aug 2016 13:19:08 +0200 Subject: [PATCH] (webpack loaders) manage images links with query parameters When a image link contains query parameter, webpack doesn't handle it. e.g. with a link to an .svg file -> .../file.svg?v=1 the file will not be handle by webpack, and the user will get an error like below. ``` Module parse failed: /.../node_modules/font-awesome/fonts/fontawesome-webfont.svg?v=4.6.3 Unexpected token (1:0) You may need an appropriate loader to handle this file type. ``` --- lib/utils/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/webpack.config.js b/lib/utils/webpack.config.js index 4458e1c647a08..5a57ee0156fe3 100644 --- a/lib/utils/webpack.config.js +++ b/lib/utils/webpack.config.js @@ -232,7 +232,7 @@ module.exports = (program, directory, suppliedStage, webpackPort = 1500, routes }) // Image loaders. config.loader('images', { - test: /\.(jpe?g|png|gif|svg)$/i, + test: /\.(jpe?g|png|gif|svg)(\?.*)?$/i, loaders: [ 'url-loader?limit=10000', 'image-webpack-loader?{progressive:true, optimizationLevel: 7, interlaced: false, pngquant:{quality: "65-90", speed: 4}}', // eslint-disable-line