static-dev / spike-core

:warning: UNMAINTAINED :warning: A modern static build tool, powered by webpack
https://spike.js.org
Other
58 stars 9 forks source link

Image-webpack loader not passing through images #180

Closed elvingm closed 7 years ago

elvingm commented 8 years ago

In my app.production.js I have tried the following configs for image-webpack-loader so it can optimize my images:

{ test: /\.(jpe?g|png|gif|svg)$/i, loader: 'source!image-webpack' }
{ test: /\.(jpe?g|png|gif|svg)$/i, loader: 'source-loader!image-webpack' }
{
    test: /\.(jpe?g|png|gif|svg)$/i,
    loaders: [
      'file?hash=sha512&digest=hex&name=[hash].[ext]',
       'image-webpack'
    ]
}

and with the file-loader as well as recommended by image-webpack-loader docs

{
    test: /\.(jpe?g|png|gif|svg)$/i,
    loaders: [
      'file?hash=sha512&digest=hex&name=[hash].[ext]',
       'source!image-webpack'
    ]
}

In each case the only file that gets passed through is favicon.ico out of a list of images which contain jpg's, gif, png, and svgs.

jescalan commented 7 years ago

So the fix here is just to run it with image-webpack and no source loader 😁 Just a followup before closing!