Skip to content

Commit

Permalink
(webpack loaders) manage images links with query parameters (#398)
Browse files Browse the repository at this point in the history
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.
```
  • Loading branch information
tsunammis authored and KyleAMathews committed Aug 18, 2016
1 parent bfbe313 commit 1181313
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1181313

Please # to comment.