W
W
woneorb2020-08-24 19:35:13
JavaScript
woneorb, 2020-08-24 19:35:13

Why does CopyWebpackPlugin mess up images?

The bottom line is that after running webpack in dev mode, all images, except for .svg, break down and become unopenable, metadata are deleted, but the file size remains the same.

The main joke is that this happens in the source folder, that is, it turns out that corrupted images and source files and in the bundle I

didn’t connect any minimizers, plugins for images, only СopyWebpackPlugin:

new CopyWebpackPlugin({
      patterns: [{
          from: path.resolve(__dirname, 'src/static'),
          to: path.resolve(__dirname, 'dist/static'),
      }],
    }),
...
{
    test: /\.(webp|jpg|png|svg|gif|woff|woff2|ttf|otf|eot)$/,
    loader: 'file-loader',
},


Has anyone encountered a similar problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question