imagemin-webp-webpack-plugin
imagemin-webp-webpack-plugin copied to clipboard
ERROR in outputName is not defined
Please help!
Can't convert images to webp, error messages appears "ERROR in outputName is not defined" "ERROR in ImageminWebpWebpackPlugin: "images/hero/hero.png" wasn't converted!"
here's my webpack.mix.js
`let mix = require('laravel-mix');
const ImageminPlugin = require('imagemin-webpack-plugin').default; const CopyWebpackPlugin = require('copy-webpack-plugin'); const imageminMozjpeg = require('imagemin-mozjpeg'); const ImageminWebpWebpackPlugin = require("imagemin-webp-webpack-plugin");
mix.setPublicPath('public_html/');
// Images mix.webpackConfig({ plugins: [ //Compress images new CopyWebpackPlugin([{ from: '**/*', // FROM to: 'images/', // TO context: "resources/assets/images/", }]), new ImageminPlugin({ test: /.(jpe?g|png|gif|svg)$/i, pngquant: { quality: '70-80' }, plugins: [ imageminMozjpeg({ quality: 85, //Set the maximum memory to use in kbytes maxmemory: 1000 * 512 }) ] }), new ImageminWebpWebpackPlugin({ config: [{ test: /.(jpe?g|png)/, options: { quality: 75 } }], overrideExtension: true, detailedLogs: true, silent: false, strict: true }) ], });`